1
2
3
4
5
6
7
8
9
10
11
12
13
14 from zope.interface import Interface, Attribute
15 from zope.app.container.interfaces import IContained, IContainer
16
17
19 """
20 A single message. Messages are stored in user-specific MessageQueue objects
21 and in the session object.
22 """
23 title = Attribute("Title of the message")
24 body = Attribute("Body of the message")
25 image = Attribute("Optional path to image to be displayed")
26 priority = Attribute("Priority of the message")
27 timestamp = Attribute("Time the message was sent")
28
30 """
31 Delete this message from any queues in which it exists.
32 """
34 """
35 Mark this message as read.
36 """
37
38
40 """
41 Something able to send messages.
42 """
44 """
45 Create a message and store it on the request object.
46 """
47 - def sendToUser(title, body, priority, image, user):
48 """
49 Create a message and store it in the L{IMessageQueue} of the user
50 specified. If no user is specified, use the queue of the current user.
51 """
53 """
54 For eash user in the system, create an identical message and store it
55 in the user's L{IMessageQueue}.
56 """
57
58
60 """
61 Marker interface for a message container.
62 """
63
64
66 """
67 Something that can provide messages.
68 """
69 messagebox = Attribute("The source of IMessage objects.")
71 """
72 Return all messages.
73 """
75 """
76 Return all messages that have not been marked as read.
77 """
78
79
81 """
82 Object that is able to provide IMessage objects from a user queue.
83 """
84
85
87 """
88 Object that is able to provide IMessage objects from the request.
89 """
90