7675.1029.2
by Gary Poster
respond to review by adding current year to copyright |
1 |
# Copyright 2010-2011 Canonical Ltd. This software is licensed under the
|
7675.1029.1
by Gary Poster
move bugnotificationlevel enum from registry to bugs |
2 |
# GNU Affero General Public License version 3 (see the file LICENSE).
|
3 |
||
4 |
"""Enums for the Bugs app."""
|
|
5 |
||
6 |
__metaclass__ = type |
|
7 |
__all__ = [ |
|
8 |
'BugNotificationLevel', |
|
12366.6.20
by Gary Poster
convert is_omitted to status enum on BugNotification, per review. |
9 |
'BugNotificationStatus', |
7675.1029.1
by Gary Poster
move bugnotificationlevel enum from registry to bugs |
10 |
]
|
11 |
||
12 |
from lazr.enum import ( |
|
13 |
DBEnumeratedType, |
|
14 |
DBItem, |
|
15 |
)
|
|
16 |
||
17 |
||
18 |
class BugNotificationLevel(DBEnumeratedType): |
|
19 |
"""Bug Notification Level.
|
|
20 |
||
21 |
The type and volume of bug notification email sent to subscribers.
|
|
22 |
"""
|
|
23 |
||
24 |
LIFECYCLE = DBItem(20, """ |
|
25 |
Lifecycle
|
|
26 |
||
27 |
Only send a low volume of notifications about new bugs registered,
|
|
28 |
bugs removed or bug targetting.
|
|
29 |
""") |
|
30 |
||
31 |
METADATA = DBItem(30, """ |
|
32 |
Details
|
|
33 |
||
34 |
Send bug lifecycle notifications, as well as notifications about
|
|
35 |
changes to the bug's details like status and description.
|
|
36 |
""") |
|
37 |
||
38 |
COMMENTS = DBItem(40, """ |
|
39 |
Discussion
|
|
40 |
||
41 |
Send bug lifecycle notifications, detail change notifications and
|
|
42 |
notifications about new events in the bugs's discussion, like new
|
|
43 |
comments.
|
|
44 |
""") |
|
12366.6.20
by Gary Poster
convert is_omitted to status enum on BugNotification, per review. |
45 |
|
46 |
||
47 |
class BugNotificationStatus(DBEnumeratedType): |
|
48 |
"""The status of a bug notification.
|
|
7675.1056.1
by Curtis Hovey
Merged stable and resolved conflicts. |
49 |
|
12366.6.20
by Gary Poster
convert is_omitted to status enum on BugNotification, per review. |
50 |
A notification may be pending, sent, or omitted."""
|
51 |
||
52 |
PENDING = DBItem(10, """ |
|
53 |
Pending
|
|
7675.1056.1
by Curtis Hovey
Merged stable and resolved conflicts. |
54 |
|
12366.6.20
by Gary Poster
convert is_omitted to status enum on BugNotification, per review. |
55 |
The notification has not yet been sent.
|
56 |
""") |
|
57 |
||
58 |
OMITTED = DBItem(20, """ |
|
59 |
Omitted
|
|
7675.1056.1
by Curtis Hovey
Merged stable and resolved conflicts. |
60 |
|
12366.6.20
by Gary Poster
convert is_omitted to status enum on BugNotification, per review. |
61 |
The system considered sending the notification, but omitted it.
|
62 |
This is generally because the action reported by the notification
|
|
63 |
was immediately undone.
|
|
64 |
""") |
|
65 |
||
66 |
SENT = DBItem(30, """ |
|
67 |
Sent
|
|
7675.1056.1
by Curtis Hovey
Merged stable and resolved conflicts. |
68 |
|
12366.6.20
by Gary Poster
convert is_omitted to status enum on BugNotification, per review. |
69 |
The notification has been sent.
|
70 |
""") |
|
13506.10.2
by Brad Crittenden
Horrible checkpoint |
71 |
|
72 |
DEFERRED = DBItem(40, """ |
|
73 |
Deferred
|
|
74 |
||
75 |
The notification is deferred. The recipient list was not calculated
|
|
76 |
at creation time but is done when processed.
|
|
77 |
""") |