Merge lp:~jml/launchpad/fix-import-warnings into lp:launchpad
- fix-import-warnings
- Merge into devel
Proposed by
Jonathan Lange
Status: | Merged |
---|---|
Approved by: | Michael Hudson-Doyle |
Approved revision: | not available |
Merged at revision: | not available |
Proposed branch: | lp:~jml/launchpad/fix-import-warnings |
Merge into: | lp:launchpad |
Diff against target: |
924 lines (+118/-96) 32 files modified
lib/lp/bugs/browser/bug.py (+1/-2) lib/lp/bugs/browser/bugtarget.py (+4/-3) lib/lp/bugs/subscribers/bug.py (+7/-6) lib/lp/bugs/subscribers/bugactivity.py (+4/-2) lib/lp/bugs/subscribers/buglastupdated.py (+3/-1) lib/lp/code/browser/branch.py (+3/-5) lib/lp/code/interfaces/branch.py (+1/-2) lib/lp/code/interfaces/branchjob.py (+3/-3) lib/lp/code/interfaces/branchmergeproposal.py (+7/-3) lib/lp/code/model/branchjob.py (+3/-4) lib/lp/code/model/branchmergeproposaljob.py (+1/-0) lib/lp/code/model/branchnamespace.py (+1/-2) lib/lp/code/model/codeimport.py (+3/-4) lib/lp/codehosting/inmemory.py (+3/-3) lib/lp/codehosting/puller/worker.py (+3/-4) lib/lp/codehosting/scanner/bzrsync.py (+3/-2) lib/lp/codehosting/scanner/email.py (+2/-3) lib/lp/codehosting/vfs/branchfs.py (+3/-0) lib/lp/registry/browser/distributionsourcepackage.py (+2/-1) lib/lp/registry/browser/mentoringoffer.py (+1/-1) lib/lp/registry/browser/person.py (+2/-2) lib/lp/registry/browser/product.py (+1/-1) lib/lp/registry/browser/structuralsubscription.py (+8/-6) lib/lp/registry/interfaces/distroseries.py (+1/-0) lib/lp/registry/model/distributionsourcepackage.py (+2/-1) lib/lp/registry/model/product.py (+7/-9) lib/lp/scripts/utilities/importfascist.py (+7/-2) lib/lp/services/job/runner.py (+5/-1) lib/lp/soyuz/browser/sourcepackagerelease.py (+5/-0) lib/lp/soyuz/scripts/gina/packages.py (+12/-10) lib/lp/translations/scripts/po_import.py (+5/-6) lib/lp/translations/scripts/translations_to_branch.py (+5/-7) |
To merge this branch: | bzr merge lp:~jml/launchpad/fix-import-warnings |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Michael Hudson-Doyle | Approve | ||
Review via email: mp+16965@code.launchpad.net |
Commit message
Fix all of the import problems that were exposed by checking the 'lp' package
Description of the change
To post a comment you must log in.
Revision history for this message
Jonathan Lange (jml) wrote : | # |
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote : | # |
All good.
review:
Approve
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'lib/lp/bugs/browser/bug.py' | |||
2 | --- lib/lp/bugs/browser/bug.py 2009-12-09 16:32:19 +0000 | |||
3 | +++ lib/lp/bugs/browser/bug.py 2010-01-10 04:32:20 +0000 | |||
4 | @@ -49,9 +49,8 @@ | |||
5 | 49 | from canonical.cachedproperty import cachedproperty | 49 | from canonical.cachedproperty import cachedproperty |
6 | 50 | 50 | ||
7 | 51 | from canonical.launchpad import _ | 51 | from canonical.launchpad import _ |
8 | 52 | from canonical.launchpad.interfaces._schema_circular_imports import IBug | ||
9 | 53 | from canonical.launchpad.webapp.interfaces import ILaunchBag, NotFoundError | 52 | from canonical.launchpad.webapp.interfaces import ILaunchBag, NotFoundError |
11 | 54 | from lp.bugs.interfaces.bug import IBugSet | 53 | from lp.bugs.interfaces.bug import IBug, IBugSet |
12 | 55 | from lp.bugs.interfaces.bugattachment import BugAttachmentType | 54 | from lp.bugs.interfaces.bugattachment import BugAttachmentType |
13 | 56 | from lp.bugs.interfaces.bugtask import ( | 55 | from lp.bugs.interfaces.bugtask import ( |
14 | 57 | BugTaskSearchParams, BugTaskStatus, IBugTask, IFrontPageBugTaskSearch) | 56 | BugTaskSearchParams, BugTaskStatus, IBugTask, IFrontPageBugTaskSearch) |
15 | 58 | 57 | ||
16 | === modified file 'lib/lp/bugs/browser/bugtarget.py' | |||
17 | --- lib/lp/bugs/browser/bugtarget.py 2009-12-16 10:31:39 +0000 | |||
18 | +++ lib/lp/bugs/browser/bugtarget.py 2010-01-10 04:32:20 +0000 | |||
19 | @@ -39,6 +39,7 @@ | |||
20 | 39 | from canonical.cachedproperty import cachedproperty | 39 | from canonical.cachedproperty import cachedproperty |
21 | 40 | from canonical.config import config | 40 | from canonical.config import config |
22 | 41 | from lp.bugs.browser.bugtask import BugTaskSearchListingView | 41 | from lp.bugs.browser.bugtask import BugTaskSearchListingView |
23 | 42 | from lp.bugs.interfaces.bug import IBug | ||
24 | 42 | from canonical.launchpad.browser.feeds import ( | 43 | from canonical.launchpad.browser.feeds import ( |
25 | 43 | BugFeedLink, BugTargetLatestBugsFeedLink, FeedsMixin, | 44 | BugFeedLink, BugTargetLatestBugsFeedLink, FeedsMixin, |
26 | 44 | PersonLatestBugsFeedLink) | 45 | PersonLatestBugsFeedLink) |
27 | @@ -50,8 +51,6 @@ | |||
28 | 50 | BugTaskStatus, IBugTaskSet, UNRESOLVED_BUGTASK_STATUSES) | 51 | BugTaskStatus, IBugTaskSet, UNRESOLVED_BUGTASK_STATUSES) |
29 | 51 | from canonical.launchpad.interfaces.launchpad import ( | 52 | from canonical.launchpad.interfaces.launchpad import ( |
30 | 52 | IHasExternalBugTracker, ILaunchpadUsage) | 53 | IHasExternalBugTracker, ILaunchpadUsage) |
31 | 53 | from canonical.launchpad.interfaces._schema_circular_imports import ( | ||
32 | 54 | IBug, IDistribution) | ||
33 | 55 | from canonical.launchpad.interfaces.hwdb import IHWSubmissionSet | 54 | from canonical.launchpad.interfaces.hwdb import IHWSubmissionSet |
34 | 56 | from canonical.launchpad.interfaces.launchpad import ILaunchpadCelebrities | 55 | from canonical.launchpad.interfaces.launchpad import ILaunchpadCelebrities |
35 | 57 | from canonical.launchpad.interfaces.temporaryblobstorage import ( | 56 | from canonical.launchpad.interfaces.temporaryblobstorage import ( |
36 | @@ -62,11 +61,13 @@ | |||
37 | 62 | from lp.bugs.interfaces.bug import ( | 61 | from lp.bugs.interfaces.bug import ( |
38 | 63 | CreateBugParams, IBugAddForm, IProjectBugAddForm) | 62 | CreateBugParams, IBugAddForm, IProjectBugAddForm) |
39 | 64 | from lp.bugs.interfaces.malone import IMaloneApplication | 63 | from lp.bugs.interfaces.malone import IMaloneApplication |
40 | 64 | from lp.registry.interfaces.distribution import IDistribution | ||
41 | 65 | from lp.registry.interfaces.distributionsourcepackage import ( | 65 | from lp.registry.interfaces.distributionsourcepackage import ( |
42 | 66 | IDistributionSourcePackage) | 66 | IDistributionSourcePackage) |
43 | 67 | from lp.registry.interfaces.distroseries import IDistroSeries | 67 | from lp.registry.interfaces.distroseries import IDistroSeries |
45 | 68 | from lp.registry.interfaces.product import IProduct, IProject | 68 | from lp.registry.interfaces.product import IProduct |
46 | 69 | from lp.registry.interfaces.productseries import IProductSeries | 69 | from lp.registry.interfaces.productseries import IProductSeries |
47 | 70 | from lp.registry.interfaces.project import IProject | ||
48 | 70 | from lp.registry.interfaces.sourcepackage import ISourcePackage | 71 | from lp.registry.interfaces.sourcepackage import ISourcePackage |
49 | 71 | from canonical.launchpad.webapp import ( | 72 | from canonical.launchpad.webapp import ( |
50 | 72 | LaunchpadEditFormView, LaunchpadFormView, LaunchpadView, action, | 73 | LaunchpadEditFormView, LaunchpadFormView, LaunchpadView, action, |
51 | 73 | 74 | ||
52 | === modified file 'lib/lp/bugs/subscribers/bug.py' | |||
53 | --- lib/lp/bugs/subscribers/bug.py 2009-06-25 00:40:31 +0000 | |||
54 | +++ lib/lp/bugs/subscribers/bug.py 2010-01-10 04:32:20 +0000 | |||
55 | @@ -1,4 +1,4 @@ | |||
57 | 1 | # Copyright 2009 Canonical Ltd. This software is licensed under the | 1 | # Copyright 2009, 2010 Canonical Ltd. This software is licensed under the |
58 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). |
59 | 3 | 3 | ||
60 | 4 | __metaclass__ = type | 4 | __metaclass__ = type |
61 | @@ -6,19 +6,20 @@ | |||
62 | 6 | 6 | ||
63 | 7 | 7 | ||
64 | 8 | from canonical.database.sqlbase import block_implicit_flushes | 8 | from canonical.database.sqlbase import block_implicit_flushes |
66 | 9 | from canonical.launchpad.interfaces._schema_circular_imports import IPerson | 9 | from lp.registry.interfaces.person import IPerson |
67 | 10 | |||
68 | 11 | |||
69 | 10 | @block_implicit_flushes | 12 | @block_implicit_flushes |
70 | 11 | def notify_bug_modified(bug, event): | 13 | def notify_bug_modified(bug, event): |
71 | 12 | """Handle bug change events. | 14 | """Handle bug change events. |
73 | 13 | 15 | ||
74 | 14 | Subscribe the security contacts for a bug when it | 16 | Subscribe the security contacts for a bug when it |
75 | 15 | becomes security-related. | 17 | becomes security-related. |
76 | 16 | """ | 18 | """ |
77 | 17 | if (event.object.security_related and | 19 | if (event.object.security_related and |
78 | 18 | not event.object_before_modification.security_related): | 20 | not event.object_before_modification.security_related): |
81 | 19 | # The bug turned to be security-related, | 21 | # The bug turned out to be security-related, subscribe the security |
82 | 20 | # subscribe the security contact. | 22 | # contact. |
83 | 21 | for pillar in bug.affected_pillars: | 23 | for pillar in bug.affected_pillars: |
84 | 22 | if pillar.security_contact is not None: | 24 | if pillar.security_contact is not None: |
85 | 23 | bug.subscribe(pillar.security_contact, IPerson(event.user)) | 25 | bug.subscribe(pillar.security_contact, IPerson(event.user)) |
86 | 24 | |||
87 | 25 | 26 | ||
88 | === modified file 'lib/lp/bugs/subscribers/bugactivity.py' | |||
89 | --- lib/lp/bugs/subscribers/bugactivity.py 2009-07-17 00:26:05 +0000 | |||
90 | +++ lib/lp/bugs/subscribers/bugactivity.py 2010-01-10 04:32:20 +0000 | |||
91 | @@ -15,9 +15,11 @@ | |||
92 | 15 | from canonical.database.sqlbase import block_implicit_flushes | 15 | from canonical.database.sqlbase import block_implicit_flushes |
93 | 16 | from lp.bugs.adapters.bugchange import ( | 16 | from lp.bugs.adapters.bugchange import ( |
94 | 17 | BugWatchAdded, BugWatchRemoved) | 17 | BugWatchAdded, BugWatchRemoved) |
96 | 18 | from canonical.launchpad.interfaces._schema_circular_imports import IBug, IPerson | 18 | from lp.bugs.interfaces.bug import IBug |
97 | 19 | from lp.bugs.interfaces.bugactivity import IBugActivitySet | 19 | from lp.bugs.interfaces.bugactivity import IBugActivitySet |
99 | 20 | from lp.registry.interfaces.milestone import IMilestone, IProductRelease | 20 | from lp.registry.interfaces.milestone import IMilestone |
100 | 21 | from lp.registry.interfaces.person import IPerson | ||
101 | 22 | from lp.registry.interfaces.productrelease import IProductRelease | ||
102 | 21 | from lp.soyuz.interfaces.sourcepackagerelease import ISourcePackageRelease | 23 | from lp.soyuz.interfaces.sourcepackagerelease import ISourcePackageRelease |
103 | 22 | from lp.bugs.adapters.bugchange import BugTaskAdded | 24 | from lp.bugs.adapters.bugchange import BugTaskAdded |
104 | 23 | 25 | ||
105 | 24 | 26 | ||
106 | === modified file 'lib/lp/bugs/subscribers/buglastupdated.py' | |||
107 | --- lib/lp/bugs/subscribers/buglastupdated.py 2009-06-25 00:40:31 +0000 | |||
108 | +++ lib/lp/bugs/subscribers/buglastupdated.py 2010-01-10 04:32:20 +0000 | |||
109 | @@ -9,8 +9,10 @@ | |||
110 | 9 | 9 | ||
111 | 10 | import pytz | 10 | import pytz |
112 | 11 | 11 | ||
114 | 12 | from canonical.launchpad.interfaces._schema_circular_imports import IBug | 12 | from lp.bugs.interfaces.bug import IBug |
115 | 13 | from canonical.launchpad.interfaces.launchpad import IHasBug | 13 | from canonical.launchpad.interfaces.launchpad import IHasBug |
116 | 14 | |||
117 | 15 | |||
118 | 14 | def update_bug_date_last_updated(object, event): | 16 | def update_bug_date_last_updated(object, event): |
119 | 15 | """Update IBug.date_last_updated to the current date.""" | 17 | """Update IBug.date_last_updated to the current date.""" |
120 | 16 | if IBug.providedBy(object): | 18 | if IBug.providedBy(object): |
121 | 17 | 19 | ||
122 | === modified file 'lib/lp/code/browser/branch.py' | |||
123 | --- lib/lp/code/browser/branch.py 2009-12-18 15:14:45 +0000 | |||
124 | +++ lib/lp/code/browser/branch.py 2010-01-10 04:32:20 +0000 | |||
125 | @@ -79,16 +79,14 @@ | |||
126 | 79 | from lp.code.browser.branchmergeproposal import ( | 79 | from lp.code.browser.branchmergeproposal import ( |
127 | 80 | latest_proposals_for_each_branch) | 80 | latest_proposals_for_each_branch) |
128 | 81 | from lp.code.enums import ( | 81 | from lp.code.enums import ( |
131 | 82 | BranchLifecycleStatus, BranchType, RevisionControlSystems, | 82 | BranchLifecycleStatus, BranchType, CodeImportJobState, |
132 | 83 | UICreatableBranchType) | 83 | CodeImportReviewStatus, RevisionControlSystems, UICreatableBranchType) |
133 | 84 | from lp.code.errors import InvalidBranchMergeProposal | 84 | from lp.code.errors import InvalidBranchMergeProposal |
134 | 85 | from lp.code.interfaces.branch import ( | 85 | from lp.code.interfaces.branch import ( |
135 | 86 | BranchCreationForbidden, BranchExists, IBranch, | 86 | BranchCreationForbidden, BranchExists, IBranch, |
136 | 87 | user_has_special_branch_access) | 87 | user_has_special_branch_access) |
137 | 88 | from lp.code.interfaces.branchtarget import IBranchTarget | 88 | from lp.code.interfaces.branchtarget import IBranchTarget |
141 | 89 | from lp.code.interfaces.codeimport import CodeImportReviewStatus | 89 | from lp.code.interfaces.codeimportjob import ICodeImportJobWorkflow |
139 | 90 | from lp.code.interfaces.codeimportjob import ( | ||
140 | 91 | CodeImportJobState, ICodeImportJobWorkflow) | ||
142 | 92 | from lp.code.interfaces.branchnamespace import IBranchNamespacePolicy | 90 | from lp.code.interfaces.branchnamespace import IBranchNamespacePolicy |
143 | 93 | from lp.code.interfaces.codereviewvote import ICodeReviewVoteReference | 91 | from lp.code.interfaces.codereviewvote import ICodeReviewVoteReference |
144 | 94 | from lp.registry.interfaces.person import IPerson, IPersonSet | 92 | from lp.registry.interfaces.person import IPerson, IPersonSet |
145 | 95 | 93 | ||
146 | === modified file 'lib/lp/code/interfaces/branch.py' | |||
147 | --- lib/lp/code/interfaces/branch.py 2009-12-09 08:10:10 +0000 | |||
148 | +++ lib/lp/code/interfaces/branch.py 2010-01-10 04:32:20 +0000 | |||
149 | @@ -50,8 +50,7 @@ | |||
150 | 50 | call_with, collection_default_content, export_as_webservice_collection, | 50 | call_with, collection_default_content, export_as_webservice_collection, |
151 | 51 | export_as_webservice_entry, export_factory_operation, | 51 | export_as_webservice_entry, export_factory_operation, |
152 | 52 | export_operation_as, export_read_operation, export_write_operation, | 52 | export_operation_as, export_read_operation, export_write_operation, |
155 | 53 | exported, operation_parameters, operation_returns_collection_of, | 53 | exported, operation_parameters, operation_returns_entry, REQUEST_USER) |
154 | 54 | operation_returns_entry, REQUEST_USER) | ||
156 | 55 | 54 | ||
157 | 56 | from canonical.config import config | 55 | from canonical.config import config |
158 | 57 | 56 | ||
159 | 58 | 57 | ||
160 | === modified file 'lib/lp/code/interfaces/branchjob.py' | |||
161 | --- lib/lp/code/interfaces/branchjob.py 2009-12-03 21:29:28 +0000 | |||
162 | +++ lib/lp/code/interfaces/branchjob.py 2010-01-10 04:32:20 +0000 | |||
163 | @@ -15,8 +15,11 @@ | |||
164 | 15 | 'IBranchDiffJobSource', | 15 | 'IBranchDiffJobSource', |
165 | 16 | 'IBranchUpgradeJob', | 16 | 'IBranchUpgradeJob', |
166 | 17 | 'IBranchUpgradeJobSource', | 17 | 'IBranchUpgradeJobSource', |
167 | 18 | 'IReclaimBranchSpaceJob', | ||
168 | 19 | 'IReclaimBranchSpaceJobSource', | ||
169 | 18 | 'IRevisionMailJob', | 20 | 'IRevisionMailJob', |
170 | 19 | 'IRevisionMailJobSource', | 21 | 'IRevisionMailJobSource', |
171 | 22 | 'IRevisionsAddedJob', | ||
172 | 20 | 'IRevisionsAddedJobSource', | 23 | 'IRevisionsAddedJobSource', |
173 | 21 | 'IRosettaUploadJob', | 24 | 'IRosettaUploadJob', |
174 | 22 | 'IRosettaUploadJobSource', | 25 | 'IRosettaUploadJobSource', |
175 | @@ -31,7 +34,6 @@ | |||
176 | 31 | from lp.services.job.interfaces.job import IJob, IRunnableJob | 34 | from lp.services.job.interfaces.job import IJob, IRunnableJob |
177 | 32 | 35 | ||
178 | 33 | 36 | ||
179 | 34 | |||
180 | 35 | class IBranchJob(Interface): | 37 | class IBranchJob(Interface): |
181 | 36 | """A job related to a branch.""" | 38 | """A job related to a branch.""" |
182 | 37 | 39 | ||
183 | @@ -164,7 +166,6 @@ | |||
184 | 164 | def iterReady(): | 166 | def iterReady(): |
185 | 165 | """Iterate through ready IRosettaUploadJobs.""" | 167 | """Iterate through ready IRosettaUploadJobs.""" |
186 | 166 | 168 | ||
187 | 167 | |||
188 | 168 | def findUnfinishedJobs(branch, since=None): | 169 | def findUnfinishedJobs(branch, since=None): |
189 | 169 | """Find any `IRosettaUploadJob`s for `branch` that haven't run yet. | 170 | """Find any `IRosettaUploadJob`s for `branch` that haven't run yet. |
190 | 170 | 171 | ||
191 | @@ -193,4 +194,3 @@ | |||
192 | 193 | 194 | ||
193 | 194 | def iterReady(): | 195 | def iterReady(): |
194 | 195 | """Iterate through ready IReclaimBranchSpaceJobs.""" | 196 | """Iterate through ready IReclaimBranchSpaceJobs.""" |
195 | 196 | |||
196 | 197 | 197 | ||
197 | === modified file 'lib/lp/code/interfaces/branchmergeproposal.py' | |||
198 | --- lib/lp/code/interfaces/branchmergeproposal.py 2010-01-06 14:14:35 +0000 | |||
199 | +++ lib/lp/code/interfaces/branchmergeproposal.py 2010-01-10 04:32:20 +0000 | |||
200 | @@ -16,6 +16,8 @@ | |||
201 | 16 | 'ICreateMergeProposalJobSource', | 16 | 'ICreateMergeProposalJobSource', |
202 | 17 | 'IMergeProposalCreatedJob', | 17 | 'IMergeProposalCreatedJob', |
203 | 18 | 'IMergeProposalCreatedJobSource', | 18 | 'IMergeProposalCreatedJobSource', |
204 | 19 | 'IUpdatePreviewDiffJobSource', | ||
205 | 20 | 'notify_modified', | ||
206 | 19 | ] | 21 | ] |
207 | 20 | 22 | ||
208 | 21 | 23 | ||
209 | @@ -129,8 +131,8 @@ | |||
210 | 129 | 131 | ||
211 | 130 | reviewed_revision_id = exported( | 132 | reviewed_revision_id = exported( |
212 | 131 | Text( | 133 | Text( |
215 | 132 | title=_("The revision id that has been approved by the reviewer.") | 134 | title=_( |
216 | 133 | ), | 135 | "The revision id that has been approved by the reviewer.")), |
217 | 134 | exported_as='reviewed_revno') | 136 | exported_as='reviewed_revno') |
218 | 135 | 137 | ||
219 | 136 | commit_message = exported( | 138 | commit_message = exported( |
220 | @@ -259,7 +261,7 @@ | |||
221 | 259 | CollectionField( | 261 | CollectionField( |
222 | 260 | title=_('The votes cast or expected for this proposal'), | 262 | title=_('The votes cast or expected for this proposal'), |
223 | 261 | value_type=Reference(schema=Interface), #ICodeReviewVoteReference | 263 | value_type=Reference(schema=Interface), #ICodeReviewVoteReference |
225 | 262 | readonly=True | 264 | readonly=True, |
226 | 263 | ) | 265 | ) |
227 | 264 | ) | 266 | ) |
228 | 265 | 267 | ||
229 | @@ -604,6 +606,8 @@ | |||
230 | 604 | """Get a context for running this kind of job in.""" | 606 | """Get a context for running this kind of job in.""" |
231 | 605 | 607 | ||
232 | 606 | 608 | ||
233 | 609 | # XXX: JonathanLange 2010-01-06: This is only used in the scanner, perhaps it | ||
234 | 610 | # should be moved there. | ||
235 | 607 | def notify_modified(proposal, func, *args, **kwargs): | 611 | def notify_modified(proposal, func, *args, **kwargs): |
236 | 608 | """Call func, then notify about the changes it made. | 612 | """Call func, then notify about the changes it made. |
237 | 609 | 613 | ||
238 | 610 | 614 | ||
239 | === modified file 'lib/lp/code/model/branchjob.py' | |||
240 | --- lib/lp/code/model/branchjob.py 2009-12-10 18:20:09 +0000 | |||
241 | +++ lib/lp/code/model/branchjob.py 2010-01-10 04:32:20 +0000 | |||
242 | @@ -190,7 +190,7 @@ | |||
243 | 190 | 190 | ||
244 | 191 | def getOopsVars(self): | 191 | def getOopsVars(self): |
245 | 192 | """See `IRunnableJob`.""" | 192 | """See `IRunnableJob`.""" |
247 | 193 | vars = BaseRunnableJob.getOopsVars(self) | 193 | vars = BaseRunnableJob.getOopsVars(self) |
248 | 194 | vars.extend([ | 194 | vars.extend([ |
249 | 195 | ('branch_job_id', self.context.id), | 195 | ('branch_job_id', self.context.id), |
250 | 196 | ('branch_job_type', self.context.job_type.title)]) | 196 | ('branch_job_type', self.context.job_type.title)]) |
251 | @@ -203,8 +203,8 @@ | |||
252 | 203 | """A Job that calculates the a diff related to a Branch.""" | 203 | """A Job that calculates the a diff related to a Branch.""" |
253 | 204 | 204 | ||
254 | 205 | implements(IBranchDiffJob) | 205 | implements(IBranchDiffJob) |
255 | 206 | |||
256 | 207 | classProvides(IBranchDiffJobSource) | 206 | classProvides(IBranchDiffJobSource) |
257 | 207 | |||
258 | 208 | @classmethod | 208 | @classmethod |
259 | 209 | def create(cls, branch, from_revision_spec, to_revision_spec): | 209 | def create(cls, branch, from_revision_spec, to_revision_spec): |
260 | 210 | """See `IBranchDiffJobSource`.""" | 210 | """See `IBranchDiffJobSource`.""" |
261 | @@ -439,7 +439,7 @@ | |||
262 | 439 | history = self.bzr_branch.revision_history() | 439 | history = self.bzr_branch.revision_history() |
263 | 440 | for num, revid in enumerate(history): | 440 | for num, revid in enumerate(history): |
264 | 441 | if revid in added_revisions: | 441 | if revid in added_revisions: |
266 | 442 | yield repository.get_revision(revid), num+1 | 442 | yield repository.get_revision(revid), num + 1 |
267 | 443 | 443 | ||
268 | 444 | def generateDiffs(self): | 444 | def generateDiffs(self): |
269 | 445 | """Determine whether to generate diffs.""" | 445 | """Determine whether to generate diffs.""" |
270 | @@ -930,4 +930,3 @@ | |||
271 | 930 | shutil.rmtree(mirrored_path) | 930 | shutil.rmtree(mirrored_path) |
272 | 931 | if os.path.exists(hosted_path): | 931 | if os.path.exists(hosted_path): |
273 | 932 | shutil.rmtree(hosted_path) | 932 | shutil.rmtree(hosted_path) |
274 | 933 | |||
275 | 934 | 933 | ||
276 | === modified file 'lib/lp/code/model/branchmergeproposaljob.py' | |||
277 | --- lib/lp/code/model/branchmergeproposaljob.py 2010-01-07 21:02:00 +0000 | |||
278 | +++ lib/lp/code/model/branchmergeproposaljob.py 2010-01-10 04:32:20 +0000 | |||
279 | @@ -12,6 +12,7 @@ | |||
280 | 12 | 'BranchMergeProposalJob', | 12 | 'BranchMergeProposalJob', |
281 | 13 | 'CreateMergeProposalJob', | 13 | 'CreateMergeProposalJob', |
282 | 14 | 'MergeProposalCreatedJob', | 14 | 'MergeProposalCreatedJob', |
283 | 15 | 'UpdatePreviewDiffJob', | ||
284 | 15 | ] | 16 | ] |
285 | 16 | 17 | ||
286 | 17 | import contextlib | 18 | import contextlib |
287 | 18 | 19 | ||
288 | === modified file 'lib/lp/code/model/branchnamespace.py' | |||
289 | --- lib/lp/code/model/branchnamespace.py 2009-08-04 00:41:49 +0000 | |||
290 | +++ lib/lp/code/model/branchnamespace.py 2010-01-10 04:32:20 +0000 | |||
291 | @@ -6,7 +6,6 @@ | |||
292 | 6 | __metaclass__ = type | 6 | __metaclass__ = type |
293 | 7 | __all__ = [ | 7 | __all__ = [ |
294 | 8 | 'BranchNamespaceSet', | 8 | 'BranchNamespaceSet', |
295 | 9 | 'get_namespace', | ||
296 | 10 | 'PackageNamespace', | 9 | 'PackageNamespace', |
297 | 11 | 'PersonalNamespace', | 10 | 'PersonalNamespace', |
298 | 12 | 'ProductNamespace', | 11 | 'ProductNamespace', |
299 | @@ -47,9 +46,9 @@ | |||
300 | 47 | IProduct, IProductSet, NoSuchProduct) | 46 | IProduct, IProductSet, NoSuchProduct) |
301 | 48 | from lp.registry.interfaces.sourcepackagename import ( | 47 | from lp.registry.interfaces.sourcepackagename import ( |
302 | 49 | ISourcePackageNameSet, NoSuchSourcePackageName) | 48 | ISourcePackageNameSet, NoSuchSourcePackageName) |
303 | 49 | from lp.services.utils import iter_split | ||
304 | 50 | from canonical.launchpad.webapp.interfaces import ( | 50 | from canonical.launchpad.webapp.interfaces import ( |
305 | 51 | IStoreSelector, MAIN_STORE, DEFAULT_FLAVOR) | 51 | IStoreSelector, MAIN_STORE, DEFAULT_FLAVOR) |
306 | 52 | from lp.code.xmlrpc.codehosting import iter_split | ||
307 | 53 | 52 | ||
308 | 54 | 53 | ||
309 | 55 | class _BaseNamespace: | 54 | class _BaseNamespace: |
310 | 56 | 55 | ||
311 | === modified file 'lib/lp/code/model/codeimport.py' | |||
312 | --- lib/lp/code/model/codeimport.py 2010-01-05 21:29:59 +0000 | |||
313 | +++ lib/lp/code/model/codeimport.py 2010-01-10 04:32:20 +0000 | |||
314 | @@ -35,12 +35,11 @@ | |||
315 | 35 | from lp.registry.model.productseries import ProductSeries | 35 | from lp.registry.model.productseries import ProductSeries |
316 | 36 | from canonical.launchpad.webapp.interfaces import NotFoundError | 36 | from canonical.launchpad.webapp.interfaces import NotFoundError |
317 | 37 | from lp.code.enums import ( | 37 | from lp.code.enums import ( |
320 | 38 | BranchType, CodeImportResultStatus, CodeImportReviewStatus, | 38 | BranchType, CodeImportJobState, CodeImportResultStatus, |
321 | 39 | RevisionControlSystems) | 39 | CodeImportReviewStatus, RevisionControlSystems) |
322 | 40 | from lp.code.interfaces.codeimport import ICodeImport, ICodeImportSet | 40 | from lp.code.interfaces.codeimport import ICodeImport, ICodeImportSet |
323 | 41 | from lp.code.interfaces.codeimportevent import ICodeImportEventSet | 41 | from lp.code.interfaces.codeimportevent import ICodeImportEventSet |
326 | 42 | from lp.code.interfaces.codeimportjob import ( | 42 | from lp.code.interfaces.codeimportjob import ICodeImportJobWorkflow |
325 | 43 | CodeImportJobState, ICodeImportJobWorkflow) | ||
327 | 44 | from lp.code.interfaces.branchnamespace import ( | 43 | from lp.code.interfaces.branchnamespace import ( |
328 | 45 | get_branch_namespace) | 44 | get_branch_namespace) |
329 | 46 | from lp.code.model.codeimportresult import CodeImportResult | 45 | from lp.code.model.codeimportresult import CodeImportResult |
330 | 47 | 46 | ||
331 | === modified file 'lib/lp/codehosting/inmemory.py' | |||
332 | --- lib/lp/codehosting/inmemory.py 2009-08-28 06:39:38 +0000 | |||
333 | +++ lib/lp/codehosting/inmemory.py 2010-01-10 04:32:20 +0000 | |||
334 | @@ -6,7 +6,7 @@ | |||
335 | 6 | __metaclass__ = type | 6 | __metaclass__ = type |
336 | 7 | __all__ = [ | 7 | __all__ = [ |
337 | 8 | 'InMemoryFrontend', | 8 | 'InMemoryFrontend', |
339 | 9 | 'XMLRPCWrapper' | 9 | 'XMLRPCWrapper', |
340 | 10 | ] | 10 | ] |
341 | 11 | 11 | ||
342 | 12 | import operator | 12 | import operator |
343 | @@ -28,10 +28,10 @@ | |||
344 | 28 | BRANCH_TRANSPORT, CONTROL_TRANSPORT, LAUNCHPAD_ANONYMOUS, | 28 | BRANCH_TRANSPORT, CONTROL_TRANSPORT, LAUNCHPAD_ANONYMOUS, |
345 | 29 | LAUNCHPAD_SERVICES) | 29 | LAUNCHPAD_SERVICES) |
346 | 30 | from lp.registry.interfaces.pocket import PackagePublishingPocket | 30 | from lp.registry.interfaces.pocket import PackagePublishingPocket |
347 | 31 | from lp.services.utils import iter_split | ||
348 | 31 | from lp.testing.factory import ObjectFactory | 32 | from lp.testing.factory import ObjectFactory |
349 | 32 | from canonical.launchpad.validators import LaunchpadValidationError | 33 | from canonical.launchpad.validators import LaunchpadValidationError |
352 | 33 | from lp.code.xmlrpc.codehosting import ( | 34 | from lp.code.xmlrpc.codehosting import datetime_from_tuple |
351 | 34 | datetime_from_tuple, iter_split) | ||
353 | 35 | from canonical.launchpad.xmlrpc import faults | 35 | from canonical.launchpad.xmlrpc import faults |
354 | 36 | 36 | ||
355 | 37 | 37 | ||
356 | 38 | 38 | ||
357 | === modified file 'lib/lp/codehosting/puller/worker.py' | |||
358 | --- lib/lp/codehosting/puller/worker.py 2009-12-22 00:26:49 +0000 | |||
359 | +++ lib/lp/codehosting/puller/worker.py 2010-01-10 04:32:20 +0000 | |||
360 | @@ -32,13 +32,11 @@ | |||
361 | 32 | 'BranchMirrorer', | 32 | 'BranchMirrorer', |
362 | 33 | 'BranchLoopError', | 33 | 'BranchLoopError', |
363 | 34 | 'BranchReferenceForbidden', | 34 | 'BranchReferenceForbidden', |
364 | 35 | 'BranchReferenceValueError', | ||
365 | 36 | 'get_canonical_url_for_branch_name', | 35 | 'get_canonical_url_for_branch_name', |
366 | 37 | 'install_worker_ui_factory', | 36 | 'install_worker_ui_factory', |
367 | 38 | 'PullerWorker', | 37 | 'PullerWorker', |
368 | 39 | 'PullerWorkerProtocol', | 38 | 'PullerWorkerProtocol', |
369 | 40 | 'StackedOnBranchNotFound', | 39 | 'StackedOnBranchNotFound', |
370 | 41 | 'URLChecker', | ||
371 | 42 | ] | 40 | ] |
372 | 43 | 41 | ||
373 | 44 | 42 | ||
374 | @@ -363,8 +361,8 @@ | |||
375 | 363 | stacked-on branch for the product of the branch we are mirroring. | 361 | stacked-on branch for the product of the branch we are mirroring. |
376 | 364 | None or '' if there is no such branch. | 362 | None or '' if there is no such branch. |
377 | 365 | :param protocol: An instance of `PullerWorkerProtocol`. | 363 | :param protocol: An instance of `PullerWorkerProtocol`. |
380 | 366 | :param branch_mirrorer: An instance of `BranchMirrorer`. If not passed, | 364 | :param branch_mirrorer: An instance of `BranchMirrorer`. If not |
381 | 367 | one will be chosen based on the value of `branch_type`. | 365 | passed, one will be chosen based on the value of `branch_type`. |
382 | 368 | :param oops_prefix: An oops prefix to pass to `setOopsToken` on the | 366 | :param oops_prefix: An oops prefix to pass to `setOopsToken` on the |
383 | 369 | global ErrorUtility. | 367 | global ErrorUtility. |
384 | 370 | """ | 368 | """ |
385 | @@ -519,6 +517,7 @@ | |||
386 | 519 | WORKER_ACTIVITY_PROGRESS_BAR = 'progress bar' | 517 | WORKER_ACTIVITY_PROGRESS_BAR = 'progress bar' |
387 | 520 | WORKER_ACTIVITY_NETWORK = 'network' | 518 | WORKER_ACTIVITY_NETWORK = 'network' |
388 | 521 | 519 | ||
389 | 520 | |||
390 | 522 | class PullerWorkerUIFactory(SilentUIFactory): | 521 | class PullerWorkerUIFactory(SilentUIFactory): |
391 | 523 | """An UIFactory that always says yes to breaking locks.""" | 522 | """An UIFactory that always says yes to breaking locks.""" |
392 | 524 | 523 | ||
393 | 525 | 524 | ||
394 | === modified file 'lib/lp/codehosting/scanner/bzrsync.py' | |||
395 | --- lib/lp/codehosting/scanner/bzrsync.py 2009-12-17 02:00:16 +0000 | |||
396 | +++ lib/lp/codehosting/scanner/bzrsync.py 2010-01-10 04:32:20 +0000 | |||
397 | @@ -9,6 +9,8 @@ | |||
398 | 9 | 9 | ||
399 | 10 | __all__ = [ | 10 | __all__ = [ |
400 | 11 | "BzrSync", | 11 | "BzrSync", |
401 | 12 | 'schedule_diff_updates', | ||
402 | 13 | 'schedule_translation_upload', | ||
403 | 12 | ] | 14 | ] |
404 | 13 | 15 | ||
405 | 14 | import logging | 16 | import logging |
406 | @@ -31,8 +33,7 @@ | |||
407 | 31 | from lp.codehosting.puller.worker import BranchMirrorer | 33 | from lp.codehosting.puller.worker import BranchMirrorer |
408 | 32 | from lp.codehosting.scanner import events | 34 | from lp.codehosting.scanner import events |
409 | 33 | from lp.codehosting.vfs.branchfs import BranchPolicy | 35 | from lp.codehosting.vfs.branchfs import BranchPolicy |
412 | 34 | from lp.code.interfaces.branch import ( | 36 | from lp.code.bzr import BranchFormat, ControlFormat, RepositoryFormat |
411 | 35 | BranchFormat, ControlFormat, RepositoryFormat) | ||
413 | 36 | from lp.code.interfaces.branchjob import IRosettaUploadJobSource | 37 | from lp.code.interfaces.branchjob import IRosettaUploadJobSource |
414 | 37 | from lp.code.interfaces.branchrevision import IBranchRevisionSet | 38 | from lp.code.interfaces.branchrevision import IBranchRevisionSet |
415 | 38 | from lp.code.interfaces.revision import IRevisionSet | 39 | from lp.code.interfaces.revision import IRevisionSet |
416 | 39 | 40 | ||
417 | === modified file 'lib/lp/codehosting/scanner/email.py' | |||
418 | --- lib/lp/codehosting/scanner/email.py 2009-06-30 16:56:07 +0000 | |||
419 | +++ lib/lp/codehosting/scanner/email.py 2010-01-10 04:32:20 +0000 | |||
420 | @@ -11,12 +11,11 @@ | |||
421 | 11 | 11 | ||
422 | 12 | from zope.component import adapter, getUtility | 12 | from zope.component import adapter, getUtility |
423 | 13 | 13 | ||
424 | 14 | from lp.codehosting.scanner import events | ||
425 | 15 | from canonical.config import config | 14 | from canonical.config import config |
426 | 15 | from lp.code.enums import BranchSubscriptionNotificationLevel | ||
427 | 16 | from lp.code.interfaces.branchjob import ( | 16 | from lp.code.interfaces.branchjob import ( |
428 | 17 | IRevisionsAddedJobSource, IRevisionMailJobSource) | 17 | IRevisionsAddedJobSource, IRevisionMailJobSource) |
431 | 18 | from lp.code.interfaces.branchsubscription import ( | 18 | from lp.codehosting.scanner import events |
430 | 19 | BranchSubscriptionNotificationLevel) | ||
432 | 20 | 19 | ||
433 | 21 | 20 | ||
434 | 22 | def subscribers_want_notification(db_branch): | 21 | def subscribers_want_notification(db_branch): |
435 | 23 | 22 | ||
436 | === modified file 'lib/lp/codehosting/vfs/branchfs.py' | |||
437 | --- lib/lp/codehosting/vfs/branchfs.py 2009-12-22 23:50:27 +0000 | |||
438 | +++ lib/lp/codehosting/vfs/branchfs.py 2010-01-10 04:32:20 +0000 | |||
439 | @@ -50,6 +50,7 @@ | |||
440 | 50 | 'AsyncLaunchpadTransport', | 50 | 'AsyncLaunchpadTransport', |
441 | 51 | 'BadUrl', | 51 | 'BadUrl', |
442 | 52 | 'BadUrlLaunchpad', | 52 | 'BadUrlLaunchpad', |
443 | 53 | 'BadUrlScheme', | ||
444 | 53 | 'BadUrlSsh', | 54 | 'BadUrlSsh', |
445 | 54 | 'branch_id_to_path', | 55 | 'branch_id_to_path', |
446 | 55 | 'BranchPolicy', | 56 | 'BranchPolicy', |
447 | @@ -108,6 +109,7 @@ | |||
448 | 108 | 109 | ||
449 | 109 | class BadUrlScheme(BadUrl): | 110 | class BadUrlScheme(BadUrl): |
450 | 110 | """Found a URL with an untrusted scheme.""" | 111 | """Found a URL with an untrusted scheme.""" |
451 | 112 | |||
452 | 111 | def __init__(self, scheme, url): | 113 | def __init__(self, scheme, url): |
453 | 112 | BadUrl.__init__(self, scheme, url) | 114 | BadUrl.__init__(self, scheme, url) |
454 | 113 | self.scheme = scheme | 115 | self.scheme = scheme |
455 | @@ -441,6 +443,7 @@ | |||
456 | 441 | 443 | ||
457 | 442 | 444 | ||
458 | 443 | class DirectDatabaseLaunchpadServer(AsyncVirtualServer): | 445 | class DirectDatabaseLaunchpadServer(AsyncVirtualServer): |
459 | 446 | |||
460 | 444 | def __init__(self, scheme, branch_transport): | 447 | def __init__(self, scheme, branch_transport): |
461 | 445 | AsyncVirtualServer.__init__(self, scheme) | 448 | AsyncVirtualServer.__init__(self, scheme) |
462 | 446 | self._transport_dispatch = BranchTransportDispatch(branch_transport) | 449 | self._transport_dispatch = BranchTransportDispatch(branch_transport) |
463 | 447 | 450 | ||
464 | === modified file 'lib/lp/registry/browser/distributionsourcepackage.py' | |||
465 | --- lib/lp/registry/browser/distributionsourcepackage.py 2009-12-05 18:37:28 +0000 | |||
466 | +++ lib/lp/registry/browser/distributionsourcepackage.py 2010-01-10 04:32:20 +0000 | |||
467 | @@ -44,12 +44,13 @@ | |||
468 | 44 | from lp.soyuz.browser.sourcepackagerelease import ( | 44 | from lp.soyuz.browser.sourcepackagerelease import ( |
469 | 45 | extract_bug_numbers, extract_email_addresses, linkify_changelog) | 45 | extract_bug_numbers, extract_email_addresses, linkify_changelog) |
470 | 46 | from lp.soyuz.interfaces.archive import IArchiveSet | 46 | from lp.soyuz.interfaces.archive import IArchiveSet |
471 | 47 | from lp.registry.interfaces.distributionsourcepackage import ( | ||
472 | 48 | IDistributionSourcePackage) | ||
473 | 47 | from lp.soyuz.interfaces.distributionsourcepackagerelease import ( | 49 | from lp.soyuz.interfaces.distributionsourcepackagerelease import ( |
474 | 48 | IDistributionSourcePackageRelease) | 50 | IDistributionSourcePackageRelease) |
475 | 49 | from lp.soyuz.interfaces.packagediff import IPackageDiffSet | 51 | from lp.soyuz.interfaces.packagediff import IPackageDiffSet |
476 | 50 | from lp.registry.browser.packaging import PackagingDeleteView | 52 | from lp.registry.browser.packaging import PackagingDeleteView |
477 | 51 | from lp.registry.interfaces.pocket import pocketsuffix | 53 | from lp.registry.interfaces.pocket import pocketsuffix |
478 | 52 | from lp.registry.interfaces.product import IDistributionSourcePackage | ||
479 | 53 | from lp.translations.browser.customlanguagecode import ( | 54 | from lp.translations.browser.customlanguagecode import ( |
480 | 54 | HasCustomLanguageCodesTraversalMixin) | 55 | HasCustomLanguageCodesTraversalMixin) |
481 | 55 | 56 | ||
482 | 56 | 57 | ||
483 | === modified file 'lib/lp/registry/browser/mentoringoffer.py' | |||
484 | --- lib/lp/registry/browser/mentoringoffer.py 2009-06-25 04:06:00 +0000 | |||
485 | +++ lib/lp/registry/browser/mentoringoffer.py 2010-01-10 04:32:20 +0000 | |||
486 | @@ -16,11 +16,11 @@ | |||
487 | 16 | ] | 16 | ] |
488 | 17 | 17 | ||
489 | 18 | from canonical.launchpad import _ | 18 | from canonical.launchpad import _ |
490 | 19 | from lp.bugs.interfaces.bugtask import IBugTask | ||
491 | 19 | from lp.blueprints.interfaces.specification import ISpecification | 20 | from lp.blueprints.interfaces.specification import ISpecification |
492 | 20 | from lp.registry.interfaces.distribution import IDistribution | 21 | from lp.registry.interfaces.distribution import IDistribution |
493 | 21 | from lp.registry.interfaces.mentoringoffer import ( | 22 | from lp.registry.interfaces.mentoringoffer import ( |
494 | 22 | IMentoringOffer, IMentoringOfferSet) | 23 | IMentoringOffer, IMentoringOfferSet) |
495 | 23 | from lp.registry.interfaces.milestone import IBugTask | ||
496 | 24 | from lp.registry.interfaces.person import IPerson | 24 | from lp.registry.interfaces.person import IPerson |
497 | 25 | from lp.registry.interfaces.product import IProduct | 25 | from lp.registry.interfaces.product import IProduct |
498 | 26 | from lp.registry.interfaces.project import IProject | 26 | from lp.registry.interfaces.project import IProject |
499 | 27 | 27 | ||
500 | === modified file 'lib/lp/registry/browser/person.py' | |||
501 | --- lib/lp/registry/browser/person.py 2010-01-06 13:42:17 +0000 | |||
502 | +++ lib/lp/registry/browser/person.py 2010-01-10 04:32:20 +0000 | |||
503 | @@ -144,7 +144,7 @@ | |||
504 | 144 | BugTaskSearchParams, BugTaskStatus, UNRESOLVED_BUGTASK_STATUSES) | 144 | BugTaskSearchParams, BugTaskStatus, UNRESOLVED_BUGTASK_STATUSES) |
505 | 145 | from lp.services.worlddata.interfaces.country import ICountry | 145 | from lp.services.worlddata.interfaces.country import ICountry |
506 | 146 | from canonical.launchpad.interfaces.emailaddress import ( | 146 | from canonical.launchpad.interfaces.emailaddress import ( |
508 | 147 | EmailAddressStatus, IEmailAddressSet) | 147 | EmailAddressStatus, IEmailAddress, IEmailAddressSet) |
509 | 148 | from canonical.launchpad.interfaces.geoip import IRequestPreferredLanguages | 148 | from canonical.launchpad.interfaces.geoip import IRequestPreferredLanguages |
510 | 149 | from canonical.launchpad.interfaces.gpghandler import ( | 149 | from canonical.launchpad.interfaces.gpghandler import ( |
511 | 150 | GPGKeyNotFoundError, IGPGHandler) | 150 | GPGKeyNotFoundError, IGPGHandler) |
512 | @@ -165,7 +165,7 @@ | |||
513 | 165 | from lp.registry.interfaces.mailinglistsubscription import ( | 165 | from lp.registry.interfaces.mailinglistsubscription import ( |
514 | 166 | MailingListAutoSubscribePolicy) | 166 | MailingListAutoSubscribePolicy) |
515 | 167 | from lp.registry.interfaces.person import ( | 167 | from lp.registry.interfaces.person import ( |
517 | 168 | IEmailAddress, INewPerson, IPerson, IPersonChangePassword, IPersonClaim, | 168 | INewPerson, IPerson, IPersonChangePassword, IPersonClaim, |
518 | 169 | IPersonSet, ITeam, ITeamReassignment, PersonCreationRationale, | 169 | IPersonSet, ITeam, ITeamReassignment, PersonCreationRationale, |
519 | 170 | PersonVisibility, TeamMembershipRenewalPolicy, TeamSubscriptionPolicy) | 170 | PersonVisibility, TeamMembershipRenewalPolicy, TeamSubscriptionPolicy) |
520 | 171 | from lp.registry.interfaces.poll import IPollSet, IPollSubset | 171 | from lp.registry.interfaces.poll import IPollSet, IPollSubset |
521 | 172 | 172 | ||
522 | === modified file 'lib/lp/registry/browser/product.py' | |||
523 | --- lib/lp/registry/browser/product.py 2009-12-11 19:54:04 +0000 | |||
524 | +++ lib/lp/registry/browser/product.py 2010-01-10 04:32:20 +0000 | |||
525 | @@ -58,7 +58,7 @@ | |||
526 | 58 | from lp.blueprints.browser.specificationtarget import ( | 58 | from lp.blueprints.browser.specificationtarget import ( |
527 | 59 | HasSpecificationsMenuMixin) | 59 | HasSpecificationsMenuMixin) |
528 | 60 | from lp.bugs.interfaces.bugtask import RESOLVED_BUGTASK_STATUSES | 60 | from lp.bugs.interfaces.bugtask import RESOLVED_BUGTASK_STATUSES |
530 | 61 | from lp.bugs.interfaces.bugwatch import IBugTracker | 61 | from lp.bugs.interfaces.bugtracker import IBugTracker |
531 | 62 | from lp.services.worlddata.interfaces.country import ICountry | 62 | from lp.services.worlddata.interfaces.country import ICountry |
532 | 63 | from canonical.launchpad.interfaces.launchpad import ILaunchpadCelebrities | 63 | from canonical.launchpad.interfaces.launchpad import ILaunchpadCelebrities |
533 | 64 | from canonical.launchpad.interfaces.librarian import ILibraryFileAliasSet | 64 | from canonical.launchpad.interfaces.librarian import ILibraryFileAliasSet |
534 | 65 | 65 | ||
535 | === modified file 'lib/lp/registry/browser/structuralsubscription.py' | |||
536 | --- lib/lp/registry/browser/structuralsubscription.py 2009-12-05 18:37:28 +0000 | |||
537 | +++ lib/lp/registry/browser/structuralsubscription.py 2010-01-10 04:32:20 +0000 | |||
538 | @@ -17,7 +17,8 @@ | |||
539 | 17 | from zope.schema.vocabulary import SimpleTerm, SimpleVocabulary | 17 | from zope.schema.vocabulary import SimpleTerm, SimpleVocabulary |
540 | 18 | 18 | ||
541 | 19 | from canonical.cachedproperty import cachedproperty | 19 | from canonical.cachedproperty import cachedproperty |
543 | 20 | from lp.registry.interfaces.product import IDistributionSourcePackage | 20 | from lp.registry.interfaces.distributionsourcepackage import ( |
544 | 21 | IDistributionSourcePackage) | ||
545 | 21 | from lp.registry.interfaces.structuralsubscription import ( | 22 | from lp.registry.interfaces.structuralsubscription import ( |
546 | 22 | BugNotificationLevel, IStructuralSubscriptionForm) | 23 | BugNotificationLevel, IStructuralSubscriptionForm) |
547 | 23 | from lp.registry.interfaces.structuralsubscription import ( | 24 | from lp.registry.interfaces.structuralsubscription import ( |
548 | @@ -30,6 +31,7 @@ | |||
549 | 30 | from canonical.launchpad.webapp.menu import Link | 31 | from canonical.launchpad.webapp.menu import Link |
550 | 31 | from canonical.widgets import LabeledMultiCheckBoxWidget | 32 | from canonical.widgets import LabeledMultiCheckBoxWidget |
551 | 32 | 33 | ||
552 | 34 | |||
553 | 33 | class StructuralSubscriptionView(LaunchpadFormView): | 35 | class StructuralSubscriptionView(LaunchpadFormView): |
554 | 34 | """View class for structural subscriptions.""" | 36 | """View class for structural subscriptions.""" |
555 | 35 | 37 | ||
556 | @@ -137,7 +139,7 @@ | |||
557 | 137 | if self.isSubscribed(team)) | 139 | if self.isSubscribed(team)) |
558 | 138 | return { | 140 | return { |
559 | 139 | 'subscribe_me': self.currentUserIsSubscribed(), | 141 | 'subscribe_me': self.currentUserIsSubscribed(), |
561 | 140 | 'subscriptions_team': subscribed_teams | 142 | 'subscriptions_team': subscribed_teams, |
562 | 141 | } | 143 | } |
563 | 142 | 144 | ||
564 | 143 | def isSubscribed(self, person): | 145 | def isSubscribed(self, person): |
565 | @@ -175,7 +177,7 @@ | |||
566 | 175 | is_subscribed = self.isSubscribed(self.user) | 177 | is_subscribed = self.isSubscribed(self.user) |
567 | 176 | subscribe = data['subscribe_me'] | 178 | subscribe = data['subscribe_me'] |
568 | 177 | if (not is_subscribed) and subscribe: | 179 | if (not is_subscribed) and subscribe: |
570 | 178 | sub = target.addBugSubscription(self.user, self.user) | 180 | target.addBugSubscription(self.user, self.user) |
571 | 179 | self.request.response.addNotification( | 181 | self.request.response.addNotification( |
572 | 180 | 'You have subscribed to "%s". You will now receive an ' | 182 | 'You have subscribed to "%s". You will now receive an ' |
573 | 181 | 'e-mail each time someone reports or changes one of ' | 183 | 'e-mail each time someone reports or changes one of ' |
574 | @@ -204,7 +206,7 @@ | |||
575 | 204 | team for team in teams if self.isSubscribed(team)) | 206 | team for team in teams if self.isSubscribed(team)) |
576 | 205 | 207 | ||
577 | 206 | for team in form_selected_teams - subscriptions: | 208 | for team in form_selected_teams - subscriptions: |
579 | 207 | sub = target.addBugSubscription(team, self.user) | 209 | target.addBugSubscription(team, self.user) |
580 | 208 | self.request.response.addNotification( | 210 | self.request.response.addNotification( |
581 | 209 | 'The %s team will now receive an e-mail each time ' | 211 | 'The %s team will now receive an e-mail each time ' |
582 | 210 | 'someone reports or changes a public bug in "%s".' % ( | 212 | 'someone reports or changes a public bug in "%s".' % ( |
583 | @@ -225,7 +227,7 @@ | |||
584 | 225 | target = self.context | 227 | target = self.context |
585 | 226 | new_subscription = data['new_subscription'] | 228 | new_subscription = data['new_subscription'] |
586 | 227 | if new_subscription is not None: | 229 | if new_subscription is not None: |
588 | 228 | sub = target.addBugSubscription(new_subscription, self.user) | 230 | target.addBugSubscription(new_subscription, self.user) |
589 | 229 | self.request.response.addNotification( | 231 | self.request.response.addNotification( |
590 | 230 | '%s will now receive an e-mail each time someone ' | 232 | '%s will now receive an e-mail each time someone ' |
591 | 231 | 'reports or changes a public bug in "%s".' % ( | 233 | 'reports or changes a public bug in "%s".' % ( |
592 | @@ -288,7 +290,7 @@ | |||
593 | 288 | 290 | ||
594 | 289 | def subscribe(self): | 291 | def subscribe(self): |
595 | 290 | """The subscribe menu link. | 292 | """The subscribe menu link. |
597 | 291 | 293 | ||
598 | 292 | If the user, or any of the teams he's a member of, already has a | 294 | If the user, or any of the teams he's a member of, already has a |
599 | 293 | subscription to the context, the link offer to edit the subscriptions | 295 | subscription to the context, the link offer to edit the subscriptions |
600 | 294 | and displays the edit icon. Otherwise, the link offers to subscribe | 296 | and displays the edit icon. Otherwise, the link offers to subscribe |
601 | 295 | 297 | ||
602 | === modified file 'lib/lp/registry/interfaces/distroseries.py' | |||
603 | --- lib/lp/registry/interfaces/distroseries.py 2009-12-14 13:49:03 +0000 | |||
604 | +++ lib/lp/registry/interfaces/distroseries.py 2010-01-10 04:32:20 +0000 | |||
605 | @@ -13,6 +13,7 @@ | |||
606 | 13 | 'IDistroSeriesEditRestricted', | 13 | 'IDistroSeriesEditRestricted', |
607 | 14 | 'IDistroSeriesPublic', | 14 | 'IDistroSeriesPublic', |
608 | 15 | 'IDistroSeriesSet', | 15 | 'IDistroSeriesSet', |
609 | 16 | 'ISeriesMixin', | ||
610 | 16 | 'NoSuchDistroSeries', | 17 | 'NoSuchDistroSeries', |
611 | 17 | ] | 18 | ] |
612 | 18 | 19 | ||
613 | 19 | 20 | ||
614 | === modified file 'lib/lp/registry/model/distributionsourcepackage.py' | |||
615 | --- lib/lp/registry/model/distributionsourcepackage.py 2009-12-05 18:37:28 +0000 | |||
616 | +++ lib/lp/registry/model/distributionsourcepackage.py 2010-01-10 04:32:20 +0000 | |||
617 | @@ -31,8 +31,9 @@ | |||
618 | 31 | from lp.bugs.model.bugtarget import BugTargetBase | 31 | from lp.bugs.model.bugtarget import BugTargetBase |
619 | 32 | from lp.bugs.model.bugtask import BugTask | 32 | from lp.bugs.model.bugtask import BugTask |
620 | 33 | from lp.code.model.hasbranches import HasBranchesMixin, HasMergeProposalsMixin | 33 | from lp.code.model.hasbranches import HasBranchesMixin, HasMergeProposalsMixin |
621 | 34 | from lp.registry.interfaces.distributionsourcepackage import ( | ||
622 | 35 | IDistributionSourcePackage) | ||
623 | 34 | from lp.registry.interfaces.pocket import PackagePublishingPocket | 36 | from lp.registry.interfaces.pocket import PackagePublishingPocket |
624 | 35 | from lp.registry.interfaces.product import IDistributionSourcePackage | ||
625 | 36 | from lp.registry.model.karma import KarmaTotalCache | 37 | from lp.registry.model.karma import KarmaTotalCache |
626 | 37 | from lp.registry.model.person import Person | 38 | from lp.registry.model.person import Person |
627 | 38 | from lp.registry.model.sourcepackage import ( | 39 | from lp.registry.model.sourcepackage import ( |
628 | 39 | 40 | ||
629 | === modified file 'lib/lp/registry/model/product.py' | |||
630 | --- lib/lp/registry/model/product.py 2010-01-06 12:18:25 +0000 | |||
631 | +++ lib/lp/registry/model/product.py 2010-01-10 04:32:20 +0000 | |||
632 | @@ -221,7 +221,7 @@ | |||
633 | 221 | dbName='mugshot', foreignKey='LibraryFileAlias', default=None) | 221 | dbName='mugshot', foreignKey='LibraryFileAlias', default=None) |
634 | 222 | screenshotsurl = StringCol( | 222 | screenshotsurl = StringCol( |
635 | 223 | dbName='screenshotsurl', notNull=False, default=None) | 223 | dbName='screenshotsurl', notNull=False, default=None) |
637 | 224 | wikiurl = StringCol(dbName='wikiurl', notNull=False, default=None) | 224 | wikiurl = StringCol(dbName='wikiurl', notNull=False, default=None) |
638 | 225 | programminglang = StringCol( | 225 | programminglang = StringCol( |
639 | 226 | dbName='programminglang', notNull=False, default=None) | 226 | dbName='programminglang', notNull=False, default=None) |
640 | 227 | downloadurl = StringCol(dbName='downloadurl', notNull=False, default=None) | 227 | downloadurl = StringCol(dbName='downloadurl', notNull=False, default=None) |
641 | @@ -773,7 +773,7 @@ | |||
642 | 773 | Specification.product = %s AND | 773 | Specification.product = %s AND |
643 | 774 | Specification.id = MentoringOffer.specification | 774 | Specification.id = MentoringOffer.specification |
644 | 775 | """ % sqlvalues(self.id) + """ AND NOT | 775 | """ % sqlvalues(self.id) + """ AND NOT |
646 | 776 | (""" + Specification.completeness_clause +")", | 776 | (""" + Specification.completeness_clause + ")", |
647 | 777 | clauseTables=['Specification'], | 777 | clauseTables=['Specification'], |
648 | 778 | distinct=True) | 778 | distinct=True) |
649 | 779 | via_bugs = MentoringOffer.select(""" | 779 | via_bugs = MentoringOffer.select(""" |
650 | @@ -876,7 +876,7 @@ | |||
651 | 876 | 876 | ||
652 | 877 | # filter based on completion. see the implementation of | 877 | # filter based on completion. see the implementation of |
653 | 878 | # Specification.is_complete() for more details | 878 | # Specification.is_complete() for more details |
655 | 879 | completeness = Specification.completeness_clause | 879 | completeness = Specification.completeness_clause |
656 | 880 | 880 | ||
657 | 881 | if SpecificationFilter.COMPLETE in filter: | 881 | if SpecificationFilter.COMPLETE in filter: |
658 | 882 | query += ' AND ( %s ) ' % completeness | 882 | query += ' AND ( %s ) ' % completeness |
659 | @@ -929,7 +929,6 @@ | |||
660 | 929 | series.driver = owner | 929 | series.driver = owner |
661 | 930 | return series | 930 | return series |
662 | 931 | 931 | ||
663 | 932 | |||
664 | 933 | def getRelease(self, version): | 932 | def getRelease(self, version): |
665 | 934 | """See `IProduct`.""" | 933 | """See `IProduct`.""" |
666 | 935 | store = Store.of(self) | 934 | store = Store.of(self) |
667 | @@ -959,14 +958,14 @@ | |||
668 | 959 | Packaging.productseriesID == ProductSeries.id, | 958 | Packaging.productseriesID == ProductSeries.id, |
669 | 960 | ProductSeries.product == self, | 959 | ProductSeries.product == self, |
670 | 961 | Packaging.distroseriesID == DistroSeries.id, | 960 | Packaging.distroseriesID == DistroSeries.id, |
672 | 962 | DistroSeries.distributionID == Distribution.id | 961 | DistroSeries.distributionID == Distribution.id, |
673 | 963 | ).config(distinct=True).order_by(Distribution.name) | 962 | ).config(distinct=True).order_by(Distribution.name) |
674 | 964 | 963 | ||
675 | 965 | def setBugSupervisor(self, bug_supervisor, user): | 964 | def setBugSupervisor(self, bug_supervisor, user): |
676 | 966 | """See `IHasBugSupervisor`.""" | 965 | """See `IHasBugSupervisor`.""" |
677 | 967 | self.bug_supervisor = bug_supervisor | 966 | self.bug_supervisor = bug_supervisor |
678 | 968 | if bug_supervisor is not None: | 967 | if bug_supervisor is not None: |
680 | 969 | subscription = self.addBugSubscription(bug_supervisor, user) | 968 | self.addBugSubscription(bug_supervisor, user) |
681 | 970 | 969 | ||
682 | 971 | def composeCustomLanguageCodeMatch(self): | 970 | def composeCustomLanguageCodeMatch(self): |
683 | 972 | """See `HasCustomLanguageCodesMixin`.""" | 971 | """See `HasCustomLanguageCodesMixin`.""" |
684 | @@ -1008,8 +1007,7 @@ | |||
685 | 1008 | series.getTimeline(include_inactive=include_inactive) | 1007 | series.getTimeline(include_inactive=include_inactive) |
686 | 1009 | for series in series_list | 1008 | for series in series_list |
687 | 1010 | if include_inactive or series.active or | 1009 | if include_inactive or series.active or |
690 | 1011 | series == self.development_focus | 1010 | series == self.development_focus] |
689 | 1012 | ] | ||
691 | 1013 | 1011 | ||
692 | 1014 | 1012 | ||
693 | 1015 | class ProductSet: | 1013 | class ProductSet: |
694 | @@ -1296,7 +1294,7 @@ | |||
695 | 1296 | Product.id == ProductSeries.productID, | 1294 | Product.id == ProductSeries.productID, |
696 | 1297 | POTemplate.productseriesID == ProductSeries.id, | 1295 | POTemplate.productseriesID == ProductSeries.id, |
697 | 1298 | Product.official_rosetta == True, | 1296 | Product.official_rosetta == True, |
699 | 1299 | Person.id == Product._ownerID | 1297 | Person.id == Product._ownerID, |
700 | 1300 | ).config(distinct=True).order_by(Product.title) | 1298 | ).config(distinct=True).order_by(Product.title) |
701 | 1301 | 1299 | ||
702 | 1302 | # We only want Product - the other tables are just to populate | 1300 | # We only want Product - the other tables are just to populate |
703 | 1303 | 1301 | ||
704 | === modified file 'lib/lp/scripts/utilities/importfascist.py' | |||
705 | --- lib/lp/scripts/utilities/importfascist.py 2009-12-24 06:33:34 +0000 | |||
706 | +++ lib/lp/scripts/utilities/importfascist.py 2010-01-10 04:32:20 +0000 | |||
707 | @@ -16,6 +16,7 @@ | |||
708 | 16 | warnings.filterwarnings('ignore', category=UserWarning, append=True, | 16 | warnings.filterwarnings('ignore', category=UserWarning, append=True, |
709 | 17 | message=r'Module .*? is being added to sys.path') | 17 | message=r'Module .*? is being added to sys.path') |
710 | 18 | 18 | ||
711 | 19 | |||
712 | 19 | def text_lines_to_set(text): | 20 | def text_lines_to_set(text): |
713 | 20 | return set(line.strip() for line in text.splitlines() if line.strip()) | 21 | return set(line.strip() for line in text.splitlines() if line.strip()) |
714 | 21 | 22 | ||
715 | @@ -59,7 +60,11 @@ | |||
716 | 59 | 'cookielib': set(['domain_match']), | 60 | 'cookielib': set(['domain_match']), |
717 | 60 | 'email.Utils': set(['mktime_tz']), | 61 | 'email.Utils': set(['mktime_tz']), |
718 | 61 | 'textwrap': set(['dedent']), | 62 | 'textwrap': set(['dedent']), |
720 | 62 | 'zope.component': set(['adapter', 'provideHandler']), | 63 | 'zope.component': set( |
721 | 64 | ['adapter', | ||
722 | 65 | 'ComponentLookupError', | ||
723 | 66 | 'provideHandler', | ||
724 | 67 | ]), | ||
725 | 63 | } | 68 | } |
726 | 64 | 69 | ||
727 | 65 | 70 | ||
728 | @@ -279,7 +284,7 @@ | |||
729 | 279 | sorting_map = { | 284 | sorting_map = { |
730 | 280 | DatabaseImportPolicyViolation: database_violations, | 285 | DatabaseImportPolicyViolation: database_violations, |
731 | 281 | FromStarPolicyViolation: fromstar_violations, | 286 | FromStarPolicyViolation: fromstar_violations, |
733 | 282 | NotInModuleAllPolicyViolation: notinall_violations | 287 | NotInModuleAllPolicyViolation: notinall_violations, |
734 | 283 | } | 288 | } |
735 | 284 | for error in naughty_imports: | 289 | for error in naughty_imports: |
736 | 285 | sorting_map[error.__class__].append(error) | 290 | sorting_map[error.__class__].append(error) |
737 | 286 | 291 | ||
738 | === modified file 'lib/lp/services/job/runner.py' | |||
739 | --- lib/lp/services/job/runner.py 2009-12-10 19:26:46 +0000 | |||
740 | +++ lib/lp/services/job/runner.py 2010-01-10 04:32:20 +0000 | |||
741 | @@ -8,7 +8,11 @@ | |||
742 | 8 | __metaclass__ = type | 8 | __metaclass__ = type |
743 | 9 | 9 | ||
744 | 10 | 10 | ||
746 | 11 | __all__ = ['JobRunner'] | 11 | __all__ = [ |
747 | 12 | 'BaseRunnableJob', | ||
748 | 13 | 'JobRunner', | ||
749 | 14 | 'JobRunnerProcess', | ||
750 | 15 | ] | ||
751 | 12 | 16 | ||
752 | 13 | 17 | ||
753 | 14 | import contextlib | 18 | import contextlib |
754 | 15 | 19 | ||
755 | === modified file 'lib/lp/soyuz/browser/sourcepackagerelease.py' | |||
756 | --- lib/lp/soyuz/browser/sourcepackagerelease.py 2009-10-22 12:44:47 +0000 | |||
757 | +++ lib/lp/soyuz/browser/sourcepackagerelease.py 2010-01-10 04:32:20 +0000 | |||
758 | @@ -5,7 +5,12 @@ | |||
759 | 5 | 5 | ||
760 | 6 | __metaclass__ = type | 6 | __metaclass__ = type |
761 | 7 | 7 | ||
762 | 8 | # XXX: JonathanLange 2010-01-06: Many of these functions should be moved to a | ||
763 | 9 | # generic lp.services.text module. | ||
764 | 8 | __all__ = [ | 10 | __all__ = [ |
765 | 11 | 'extract_bug_numbers', | ||
766 | 12 | 'extract_email_addresses', | ||
767 | 13 | 'linkify_changelog', | ||
768 | 9 | 'SourcePackageReleaseView', | 14 | 'SourcePackageReleaseView', |
769 | 10 | ] | 15 | ] |
770 | 11 | 16 | ||
771 | 12 | 17 | ||
772 | === modified file 'lib/lp/soyuz/scripts/gina/packages.py' | |||
773 | --- lib/lp/soyuz/scripts/gina/packages.py 2009-06-25 04:06:00 +0000 | |||
774 | +++ lib/lp/soyuz/scripts/gina/packages.py 2010-01-10 04:32:20 +0000 | |||
775 | @@ -12,7 +12,15 @@ | |||
776 | 12 | __metaclass__ = type | 12 | __metaclass__ = type |
777 | 13 | 13 | ||
778 | 14 | 14 | ||
780 | 15 | __all__ = ['AbstractPackageData', 'SourcePackageData', 'BinaryPackageData'] | 15 | __all__ = [ |
781 | 16 | 'AbstractPackageData', | ||
782 | 17 | 'BinaryPackageData', | ||
783 | 18 | 'get_dsc_path', | ||
784 | 19 | 'PoolFileNotFound', | ||
785 | 20 | 'prioritymap', | ||
786 | 21 | 'SourcePackageData', | ||
787 | 22 | 'urgencymap', | ||
788 | 23 | ] | ||
789 | 16 | 24 | ||
790 | 17 | import re | 25 | import re |
791 | 18 | import os | 26 | import os |
792 | @@ -140,12 +148,13 @@ | |||
793 | 140 | 148 | ||
794 | 141 | return dsc, changelog, copyright | 149 | return dsc, changelog, copyright |
795 | 142 | 150 | ||
796 | 151 | |||
797 | 143 | def parse_person(val): | 152 | def parse_person(val): |
798 | 144 | if "," in val: | 153 | if "," in val: |
799 | 145 | # Some emails have ',' like "Adam C. Powell, IV | 154 | # Some emails have ',' like "Adam C. Powell, IV |
800 | 146 | # <hazelsct@debian.org>". rfc822.parseaddr seems to do not | 155 | # <hazelsct@debian.org>". rfc822.parseaddr seems to do not |
801 | 147 | # handle this properly, so we munge them here | 156 | # handle this properly, so we munge them here |
803 | 148 | val = val.replace(',','') | 157 | val = val.replace(',', '') |
804 | 149 | return rfc822.parseaddr(val) | 158 | return rfc822.parseaddr(val) |
805 | 150 | 159 | ||
806 | 151 | 160 | ||
807 | @@ -175,12 +184,6 @@ | |||
808 | 175 | 184 | ||
809 | 176 | line = line.split(":") | 185 | line = line.split(":") |
810 | 177 | algo = int(line[3]) | 186 | algo = int(line[3]) |
811 | 178 | if GPGALGOS.has_key(algo): | ||
812 | 179 | algochar = GPGALGOS[algo] | ||
813 | 180 | else: | ||
814 | 181 | algochar = "?" % algo | ||
815 | 182 | # STRIPPED GPGID Support by cprov 20041004 | ||
816 | 183 | # id = line[2] + algochar + "/" + line[4][-8:] | ||
817 | 184 | id = line[4][-8:] | 187 | id = line[4][-8:] |
818 | 185 | algorithm = algo | 188 | algorithm = algo |
819 | 186 | keysize = line[2] | 189 | keysize = line[2] |
820 | @@ -380,7 +383,6 @@ | |||
821 | 380 | 383 | ||
822 | 381 | AbstractPackageData.__init__(self) | 384 | AbstractPackageData.__init__(self) |
823 | 382 | 385 | ||
824 | 383 | |||
825 | 384 | def do_package(self, archive_root): | 386 | def do_package(self, archive_root): |
826 | 385 | """Get the Changelog and urgency from the package on archive. | 387 | """Get the Changelog and urgency from the package on archive. |
827 | 386 | 388 | ||
828 | @@ -397,7 +399,7 @@ | |||
829 | 397 | self.changelog = None | 399 | self.changelog = None |
830 | 398 | if changelog and changelog[0]: | 400 | if changelog and changelog[0]: |
831 | 399 | cldata = changelog[0] | 401 | cldata = changelog[0] |
833 | 400 | if cldata.has_key("changes"): | 402 | if 'changes' in cldata: |
834 | 401 | if cldata["package"] != self.package: | 403 | if cldata["package"] != self.package: |
835 | 402 | log.warn("Changelog package %s differs from %s" % | 404 | log.warn("Changelog package %s differs from %s" % |
836 | 403 | (cldata["package"], self.package)) | 405 | (cldata["package"], self.package)) |
837 | 404 | 406 | ||
838 | === modified file 'lib/lp/translations/scripts/po_import.py' | |||
839 | --- lib/lp/translations/scripts/po_import.py 2010-01-06 12:18:25 +0000 | |||
840 | +++ lib/lp/translations/scripts/po_import.py 2010-01-10 04:32:20 +0000 | |||
841 | @@ -7,13 +7,14 @@ | |||
842 | 7 | 7 | ||
843 | 8 | 8 | ||
844 | 9 | __all__ = [ | 9 | __all__ = [ |
846 | 10 | 'ImportProcess', | 10 | 'TranslationsImport', |
847 | 11 | ] | 11 | ] |
848 | 12 | 12 | ||
849 | 13 | from datetime import datetime, timedelta | 13 | from datetime import datetime, timedelta |
850 | 14 | import sys | 14 | import sys |
851 | 15 | 15 | ||
853 | 16 | from pytz import timezone | 16 | import pytz |
854 | 17 | |||
855 | 17 | from zope.component import getUtility | 18 | from zope.component import getUtility |
856 | 18 | 19 | ||
857 | 19 | from canonical.config import config | 20 | from canonical.config import config |
858 | @@ -143,9 +144,7 @@ | |||
859 | 143 | """Import entries from the queue.""" | 144 | """Import entries from the queue.""" |
860 | 144 | self.logger.debug("Starting the import process.") | 145 | self.logger.debug("Starting the import process.") |
861 | 145 | 146 | ||
865 | 146 | UTC = timezone('UTC') | 147 | self.deadline = datetime.now(pytz.UTC) + self.time_to_run |
863 | 147 | |||
864 | 148 | self.deadline = datetime.now(UTC) + self.time_to_run | ||
866 | 149 | translation_import_queue = getUtility(ITranslationImportQueue) | 148 | translation_import_queue = getUtility(ITranslationImportQueue) |
867 | 150 | 149 | ||
868 | 151 | # Get the list of each product or distroseries with pending imports. | 150 | # Get the list of each product or distroseries with pending imports. |
869 | @@ -160,7 +159,7 @@ | |||
870 | 160 | 159 | ||
871 | 161 | have_work = True | 160 | have_work = True |
872 | 162 | 161 | ||
874 | 163 | while have_work and datetime.now(UTC) < self.deadline: | 162 | while have_work and datetime.now(pytz.UTC) < self.deadline: |
875 | 164 | have_work = False | 163 | have_work = False |
876 | 165 | 164 | ||
877 | 166 | # For fairness, service all queues at least once; don't | 165 | # For fairness, service all queues at least once; don't |
878 | 167 | 166 | ||
879 | === modified file 'lib/lp/translations/scripts/translations_to_branch.py' | |||
880 | --- lib/lp/translations/scripts/translations_to_branch.py 2010-01-06 12:18:25 +0000 | |||
881 | +++ lib/lp/translations/scripts/translations_to_branch.py 2010-01-10 04:32:20 +0000 | |||
882 | @@ -9,7 +9,8 @@ | |||
883 | 9 | 9 | ||
884 | 10 | import os.path | 10 | import os.path |
885 | 11 | from datetime import datetime, timedelta | 11 | from datetime import datetime, timedelta |
887 | 12 | from pytz import timezone | 12 | |
888 | 13 | import pytz | ||
889 | 13 | 14 | ||
890 | 14 | from zope.component import getUtility | 15 | from zope.component import getUtility |
891 | 15 | 16 | ||
892 | @@ -27,9 +28,6 @@ | |||
893 | 27 | from lp.services.scripts.base import LaunchpadCronScript | 28 | from lp.services.scripts.base import LaunchpadCronScript |
894 | 28 | 29 | ||
895 | 29 | 30 | ||
896 | 30 | UTC = timezone('UTC') | ||
897 | 31 | |||
898 | 32 | |||
899 | 33 | class ExportTranslationsToBranch(LaunchpadCronScript): | 31 | class ExportTranslationsToBranch(LaunchpadCronScript): |
900 | 34 | """Commit translations to translations_branches where requested.""" | 32 | """Commit translations to translations_branches where requested.""" |
901 | 35 | 33 | ||
902 | @@ -69,7 +67,7 @@ | |||
903 | 69 | branch = source.translations_branch | 67 | branch = source.translations_branch |
904 | 70 | jobsource = getUtility(IRosettaUploadJobSource) | 68 | jobsource = getUtility(IRosettaUploadJobSource) |
905 | 71 | unfinished_jobs = jobsource.findUnfinishedJobs( | 69 | unfinished_jobs = jobsource.findUnfinishedJobs( |
907 | 72 | branch, since=datetime.now(UTC) - timedelta(days=1)) | 70 | branch, since=datetime.now(pytz.UTC) - timedelta(days=1)) |
908 | 73 | 71 | ||
909 | 74 | if unfinished_jobs.any(): | 72 | if unfinished_jobs.any(): |
910 | 75 | raise ConcurrentUpdateError( | 73 | raise ConcurrentUpdateError( |
911 | @@ -133,11 +131,11 @@ | |||
912 | 133 | # The bzr timestamp is a float representing UTC-based seconds | 131 | # The bzr timestamp is a float representing UTC-based seconds |
913 | 134 | # since the epoch. It stores the timezone as well, but we can | 132 | # since the epoch. It stores the timezone as well, but we can |
914 | 135 | # ignore it here. | 133 | # ignore it here. |
916 | 136 | return datetime.fromtimestamp(revision.timestamp, UTC) | 134 | return datetime.fromtimestamp(revision.timestamp, pytz.UTC) |
917 | 137 | 135 | ||
918 | 138 | def _getLatestTranslationsCommit(self, branch): | 136 | def _getLatestTranslationsCommit(self, branch): |
919 | 139 | """Get date of last translations commit to `branch`, if any.""" | 137 | """Get date of last translations commit to `branch`, if any.""" |
921 | 140 | cutoff_date = datetime.now(UTC) - self.previous_commit_cutoff_age | 138 | cutoff_date = datetime.now(pytz.UTC) - self.previous_commit_cutoff_age |
922 | 141 | 139 | ||
923 | 142 | revno, current_rev = branch.last_revision_info() | 140 | revno, current_rev = branch.last_revision_info() |
924 | 143 | repository = branch.repository | 141 | repository = branch.repository |
This fixes a bunch of the import warnings, hopefully in a sane way.