Merge lp:~thumper/launchpad/move-code-events into lp:launchpad

Proposed by Tim Penhey
Status: Merged
Approved by: Tim Penhey
Approved revision: no longer in the source branch.
Merged at revision: 10541
Proposed branch: lp:~thumper/launchpad/move-code-events
Merge into: lp:launchpad
Diff against target: 144 lines (+43/-30)
4 files modified
lib/canonical/launchpad/event/interfaces.py (+0/-23)
lib/lp/code/configure.zcml (+6/-6)
lib/lp/code/event/branchmergeproposal.py (+1/-1)
lib/lp/code/interfaces/event.py (+36/-0)
To merge this branch: bzr merge lp:~thumper/launchpad/move-code-events
Reviewer Review Type Date Requested Status
Stuart Bishop (community) Approve
Review via email: mp+21535@code.launchpad.net

Commit message

Move lp-code event interfaces into lp.code.interfaces.event.

Description of the change

A simple branch that just moves four interfaces into lp.code.interfaces.

To post a comment you must log in.
Revision history for this message
Stuart Bishop (stub) wrote :

Fine

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/canonical/launchpad/event/interfaces.py'
2--- lib/canonical/launchpad/event/interfaces.py 2009-06-25 05:30:52 +0000
3+++ lib/canonical/launchpad/event/interfaces.py 2010-03-17 08:05:41 +0000
4@@ -5,13 +5,9 @@
5
6 __metaclass__ = type
7 __all__ = [
8- 'IBranchMergeProposalStatusChangeEvent',
9 'IJoinTeamEvent',
10 'IKarmaAssignedEvent',
11 'IMessageHeldEvent',
12- 'INewBranchMergeProposalEvent',
13- 'INewCodeReviewCommentEvent',
14- 'IReviewerNominatedEvent',
15 'ITeamInvitationEvent',
16 ]
17
18@@ -45,22 +41,3 @@
19
20 mailing_list = Attribute('The mailing list the message is held for.')
21 message_id = Attribute('The Message-ID of the held message.')
22-
23-
24-class IBranchMergeProposalStatusChangeEvent(IObjectEvent):
25- """A merge proposal has changed state."""
26- user = Attribute("The user who updated the proposal.")
27- from_state = Attribute("The previous queue_status.")
28- to_state = Attribute("The updated queue_status.")
29-
30-
31-class INewBranchMergeProposalEvent(IObjectEvent):
32- """A new merge has been proposed."""
33-
34-
35-class IReviewerNominatedEvent(IObjectEvent):
36- """A reviewer has been nominated."""
37-
38-
39-class INewCodeReviewCommentEvent(IObjectEvent):
40- """A new comment has been added to the merge proposal."""
41
42=== modified file 'lib/lp/code/configure.zcml'
43--- lib/lp/code/configure.zcml 2010-03-05 20:00:56 +0000
44+++ lib/lp/code/configure.zcml 2010-03-17 08:05:41 +0000
45@@ -37,7 +37,7 @@
46 </class>
47 <subscriber
48 for="lp.code.interfaces.codereviewvote.ICodeReviewVoteReference
49- canonical.launchpad.event.interfaces.IReviewerNominatedEvent"
50+ lp.code.interfaces.event.IReviewerNominatedEvent"
51 handler="lp.code.mail.branchmergeproposal.send_review_requested_notifications"/>
52
53 <!-- CodeImportMachine -->
54@@ -279,7 +279,7 @@
55 </class>
56 <subscriber
57 for="lp.code.interfaces.branchmergeproposal.IBranchMergeProposal
58- canonical.launchpad.event.interfaces.INewBranchMergeProposalEvent"
59+ lp.code.interfaces.event.INewBranchMergeProposalEvent"
60 handler="lp.code.mail.branchmergeproposal.send_merge_proposal_created_notifications"/>
61 <subscriber
62 for="lp.code.interfaces.branchmergeproposal.IBranchMergeProposal
63@@ -287,11 +287,11 @@
64 handler="lp.code.mail.branchmergeproposal.send_merge_proposal_modified_notifications"/>
65 <subscriber
66 for="lp.code.interfaces.branchmergeproposal.IBranchMergeProposal
67- canonical.launchpad.event.interfaces.INewBranchMergeProposalEvent"
68+ lp.code.interfaces.event.INewBranchMergeProposalEvent"
69 handler="canonical.launchpad.subscribers.karma.branch_merge_proposed"/>
70 <subscriber
71 for="lp.code.interfaces.branchmergeproposal.IBranchMergeProposal
72- canonical.launchpad.event.interfaces.IBranchMergeProposalStatusChangeEvent"
73+ lp.code.interfaces.event.IBranchMergeProposalStatusChangeEvent"
74 handler="canonical.launchpad.subscribers.karma.branch_merge_status_changed"/>
75 <adapter
76 for="lp.code.interfaces.branchmergeproposal.IBranchMergeProposal"
77@@ -701,11 +701,11 @@
78 </class>
79 <subscriber
80 for="lp.code.interfaces.codereviewcomment.ICodeReviewComment
81- canonical.launchpad.event.interfaces.INewCodeReviewCommentEvent"
82+ lp.code.interfaces.event.INewCodeReviewCommentEvent"
83 handler="lp.code.mail.codereviewcomment.send"/>
84 <subscriber
85 for="lp.code.interfaces.codereviewcomment.ICodeReviewComment
86- canonical.launchpad.event.interfaces.INewCodeReviewCommentEvent"
87+ lp.code.interfaces.event.INewCodeReviewCommentEvent"
88 handler="canonical.launchpad.subscribers.karma.code_review_comment_added"/>
89 <adapter
90 for="lp.code.interfaces.codereviewcomment.ICodeReviewComment"
91
92=== modified file 'lib/lp/code/event/branchmergeproposal.py'
93--- lib/lp/code/event/branchmergeproposal.py 2009-06-25 04:06:00 +0000
94+++ lib/lp/code/event/branchmergeproposal.py 2010-03-17 08:05:41 +0000
95@@ -16,7 +16,7 @@
96 from zope.component.interfaces import ObjectEvent
97 from zope.interface import implements
98
99-from canonical.launchpad.event.interfaces import (
100+from lp.code.interfaces.event import (
101 IBranchMergeProposalStatusChangeEvent,
102 INewBranchMergeProposalEvent,
103 INewCodeReviewCommentEvent,
104
105=== added file 'lib/lp/code/interfaces/event.py'
106--- lib/lp/code/interfaces/event.py 1970-01-01 00:00:00 +0000
107+++ lib/lp/code/interfaces/event.py 2010-03-17 08:05:41 +0000
108@@ -0,0 +1,36 @@
109+# Copyright 2010 Canonical Ltd. This software is licensed under the
110+# GNU Affero General Public License version 3 (see the file LICENSE).
111+
112+"""Interfaces for events used in the launchpad code application."""
113+
114+__metaclass__ = type
115+__all__ = [
116+ 'IBranchMergeProposalStatusChangeEvent',
117+ 'INewBranchMergeProposalEvent',
118+ 'INewCodeReviewCommentEvent',
119+ 'IReviewerNominatedEvent',
120+ ]
121+
122+
123+from zope.component.interfaces import IObjectEvent
124+from zope.interface import Attribute
125+
126+
127+class IBranchMergeProposalStatusChangeEvent(IObjectEvent):
128+ """A merge proposal has changed state."""
129+
130+ user = Attribute("The user who updated the proposal.")
131+ from_state = Attribute("The previous queue_status.")
132+ to_state = Attribute("The updated queue_status.")
133+
134+
135+class INewBranchMergeProposalEvent(IObjectEvent):
136+ """A new merge has been proposed."""
137+
138+
139+class IReviewerNominatedEvent(IObjectEvent):
140+ """A reviewer has been nominated."""
141+
142+
143+class INewCodeReviewCommentEvent(IObjectEvent):
144+ """A new comment has been added to the merge proposal."""