diff options
| author | Sébastien Dailly <sebastien@dailly.me> | 2025-07-07 08:31:38 +0200 | 
|---|---|---|
| committer | Sébastien Dailly <sebastien@dailly.me> | 2025-07-07 08:32:41 +0200 | 
| commit | f2b300d9e01547628cd409f9666d457b5ea045ee (patch) | |
| tree | daf4e52ebd5bd8d2f4e708d4e467b88cdba3f724 /interfaces | |
| parent | 69a6777bf3b849ec2ab0627b6ad66a57298f9d45 (diff) | |
Added error message
Diffstat (limited to 'interfaces')
| -rwxr-xr-x | interfaces/message.py | 19 | 
1 files changed, 18 insertions, 1 deletions
| diff --git a/interfaces/message.py b/interfaces/message.py index 23ce2ec..bf05bef 100755 --- a/interfaces/message.py +++ b/interfaces/message.py @@ -1,14 +1,31 @@ +"""Messages sent to the user.
 +"""
 +
  from zope import interface
  from zope.interface import Attribute
  class IMessage(interface.Interface):
 +    """Interface for all the user messages.
 +    """
      content = Attribute("""The text message to log""")
 +    level = Attribute("""Level of the message, 0 is high level and 10 is the lower""")
  class ISocketMessage(interface.Interface):
 +    """Message to sent to the endpoint."""
      content = Attribute("""Content to send""")
  @interface.implementer(IMessage)
 -class Debug(object):
 +class Debug():
 +    """Send a message with a low level"""
 +
 +    def __init__(self, message):
 +        self.content = message
 +        self.level = 10
 +
 +@interface.implementer(IMessage)
 +class Error():
 +    """Send a message with a high level"""
      def __init__(self, message):
          self.content = message
 +        self.level = 0
 | 
