aboutsummaryrefslogtreecommitdiff
path: root/interfaces
diff options
context:
space:
mode:
Diffstat (limited to 'interfaces')
-rwxr-xr-xinterfaces/message.py19
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