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