"""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(): """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