Merge lp:~adiroiban/launchpad/bug-496352-series-status-refactor into lp:launchpad
- bug-496352-series-status-refactor
- Merge into devel
Proposed by
Adi Roiban
Status: | Merged |
---|---|
Approved by: | Aaron Bentley |
Approved revision: | not available |
Merged at revision: | not available |
Proposed branch: | lp:~adiroiban/launchpad/bug-496352-series-status-refactor |
Merge into: | lp:launchpad |
Diff against target: |
2059 lines (+333/-322) 58 files modified
lib/canonical/launchpad/doc/security-proxies.txt (+3/-3) lib/canonical/launchpad/interfaces/__init__.py (+1/-0) lib/canonical/launchpad/vocabularies/dbobjects.py (+3/-3) lib/lp/archivepublisher/tests/test_dominator.py (+2/-2) lib/lp/archivepublisher/tests/test_publisher.py (+4/-4) lib/lp/archivepublisher/tests/util.py (+2/-2) lib/lp/archiveuploader/tests/test_permission.py (+2/-2) lib/lp/archiveuploader/tests/test_uploadprocessor.py (+10/-10) lib/lp/archiveuploader/uploadpolicy.py (+2/-3) lib/lp/bugs/doc/bug-nomination.txt (+2/-2) lib/lp/bugs/model/bug.py (+3/-3) lib/lp/code/browser/branchlisting.py (+2/-2) lib/lp/code/tests/helpers.py (+9/-9) lib/lp/code/tests/test_branch.py (+3/-3) lib/lp/registry/browser/distribution.py (+3/-3) lib/lp/registry/browser/distroseries.py (+11/-11) lib/lp/registry/browser/product.py (+3/-3) lib/lp/registry/browser/productseries.py (+2/-2) lib/lp/registry/browser/tests/browser-views.txt (+4/-4) lib/lp/registry/browser/tests/distributionsourcepackage-views.txt (+2/-2) lib/lp/registry/browser/tests/packaging-views.txt (+3/-3) lib/lp/registry/browser/tests/productseries-views.txt (+2/-2) lib/lp/registry/doc/distroseries.txt (+27/-27) lib/lp/registry/doc/product.txt (+3/-4) lib/lp/registry/interfaces/distroseries.py (+3/-70) lib/lp/registry/interfaces/productseries.py (+3/-3) lib/lp/registry/interfaces/series.py (+78/-0) lib/lp/registry/model/distribution.py (+11/-10) lib/lp/registry/model/distroseries.py (+25/-24) lib/lp/registry/model/productseries.py (+3/-3) lib/lp/registry/stories/distribution/xx-distribution-packages.txt (+3/-3) lib/lp/registry/stories/productseries/xx-productseries-series.txt (+2/-2) lib/lp/registry/tests/test_distribution.py (+2/-2) lib/lp/registry/tests/test_sourcepackage.py (+3/-3) lib/lp/soyuz/browser/archive.py (+2/-2) lib/lp/soyuz/doc/build.txt (+3/-3) lib/lp/soyuz/doc/buildd-slavescanner.txt (+2/-2) lib/lp/soyuz/doc/nascentupload-announcements.txt (+8/-8) lib/lp/soyuz/doc/nascentupload.txt (+4/-4) lib/lp/soyuz/doc/package-diff.txt (+2/-2) lib/lp/soyuz/doc/soyuz-set-of-uploads.txt (+3/-3) lib/lp/soyuz/doc/uploadpolicy.txt (+2/-2) lib/lp/soyuz/scripts/buildd.py (+2/-2) lib/lp/soyuz/scripts/ftpmaster.py (+7/-7) lib/lp/soyuz/scripts/tests/test_copypackage.py (+2/-2) lib/lp/soyuz/scripts/tests/test_lpquerydistro.py (+2/-2) lib/lp/soyuz/scripts/tests/test_obsoletedistroseries.py (+3/-3) lib/lp/soyuz/scripts/tests/test_queue.py (+3/-3) lib/lp/soyuz/tests/test_packageset.py (+4/-4) lib/lp/soyuz/tests/test_packageupload.py (+3/-3) lib/lp/soyuz/tests/test_publishing_top_level_api.py (+10/-10) lib/lp/testing/factory.py (+10/-9) lib/lp/translations/browser/distribution.py (+2/-2) lib/lp/translations/browser/tests/distroseries-views.txt (+2/-2) lib/lp/translations/model/translationimportqueue.py (+3/-3) lib/lp/translations/scripts/remove_obsolete_translations.py (+7/-7) lib/lp/translations/templates/pofile-details.pt (+4/-6) lib/lp/translations/tests/test_autoapproval.py (+2/-2) |
To merge this branch: | bzr merge lp:~adiroiban/launchpad/bug-496352-series-status-refactor |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Aaron Bentley (community) | Approve | ||
Review via email: mp+16108@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Revision history for this message
Adi Roiban (adiroiban) wrote : | # |
Revision history for this message
Adi Roiban (adiroiban) wrote : | # |
I forgot one thing.
We also have lp.registry.
This has only internal usage for DistroSeries... maybe we should also move it or renamed it to DistroSeriesSta
Revision history for this message
Aaron Bentley (abentley) wrote : | # |
This looks like a reasonable, mechanical change.
review:
Approve
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'lib/canonical/launchpad/doc/security-proxies.txt' |
2 | --- lib/canonical/launchpad/doc/security-proxies.txt 2009-08-13 15:12:16 +0000 |
3 | +++ lib/canonical/launchpad/doc/security-proxies.txt 2010-01-05 16:22:16 +0000 |
4 | @@ -49,13 +49,13 @@ |
5 | DB schema objects should be comparable correctly when proxied... |
6 | |
7 | >>> from canonical.launchpad.interfaces import ( |
8 | - ... DistroSeriesStatus, IDistroSeriesSet) |
9 | + ... SeriesStatus, IDistroSeriesSet) |
10 | >>> hoary = getUtility(IDistroSeriesSet).get(3) |
11 | >>> print hoary.status.name |
12 | DEVELOPMENT |
13 | - >>> hoary.status == DistroSeriesStatus.DEVELOPMENT |
14 | + >>> hoary.status == SeriesStatus.DEVELOPMENT |
15 | True |
16 | - >>> hoary.status is DistroSeriesStatus.DEVELOPMENT |
17 | + >>> hoary.status is SeriesStatus.DEVELOPMENT |
18 | False |
19 | |
20 | Finally, tear down the test: |
21 | |
22 | === modified file 'lib/canonical/launchpad/interfaces/__init__.py' |
23 | --- lib/canonical/launchpad/interfaces/__init__.py 2009-12-05 18:37:28 +0000 |
24 | +++ lib/canonical/launchpad/interfaces/__init__.py 2010-01-05 16:22:16 +0000 |
25 | @@ -57,6 +57,7 @@ |
26 | from lp.registry.interfaces.distributionsourcepackage import * |
27 | from lp.soyuz.interfaces.distributionsourcepackagecache import * |
28 | from lp.soyuz.interfaces.distributionsourcepackagerelease import * |
29 | +from lp.registry.interfaces.series import * |
30 | from lp.soyuz.interfaces.distroarchseries import * |
31 | from lp.soyuz.interfaces.distroarchseriesbinarypackage import * |
32 | from lp.soyuz.interfaces.distroarchseriesbinarypackagerelease\ |
33 | |
34 | === modified file 'lib/canonical/launchpad/vocabularies/dbobjects.py' |
35 | --- lib/canonical/launchpad/vocabularies/dbobjects.py 2009-10-26 18:40:04 +0000 |
36 | +++ lib/canonical/launchpad/vocabularies/dbobjects.py 2010-01-05 16:22:16 +0000 |
37 | @@ -90,8 +90,8 @@ |
38 | from lp.code.interfaces.branch import IBranch |
39 | from lp.code.interfaces.branchcollection import IAllBranches |
40 | from lp.registry.interfaces.distribution import IDistribution |
41 | -from lp.registry.interfaces.distroseries import ( |
42 | - DistroSeriesStatus, IDistroSeries) |
43 | +from lp.registry.interfaces.series import SeriesStatus |
44 | +from lp.registry.interfaces.distroseries import IDistroSeries |
45 | from lp.registry.interfaces.person import IPerson |
46 | from lp.registry.interfaces.product import IProduct |
47 | from lp.registry.interfaces.productseries import IProductSeries |
48 | @@ -780,7 +780,7 @@ |
49 | """Return all non-obsolete distribution series""" |
50 | return [ |
51 | series for series in shortlist(self.distribution.series) |
52 | - if series.status != DistroSeriesStatus.OBSOLETE] |
53 | + if series.status != SeriesStatus.OBSOLETE] |
54 | |
55 | def _queryNominatableObjectByName(self, name): |
56 | """See BugNominatableSeriesVocabularyBase.""" |
57 | |
58 | === modified file 'lib/lp/archivepublisher/tests/test_dominator.py' |
59 | --- lib/lp/archivepublisher/tests/test_dominator.py 2009-08-28 07:34:44 +0000 |
60 | +++ lib/lp/archivepublisher/tests/test_dominator.py 2010-01-05 16:22:16 +0000 |
61 | @@ -14,7 +14,7 @@ |
62 | from lp.archivepublisher.domination import Dominator |
63 | from lp.archivepublisher.publishing import Publisher |
64 | from canonical.database.sqlbase import flush_database_updates |
65 | -from lp.registry.interfaces.distroseries import DistroSeriesStatus |
66 | +from lp.registry.interfaces.series import SeriesStatus |
67 | from lp.soyuz.interfaces.component import IComponentSet |
68 | from lp.registry.interfaces.person import IPersonSet |
69 | from lp.registry.interfaces.pocket import PackagePublishingPocket |
70 | @@ -404,7 +404,7 @@ |
71 | def setUp(self): |
72 | TestDomination.setUp(self) |
73 | self.ubuntutest['breezy-autotest'].status = ( |
74 | - DistroSeriesStatus.OBSOLETE) |
75 | + SeriesStatus.OBSOLETE) |
76 | |
77 | |
78 | def test_suite(): |
79 | |
80 | === modified file 'lib/lp/archivepublisher/tests/test_publisher.py' |
81 | --- lib/lp/archivepublisher/tests/test_publisher.py 2009-12-14 17:32:06 +0000 |
82 | +++ lib/lp/archivepublisher/tests/test_publisher.py 2010-01-05 16:22:16 +0000 |
83 | @@ -30,7 +30,7 @@ |
84 | from lp.soyuz.interfaces.binarypackagerelease import ( |
85 | BinaryPackageFormat) |
86 | from lp.registry.interfaces.distribution import IDistributionSet |
87 | -from lp.registry.interfaces.distroseries import DistroSeriesStatus |
88 | +from lp.registry.interfaces.series import SeriesStatus |
89 | from canonical.launchpad.interfaces.gpghandler import IGPGHandler |
90 | from lp.registry.interfaces.person import IPersonSet |
91 | from lp.registry.interfaces.pocket import PackagePublishingPocket |
92 | @@ -137,7 +137,7 @@ |
93 | distroseries is always allowed, so check for that here. |
94 | """ |
95 | archive = self.ubuntutest.getArchiveByComponent('partner') |
96 | - self.ubuntutest['breezy-autotest'].status = DistroSeriesStatus.CURRENT |
97 | + self.ubuntutest['breezy-autotest'].status = SeriesStatus.CURRENT |
98 | pub_config = getPubConfig(archive) |
99 | pub_config.setupArchiveDirs() |
100 | disk_pool = DiskPool( |
101 | @@ -201,7 +201,7 @@ |
102 | PackagePublishingPocket.UPDATES)]) |
103 | |
104 | self.ubuntutest['breezy-autotest'].status = ( |
105 | - DistroSeriesStatus.CURRENT) |
106 | + SeriesStatus.CURRENT) |
107 | |
108 | pub_source = self.getPubSource( |
109 | filecontent='foo', |
110 | @@ -645,7 +645,7 @@ |
111 | # If the distroseries is CURRENT, then the release pocket is not |
112 | # marked as dirty. |
113 | self.ubuntutest['breezy-autotest'].status = ( |
114 | - DistroSeriesStatus.CURRENT) |
115 | + SeriesStatus.CURRENT) |
116 | |
117 | publisher.dirty_pockets = set() |
118 | publisher.A2_markPocketsWithDeletionsDirty() |
119 | |
120 | === modified file 'lib/lp/archivepublisher/tests/util.py' |
121 | --- lib/lp/archivepublisher/tests/util.py 2009-10-26 18:40:04 +0000 |
122 | +++ lib/lp/archivepublisher/tests/util.py 2010-01-05 16:22:16 +0000 |
123 | @@ -8,7 +8,7 @@ |
124 | # Utility functions/classes for testing the archive publisher. |
125 | |
126 | from lp.archivepublisher.tests import datadir |
127 | -from canonical.launchpad.interfaces import DistroSeriesStatus |
128 | +from canonical.launchpad.interfaces import SeriesStatus |
129 | from lp.registry.interfaces.pocket import PackagePublishingPocket |
130 | |
131 | __all__ = ['FakeLogger'] |
132 | @@ -44,7 +44,7 @@ |
133 | self.distribution = distro |
134 | self.architectures = [FakeDistroArchSeries(self, "i386"), |
135 | FakeDistroArchSeries(self, "powerpc")] |
136 | - self.status = DistroSeriesStatus.DEVELOPMENT |
137 | + self.status = SeriesStatus.DEVELOPMENT |
138 | self.distribution.registerSeries(self) |
139 | |
140 | |
141 | |
142 | === modified file 'lib/lp/archiveuploader/tests/test_permission.py' |
143 | --- lib/lp/archiveuploader/tests/test_permission.py 2009-11-20 22:22:53 +0000 |
144 | +++ lib/lp/archiveuploader/tests/test_permission.py 2010-01-05 16:22:16 +0000 |
145 | @@ -14,7 +14,7 @@ |
146 | |
147 | from lp.archiveuploader.permission import ( |
148 | check_upload_to_archive, components_valid_for) |
149 | -from lp.registry.interfaces.distroseries import DistroSeriesStatus |
150 | +from lp.registry.interfaces.series import SeriesStatus |
151 | from lp.registry.interfaces.pocket import PackagePublishingPocket |
152 | from lp.soyuz.interfaces.archive import ArchivePurpose |
153 | from lp.soyuz.interfaces.archivepermission import IArchivePermissionSet |
154 | @@ -131,7 +131,7 @@ |
155 | purpose=ArchivePurpose.PPA, owner=person) |
156 | spn = self.factory.makeSourcePackageName() |
157 | distroseries = self.factory.makeDistroSeries( |
158 | - status=DistroSeriesStatus.CURRENT) |
159 | + status=SeriesStatus.CURRENT) |
160 | self.assertCanUpload( |
161 | person, spn, ppa, None, distroseries=distroseries) |
162 | |
163 | |
164 | === modified file 'lib/lp/archiveuploader/tests/test_uploadprocessor.py' |
165 | --- lib/lp/archiveuploader/tests/test_uploadprocessor.py 2009-11-18 02:58:23 +0000 |
166 | +++ lib/lp/archiveuploader/tests/test_uploadprocessor.py 2010-01-05 16:22:16 +0000 |
167 | @@ -38,7 +38,7 @@ |
168 | SourcePackageRelease) |
169 | from canonical.launchpad.ftests import import_public_test_keys |
170 | from lp.registry.interfaces.distribution import IDistributionSet |
171 | -from lp.registry.interfaces.distroseries import DistroSeriesStatus |
172 | +from lp.registry.interfaces.series import SeriesStatus |
173 | from lp.registry.interfaces.pocket import PackagePublishingPocket |
174 | from lp.registry.interfaces.sourcepackage import SourcePackageFileType |
175 | from lp.soyuz.interfaces.archive import ArchivePurpose, IArchiveSet |
176 | @@ -493,7 +493,7 @@ |
177 | |
178 | # Make ubuntu/breezy a frozen distro, so a source upload for an |
179 | # existing package will be allowed, but unapproved. |
180 | - self.breezy.status = DistroSeriesStatus.FROZEN |
181 | + self.breezy.status = SeriesStatus.FROZEN |
182 | self.layer.txn.commit() |
183 | |
184 | # Upload a newer version of bar. |
185 | @@ -576,7 +576,7 @@ |
186 | See bug 369512. |
187 | """ |
188 | self._checkCopyArchiveUploadToDistro( |
189 | - PackagePublishingPocket.RELEASE, DistroSeriesStatus.CURRENT) |
190 | + PackagePublishingPocket.RELEASE, SeriesStatus.CURRENT) |
191 | |
192 | def testCopyArchiveUploadToSupportedDistro(self): |
193 | """Check binary copy archive uploads to RELEASE pockets. |
194 | @@ -588,7 +588,7 @@ |
195 | See bug 369512. |
196 | """ |
197 | self._checkCopyArchiveUploadToDistro( |
198 | - PackagePublishingPocket.RELEASE, DistroSeriesStatus.SUPPORTED) |
199 | + PackagePublishingPocket.RELEASE, SeriesStatus.SUPPORTED) |
200 | |
201 | def testDuplicatedBinaryUploadGetsRejected(self): |
202 | """The upload processor rejects duplicated binary uploads. |
203 | @@ -964,7 +964,7 @@ |
204 | def testPartnerUploadToProposedPocket(self): |
205 | """Upload a partner package to the proposed pocket.""" |
206 | self.setupBreezy() |
207 | - self.breezy.status = DistroSeriesStatus.CURRENT |
208 | + self.breezy.status = SeriesStatus.CURRENT |
209 | self.layer.txn.commit() |
210 | self.options.context = 'insecure' |
211 | uploadprocessor = UploadProcessor( |
212 | @@ -983,7 +983,7 @@ |
213 | distroseries is allowed. |
214 | """ |
215 | self.setupBreezy() |
216 | - self.breezy.status = DistroSeriesStatus.CURRENT |
217 | + self.breezy.status = SeriesStatus.CURRENT |
218 | self.layer.txn.commit() |
219 | self.options.context = 'insecure' |
220 | uploadprocessor = UploadProcessor( |
221 | @@ -1029,21 +1029,21 @@ |
222 | |
223 | # Check unstable states: |
224 | |
225 | - self.breezy.status = DistroSeriesStatus.DEVELOPMENT |
226 | + self.breezy.status = SeriesStatus.DEVELOPMENT |
227 | self.layer.txn.commit() |
228 | self._uploadPartnerToNonReleasePocketAndCheckFail() |
229 | |
230 | - self.breezy.status = DistroSeriesStatus.EXPERIMENTAL |
231 | + self.breezy.status = SeriesStatus.EXPERIMENTAL |
232 | self.layer.txn.commit() |
233 | self._uploadPartnerToNonReleasePocketAndCheckFail() |
234 | |
235 | # Check stable states: |
236 | |
237 | - self.breezy.status = DistroSeriesStatus.CURRENT |
238 | + self.breezy.status = SeriesStatus.CURRENT |
239 | self.layer.txn.commit() |
240 | self._uploadPartnerToNonReleasePocketAndCheckFail() |
241 | |
242 | - self.breezy.status = DistroSeriesStatus.SUPPORTED |
243 | + self.breezy.status = SeriesStatus.SUPPORTED |
244 | self.layer.txn.commit() |
245 | self._uploadPartnerToNonReleasePocketAndCheckFail() |
246 | |
247 | |
248 | === modified file 'lib/lp/archiveuploader/uploadpolicy.py' |
249 | --- lib/lp/archiveuploader/uploadpolicy.py 2009-11-24 23:12:23 +0000 |
250 | +++ lib/lp/archiveuploader/uploadpolicy.py 2010-01-05 16:22:16 +0000 |
251 | @@ -11,9 +11,8 @@ |
252 | |
253 | from canonical.launchpad.interfaces import ILaunchpadCelebrities |
254 | from lp.registry.interfaces.distribution import IDistributionSet |
255 | -from lp.registry.interfaces.distroseries import DistroSeriesStatus |
256 | +from lp.registry.interfaces.series import SeriesStatus |
257 | from lp.registry.interfaces.pocket import PackagePublishingPocket |
258 | -from lp.soyuz.interfaces.archive import ArchivePurpose |
259 | |
260 | |
261 | # Number of seconds in an hour (used later) |
262 | @@ -295,7 +294,7 @@ |
263 | |
264 | if self.pocket == PackagePublishingPocket.RELEASE: |
265 | if (self.distroseries.status != |
266 | - DistroSeriesStatus.FROZEN): |
267 | + SeriesStatus.FROZEN): |
268 | return True |
269 | return False |
270 | |
271 | |
272 | === modified file 'lib/lp/bugs/doc/bug-nomination.txt' |
273 | --- lib/lp/bugs/doc/bug-nomination.txt 2009-10-26 18:40:04 +0000 |
274 | +++ lib/lp/bugs/doc/bug-nomination.txt 2010-01-05 16:22:16 +0000 |
275 | @@ -640,12 +640,12 @@ |
276 | NominationSeriesObsoleteError. Let's make a new obsolete distroseries |
277 | to demonstrate. |
278 | |
279 | - >>> from canonical.launchpad.interfaces import DistroSeriesStatus |
280 | + >>> from canonical.launchpad.interfaces import SeriesStatus |
281 | |
282 | >>> login("foo.bar@canonical.com") |
283 | >>> ubuntu_edgy = factory.makeDistroRelease( |
284 | ... distribution=ubuntu, version='6.10', |
285 | - ... status=DistroSeriesStatus.OBSOLETE) |
286 | + ... status=SeriesStatus.OBSOLETE) |
287 | >>> login("no-priv@canonical.com") |
288 | |
289 | >>> bug_one.addNomination(target=ubuntu_edgy, owner=no_privs) |
290 | |
291 | === modified file 'lib/lp/bugs/model/bug.py' |
292 | --- lib/lp/bugs/model/bug.py 2009-12-14 15:25:55 +0000 |
293 | +++ lib/lp/bugs/model/bug.py 2010-01-05 16:22:16 +0000 |
294 | @@ -90,8 +90,8 @@ |
295 | from lp.registry.interfaces.distribution import IDistribution |
296 | from lp.registry.interfaces.distributionsourcepackage import ( |
297 | IDistributionSourcePackage) |
298 | -from lp.registry.interfaces.distroseries import ( |
299 | - DistroSeriesStatus, IDistroSeries) |
300 | +from lp.registry.interfaces.series import SeriesStatus |
301 | +from lp.registry.interfaces.distroseries import IDistroSeries |
302 | from lp.registry.interfaces.person import IPersonSet |
303 | from lp.registry.interfaces.person import validate_public_person |
304 | from lp.registry.interfaces.product import IProduct |
305 | @@ -1086,7 +1086,7 @@ |
306 | productseries = None |
307 | if IDistroSeries.providedBy(target): |
308 | distroseries = target |
309 | - if target.status == DistroSeriesStatus.OBSOLETE: |
310 | + if target.status == SeriesStatus.OBSOLETE: |
311 | raise NominationSeriesObsoleteError( |
312 | "%s is an obsolete series." % target.bugtargetdisplayname) |
313 | else: |
314 | |
315 | === modified file 'lib/lp/code/browser/branchlisting.py' |
316 | --- lib/lp/code/browser/branchlisting.py 2009-11-11 01:53:33 +0000 |
317 | +++ lib/lp/code/browser/branchlisting.py 2010-01-05 16:22:16 +0000 |
318 | @@ -85,7 +85,7 @@ |
319 | IFindOfficialBranchLinks) |
320 | from lp.registry.browser.product import ( |
321 | ProductDownloadFileMixin, SortSeriesMixin) |
322 | -from lp.registry.interfaces.distroseries import DistroSeriesStatus |
323 | +from lp.registry.interfaces.series import SeriesStatus |
324 | from lp.registry.interfaces.person import IPerson, IPersonSet |
325 | from lp.registry.interfaces.pocket import PackagePublishingPocket |
326 | from lp.registry.interfaces.product import IProduct |
327 | @@ -170,7 +170,7 @@ |
328 | @property |
329 | def active_series(self): |
330 | return [series for series in self.associated_product_series |
331 | - if series.status != DistroSeriesStatus.OBSOLETE] |
332 | + if series.status != SeriesStatus.OBSOLETE] |
333 | |
334 | @property |
335 | def bzr_identity(self): |
336 | |
337 | === modified file 'lib/lp/code/tests/helpers.py' |
338 | --- lib/lp/code/tests/helpers.py 2009-12-10 01:49:16 +0000 |
339 | +++ lib/lp/code/tests/helpers.py 2010-01-05 16:22:16 +0000 |
340 | @@ -21,7 +21,7 @@ |
341 | |
342 | from lp.code.interfaces.seriessourcepackagebranch import ( |
343 | IMakeOfficialBranchLinks) |
344 | -from lp.registry.interfaces.distroseries import DistroSeriesStatus |
345 | +from lp.registry.interfaces.series import SeriesStatus |
346 | from lp.registry.interfaces.pocket import PackagePublishingPocket |
347 | from lp.testing import time_counter |
348 | |
349 | @@ -185,14 +185,14 @@ |
350 | mint = factory.makeDistribution( |
351 | name='mint', displayname='Mint', owner=albert, members=mint_team) |
352 | series = [ |
353 | - ("wild", "5.5", DistroSeriesStatus.EXPERIMENTAL), |
354 | - ("dev", "4.0", DistroSeriesStatus.DEVELOPMENT), |
355 | - ("stable", "3.0", DistroSeriesStatus.CURRENT), |
356 | - ("old", "2.0", DistroSeriesStatus.SUPPORTED), |
357 | - ("very-old", "1.5", DistroSeriesStatus.SUPPORTED), |
358 | - ("ancient", "1.0", DistroSeriesStatus.SUPPORTED), |
359 | - ("mouldy", "0.6", DistroSeriesStatus.SUPPORTED), |
360 | - ("dead", "0.1", DistroSeriesStatus.OBSOLETE), |
361 | + ("wild", "5.5", SeriesStatus.EXPERIMENTAL), |
362 | + ("dev", "4.0", SeriesStatus.DEVELOPMENT), |
363 | + ("stable", "3.0", SeriesStatus.CURRENT), |
364 | + ("old", "2.0", SeriesStatus.SUPPORTED), |
365 | + ("very-old", "1.5", SeriesStatus.SUPPORTED), |
366 | + ("ancient", "1.0", SeriesStatus.SUPPORTED), |
367 | + ("mouldy", "0.6", SeriesStatus.SUPPORTED), |
368 | + ("dead", "0.1", SeriesStatus.OBSOLETE), |
369 | ] |
370 | for name, version, status in series: |
371 | factory.makeDistroRelease( |
372 | |
373 | === modified file 'lib/lp/code/tests/test_branch.py' |
374 | --- lib/lp/code/tests/test_branch.py 2009-11-13 05:13:07 +0000 |
375 | +++ lib/lp/code/tests/test_branch.py 2010-01-05 16:22:16 +0000 |
376 | @@ -15,9 +15,9 @@ |
377 | from lp.archiveuploader.permission import verify_upload |
378 | from lp.code.enums import ( |
379 | BranchSubscriptionDiffSize, BranchSubscriptionNotificationLevel, |
380 | - BranchType, CodeReviewNotificationLevel) |
381 | + CodeReviewNotificationLevel) |
382 | from lp.code.interfaces.linkedbranch import ICanHasLinkedBranch |
383 | -from lp.registry.interfaces.distroseries import DistroSeriesStatus |
384 | +from lp.registry.interfaces.series import SeriesStatus |
385 | from lp.registry.interfaces.pocket import PackagePublishingPocket |
386 | from lp.soyuz.interfaces.archivepermission import IArchivePermissionSet |
387 | from lp.testing import run_with_login, TestCaseWithFactory |
388 | @@ -247,7 +247,7 @@ |
389 | # Make sure the (distroseries, pocket) combination used allows us to |
390 | # upload to it. |
391 | stable_states = ( |
392 | - DistroSeriesStatus.SUPPORTED, DistroSeriesStatus.CURRENT) |
393 | + SeriesStatus.SUPPORTED, SeriesStatus.CURRENT) |
394 | if branch.distroseries.status in stable_states: |
395 | pocket = PackagePublishingPocket.BACKPORTS |
396 | else: |
397 | |
398 | === modified file 'lib/lp/registry/browser/distribution.py' |
399 | --- lib/lp/registry/browser/distribution.py 2009-12-05 18:37:28 +0000 |
400 | +++ lib/lp/registry/browser/distribution.py 2010-01-05 16:22:16 +0000 |
401 | @@ -70,7 +70,7 @@ |
402 | IDistributionSet) |
403 | from lp.registry.interfaces.distributionmirror import ( |
404 | IDistributionMirrorSet, MirrorContent, MirrorSpeed) |
405 | -from lp.registry.interfaces.distroseries import DistroSeriesStatus |
406 | +from lp.registry.interfaces.series import SeriesStatus |
407 | from lp.registry.interfaces.product import IProduct |
408 | from lp.soyuz.interfaces.publishedpackage import ( |
409 | IPublishedPackageSet) |
410 | @@ -812,9 +812,9 @@ |
411 | |
412 | def getCssClass(self, series): |
413 | """The highlighted, unhighlighted, or dimmed CSS class.""" |
414 | - if series.status == DistroSeriesStatus.DEVELOPMENT: |
415 | + if series.status == SeriesStatus.DEVELOPMENT: |
416 | return 'highlighted' |
417 | - elif series.status == DistroSeriesStatus.OBSOLETE: |
418 | + elif series.status == SeriesStatus.OBSOLETE: |
419 | return 'dimmed' |
420 | else: |
421 | return 'unhighlighted' |
422 | |
423 | === modified file 'lib/lp/registry/browser/distroseries.py' |
424 | --- lib/lp/registry/browser/distroseries.py 2009-12-18 13:25:19 +0000 |
425 | +++ lib/lp/registry/browser/distroseries.py 2010-01-05 16:22:16 +0000 |
426 | @@ -35,8 +35,8 @@ |
427 | from canonical.launchpad.browser.packagesearch import PackageSearchViewBase |
428 | from lp.soyuz.browser.queue import QueueItemsView |
429 | from lp.services.worlddata.interfaces.country import ICountry |
430 | -from lp.registry.interfaces.distroseries import ( |
431 | - DistroSeriesStatus, IDistroSeries) |
432 | +from lp.registry.interfaces.series import SeriesStatus |
433 | +from lp.registry.interfaces.distroseries import IDistroSeries |
434 | from lp.translations.interfaces.distroserieslanguage import ( |
435 | IDistroSeriesLanguageSet) |
436 | from lp.services.worlddata.interfaces.language import ILanguageSet |
437 | @@ -244,7 +244,7 @@ |
438 | label = 'Search packages' |
439 | |
440 | |
441 | -class DistroSeriesStatusMixin: |
442 | +class SeriesStatusMixin: |
443 | """A mixin that provides status field support.""" |
444 | |
445 | def createStatusField(self): |
446 | @@ -256,15 +256,15 @@ |
447 | * unstable -> EXPERIMENTAL, DEVELOPMENT, FROZEN, FUTURE, CURRENT |
448 | """ |
449 | stable_status = ( |
450 | - DistroSeriesStatus.CURRENT, |
451 | - DistroSeriesStatus.SUPPORTED, |
452 | - DistroSeriesStatus.OBSOLETE, |
453 | + SeriesStatus.CURRENT, |
454 | + SeriesStatus.SUPPORTED, |
455 | + SeriesStatus.OBSOLETE, |
456 | ) |
457 | |
458 | if self.context.status not in stable_status: |
459 | - terms = [status for status in DistroSeriesStatus.items |
460 | + terms = [status for status in SeriesStatus.items |
461 | if status not in stable_status] |
462 | - terms.append(DistroSeriesStatus.CURRENT) |
463 | + terms.append(SeriesStatus.CURRENT) |
464 | else: |
465 | terms = stable_status |
466 | |
467 | @@ -282,7 +282,7 @@ |
468 | def updateDateReleased(self, status): |
469 | """Update the datereleased field if the status is set to CURRENT.""" |
470 | if (self.context.datereleased is None and |
471 | - status == DistroSeriesStatus.CURRENT): |
472 | + status == SeriesStatus.CURRENT): |
473 | self.context.datereleased = UTC_NOW |
474 | |
475 | |
476 | @@ -328,7 +328,7 @@ |
477 | milestone_can_release = False |
478 | |
479 | |
480 | -class DistroSeriesEditView(LaunchpadEditFormView, DistroSeriesStatusMixin): |
481 | +class DistroSeriesEditView(LaunchpadEditFormView, SeriesStatusMixin): |
482 | """View class that lets you edit a DistroSeries object. |
483 | |
484 | It redirects to the main distroseries page after a successful edit. |
485 | @@ -375,7 +375,7 @@ |
486 | self.next_url = canonical_url(self.context) |
487 | |
488 | |
489 | -class DistroSeriesAdminView(LaunchpadEditFormView, DistroSeriesStatusMixin): |
490 | +class DistroSeriesAdminView(LaunchpadEditFormView, SeriesStatusMixin): |
491 | """View class for administering a DistroSeries object. |
492 | |
493 | It redirects to the main distroseries page after a successful edit. |
494 | |
495 | === modified file 'lib/lp/registry/browser/product.py' |
496 | --- lib/lp/registry/browser/product.py 2009-12-11 19:54:04 +0000 |
497 | +++ lib/lp/registry/browser/product.py 2010-01-05 16:22:16 +0000 |
498 | @@ -66,7 +66,7 @@ |
499 | ILaunchBag, NotFoundError, UnsafeFormGetSubmissionError) |
500 | from lp.registry.interfaces.pillar import IPillarNameSet |
501 | from lp.registry.interfaces.product import IProductReviewSearch, License |
502 | -from lp.registry.interfaces.distroseries import DistroSeriesStatus |
503 | +from lp.registry.interfaces.series import SeriesStatus |
504 | from lp.registry.interfaces.product import ( |
505 | IProduct, IProductSet, LicenseStatus) |
506 | from lp.registry.interfaces.productrelease import ( |
507 | @@ -540,7 +540,7 @@ |
508 | # Callback for the filter which only allows series that have not been |
509 | # marked obsolete. |
510 | def check_active(series): |
511 | - return series.status != DistroSeriesStatus.OBSOLETE |
512 | + return series.status != SeriesStatus.OBSOLETE |
513 | return self._sorted_filtered_list(check_active) |
514 | |
515 | |
516 | @@ -618,7 +618,7 @@ |
517 | """The highlighted, unhighlighted, or dimmed CSS class.""" |
518 | if self.is_development_focus: |
519 | return 'highlighted' |
520 | - elif self.status == DistroSeriesStatus.OBSOLETE: |
521 | + elif self.status == SeriesStatus.OBSOLETE: |
522 | return 'dimmed' |
523 | else: |
524 | return 'unhighlighted' |
525 | |
526 | === modified file 'lib/lp/registry/browser/productseries.py' |
527 | --- lib/lp/registry/browser/productseries.py 2009-12-05 18:37:28 +0000 |
528 | +++ lib/lp/registry/browser/productseries.py 2010-01-05 16:22:16 +0000 |
529 | @@ -75,7 +75,7 @@ |
530 | from lp.registry.browser import ( |
531 | MilestoneOverlayMixin, RegistryDeleteViewMixin) |
532 | from lp.registry.browser.packaging import PackagingAddView |
533 | -from lp.registry.interfaces.distroseries import DistroSeriesStatus |
534 | +from lp.registry.interfaces.series import SeriesStatus |
535 | from lp.registry.interfaces.productseries import IProductSeries |
536 | |
537 | |
538 | @@ -329,7 +329,7 @@ |
539 | them for obsolete series can be a problem if many series are being |
540 | displayed. |
541 | """ |
542 | - return self.context.status == DistroSeriesStatus.OBSOLETE |
543 | + return self.context.status == SeriesStatus.OBSOLETE |
544 | |
545 | @cachedproperty |
546 | def bugtask_status_counts(self): |
547 | |
548 | === modified file 'lib/lp/registry/browser/tests/browser-views.txt' |
549 | --- lib/lp/registry/browser/tests/browser-views.txt 2009-09-10 22:09:44 +0000 |
550 | +++ lib/lp/registry/browser/tests/browser-views.txt 2010-01-05 16:22:16 +0000 |
551 | @@ -35,7 +35,7 @@ |
552 | attribute has the required attribute to sort. |
553 | |
554 | >>> from lp.registry.browser import get_status_counts |
555 | - >>> from lp.registry.interfaces.distroseries import DistroSeriesStatus |
556 | + >>> from lp.registry.interfaces.series import SeriesStatus |
557 | |
558 | >>> class Concept: |
559 | ... def __init__(self, status, person): |
560 | @@ -48,9 +48,9 @@ |
561 | >>> a_person = factory.makePerson(name='andy', displayname="Andy") |
562 | >>> b_person = factory.makePerson(name='bob', displayname="Bob") |
563 | |
564 | - >>> concept_1 = Concept(DistroSeriesStatus.EXPERIMENTAL, a_person) |
565 | - >>> artefact_2 = Artefact(DistroSeriesStatus.EXPERIMENTAL, b_person) |
566 | - >>> artefact_3 = Artefact(DistroSeriesStatus.CURRENT, b_person) |
567 | + >>> concept_1 = Concept(SeriesStatus.EXPERIMENTAL, a_person) |
568 | + >>> artefact_2 = Artefact(SeriesStatus.EXPERIMENTAL, b_person) |
569 | + >>> artefact_3 = Artefact(SeriesStatus.CURRENT, b_person) |
570 | |
571 | The common example is for counting the status enums for an object. The default |
572 | rule is to sort on the 'sortkey' attribute of the object being counted. |
573 | |
574 | === modified file 'lib/lp/registry/browser/tests/distributionsourcepackage-views.txt' |
575 | --- lib/lp/registry/browser/tests/distributionsourcepackage-views.txt 2009-11-10 21:33:20 +0000 |
576 | +++ lib/lp/registry/browser/tests/distributionsourcepackage-views.txt 2010-01-05 16:22:16 +0000 |
577 | @@ -10,8 +10,8 @@ |
578 | >>> publisher = SoyuzTestPublisher() |
579 | >>> publisher.prepareBreezyAutotest() |
580 | >>> ubuntutest = publisher.ubuntutest |
581 | - >>> from lp.registry.interfaces.distroseries import DistroSeriesStatus |
582 | - >>> publisher.distroseries.status = DistroSeriesStatus.DEVELOPMENT |
583 | + >>> from lp.registry.interfaces.series import SeriesStatus |
584 | + >>> publisher.distroseries.status = SeriesStatus.DEVELOPMENT |
585 | |
586 | # Publish the source 'gedit' in the ubuntutest main archive. |
587 | >>> from datetime import datetime |
588 | |
589 | === modified file 'lib/lp/registry/browser/tests/packaging-views.txt' |
590 | --- lib/lp/registry/browser/tests/packaging-views.txt 2009-12-10 20:03:11 +0000 |
591 | +++ lib/lp/registry/browser/tests/packaging-views.txt 2010-01-05 16:22:16 +0000 |
592 | @@ -206,12 +206,12 @@ |
593 | When the current Ubuntu series changes, the sourcepackagename is not known, |
594 | and a new entry can be added to the packaging history. |
595 | |
596 | - >>> from lp.registry.interfaces.distroseries import DistroSeriesStatus |
597 | + >>> from lp.registry.interfaces.series import SeriesStatus |
598 | |
599 | >>> login('admin@canonical.com') |
600 | - >>> hoary.status = DistroSeriesStatus.CURRENT |
601 | + >>> hoary.status = SeriesStatus.CURRENT |
602 | >>> grumpy_series = ubuntu.getSeries('grumpy') |
603 | - >>> grumpy_series.status = DistroSeriesStatus.FROZEN |
604 | + >>> grumpy_series.status = SeriesStatus.FROZEN |
605 | |
606 | >>> a_user = factory.makePerson(name="hedgehog") |
607 | >>> login_person(a_user) |
608 | |
609 | === modified file 'lib/lp/registry/browser/tests/productseries-views.txt' |
610 | --- lib/lp/registry/browser/tests/productseries-views.txt 2009-12-05 02:53:07 +0000 |
611 | +++ lib/lp/registry/browser/tests/productseries-views.txt 2010-01-05 16:22:16 +0000 |
612 | @@ -81,14 +81,14 @@ |
613 | has an is_obsolete property that templates can check when choosing the content |
614 | to display. |
615 | |
616 | - >>> from lp.registry.interfaces.distroseries import DistroSeriesStatus |
617 | + >>> from lp.registry.interfaces.series import SeriesStatus |
618 | |
619 | >>> print series.status |
620 | Active Development |
621 | >>> view.is_obsolete |
622 | False |
623 | |
624 | - >>> series.status = DistroSeriesStatus.OBSOLETE |
625 | + >>> series.status = SeriesStatus.OBSOLETE |
626 | >>> view = create_view(series, '+index') |
627 | >>> view.is_obsolete |
628 | True |
629 | |
630 | === modified file 'lib/lp/registry/doc/distroseries.txt' |
631 | --- lib/lp/registry/doc/distroseries.txt 2009-12-10 20:28:03 +0000 |
632 | +++ lib/lp/registry/doc/distroseries.txt 2010-01-05 16:22:16 +0000 |
633 | @@ -170,7 +170,7 @@ |
634 | >>> hoary = ubuntu['hoary'] |
635 | |
636 | >>> from lp.registry.interfaces.pocket import PackagePublishingPocket |
637 | - >>> from canonical.launchpad.interfaces import DistroSeriesStatus |
638 | + >>> from canonical.launchpad.interfaces import SeriesStatus |
639 | |
640 | >>> warty.status.name |
641 | 'CURRENT' |
642 | @@ -190,7 +190,7 @@ |
643 | the upload will have to wait for manual approval anyway: |
644 | |
645 | >>> from zope.security.proxy import removeSecurityProxy |
646 | - >>> removeSecurityProxy(hoary).status = DistroSeriesStatus.FROZEN |
647 | + >>> removeSecurityProxy(hoary).status = SeriesStatus.FROZEN |
648 | |
649 | >>> hoary.status.name |
650 | 'FROZEN' |
651 | @@ -430,35 +430,35 @@ |
652 | |
653 | Exactly what message is displayed depends on the series' status. |
654 | |
655 | - >>> untranslatable_series.status = DistroSeriesStatus.EXPERIMENTAL |
656 | - >>> print get_visibility_notice(untranslatable_series) |
657 | - Translations for this release series are not available yet. |
658 | - |
659 | - >>> untranslatable_series.status = DistroSeriesStatus.DEVELOPMENT |
660 | - >>> print get_visibility_notice(untranslatable_series) |
661 | - Translations for this release series are not available yet. |
662 | - |
663 | - >>> untranslatable_series.status = DistroSeriesStatus.FROZEN |
664 | - >>> print get_visibility_notice(untranslatable_series) |
665 | - Translations for this release series are not currently available. |
666 | - Please come back soon. |
667 | - |
668 | - >>> untranslatable_series.status = DistroSeriesStatus.CURRENT |
669 | - >>> print get_visibility_notice(untranslatable_series) |
670 | - Translations for this release series are not currently available. |
671 | - Please come back soon. |
672 | - |
673 | - >>> untranslatable_series.status = DistroSeriesStatus.SUPPORTED |
674 | - >>> print get_visibility_notice(untranslatable_series) |
675 | - Translations for this release series are not currently available. |
676 | - Please come back soon. |
677 | - |
678 | - >>> untranslatable_series.status = DistroSeriesStatus.OBSOLETE |
679 | + >>> untranslatable_series.status = SeriesStatus.EXPERIMENTAL |
680 | + >>> print get_visibility_notice(untranslatable_series) |
681 | + Translations for this release series are not available yet. |
682 | + |
683 | + >>> untranslatable_series.status = SeriesStatus.DEVELOPMENT |
684 | + >>> print get_visibility_notice(untranslatable_series) |
685 | + Translations for this release series are not available yet. |
686 | + |
687 | + >>> untranslatable_series.status = SeriesStatus.FROZEN |
688 | + >>> print get_visibility_notice(untranslatable_series) |
689 | + Translations for this release series are not currently available. |
690 | + Please come back soon. |
691 | + |
692 | + >>> untranslatable_series.status = SeriesStatus.CURRENT |
693 | + >>> print get_visibility_notice(untranslatable_series) |
694 | + Translations for this release series are not currently available. |
695 | + Please come back soon. |
696 | + |
697 | + >>> untranslatable_series.status = SeriesStatus.SUPPORTED |
698 | + >>> print get_visibility_notice(untranslatable_series) |
699 | + Translations for this release series are not currently available. |
700 | + Please come back soon. |
701 | + |
702 | + >>> untranslatable_series.status = SeriesStatus.OBSOLETE |
703 | >>> print get_visibility_notice(untranslatable_series) |
704 | This release series is obsolete. Its translations are no longer |
705 | available. |
706 | |
707 | - >>> untranslatable_series.status = DistroSeriesStatus.FUTURE |
708 | + >>> untranslatable_series.status = SeriesStatus.FUTURE |
709 | >>> print get_visibility_notice(untranslatable_series) |
710 | Translations for this release series are not available yet. |
711 | |
712 | |
713 | === modified file 'lib/lp/registry/doc/product.txt' |
714 | --- lib/lp/registry/doc/product.txt 2009-10-26 18:40:04 +0000 |
715 | +++ lib/lp/registry/doc/product.txt 2010-01-05 16:22:16 +0000 |
716 | @@ -636,11 +636,10 @@ |
717 | Once the 1.0 series is made obsolete, it no longer shows up in the set of |
718 | sorted active series. |
719 | |
720 | - >>> from lp.registry.interfaces.distroseries import ( |
721 | - ... DistroSeriesStatus) |
722 | + >>> from lp.registry.interfaces.series import SeriesStatus |
723 | >>> sorted_series = firefox_view.sorted_active_series_list |
724 | >>> last_series = firefox.getSeries(sorted_series[-1].name) |
725 | - >>> last_series.status = DistroSeriesStatus.OBSOLETE |
726 | + >>> last_series.status = SeriesStatus.OBSOLETE |
727 | >>> firefox_view = create_initialized_view(firefox, '+index') |
728 | >>> for series in firefox_view.sorted_active_series_list: |
729 | ... print series.name |
730 | @@ -649,7 +648,7 @@ |
731 | It is possible for the development series to be obsolete, and in that case, it |
732 | still shows up in the list. |
733 | |
734 | - >>> firefox.development_focus.status = DistroSeriesStatus.OBSOLETE |
735 | + >>> firefox.development_focus.status = SeriesStatus.OBSOLETE |
736 | >>> firefox_view = create_initialized_view(firefox, '+index') |
737 | >>> for series in firefox_view.sorted_active_series_list: |
738 | ... print series.name |
739 | |
740 | === modified file 'lib/lp/registry/interfaces/distroseries.py' |
741 | --- lib/lp/registry/interfaces/distroseries.py 2009-12-14 13:49:03 +0000 |
742 | +++ lib/lp/registry/interfaces/distroseries.py 2010-01-05 16:22:16 +0000 |
743 | @@ -8,7 +8,6 @@ |
744 | __metaclass__ = type |
745 | |
746 | __all__ = [ |
747 | - 'DistroSeriesStatus', |
748 | 'IDistroSeries', |
749 | 'IDistroSeriesEditRestricted', |
750 | 'IDistroSeriesPublic', |
751 | @@ -20,11 +19,12 @@ |
752 | from zope.schema import Bool, Datetime, Choice, Object, TextLine |
753 | from zope.interface import Interface, Attribute |
754 | |
755 | -from lazr.enum import DBEnumeratedType, DBItem |
756 | +from lazr.enum import DBEnumeratedType |
757 | |
758 | from canonical.launchpad.fields import ( |
759 | ContentNameField, Description, PublicPersonChoice, Summary, Title, |
760 | UniqueField) |
761 | +from lp.registry.interfaces.series import SeriesStatus |
762 | from lp.registry.interfaces.structuralsubscription import ( |
763 | IStructuralSubscriptionTarget) |
764 | from lp.bugs.interfaces.bugtarget import IBugTarget, IHasBugs |
765 | @@ -54,73 +54,6 @@ |
766 | operation_returns_collection_of, operation_returns_entry, |
767 | rename_parameters_as, webservice_error) |
768 | |
769 | - |
770 | -# XXX: salgado, 2008-06-02: We should use a more generic name here as this |
771 | -# enum is used in ProductSeries.status as well. |
772 | -class DistroSeriesStatus(DBEnumeratedType): |
773 | - """Distro/Product Series Status |
774 | - |
775 | - A Distro or Product series (warty, hoary, 1.4 for example) changes state |
776 | - throughout its development. This schema describes the level of |
777 | - development of the series. |
778 | - """ |
779 | - |
780 | - EXPERIMENTAL = DBItem(1, """ |
781 | - Experimental |
782 | - |
783 | - This series contains code that is far from active release planning or |
784 | - management. |
785 | - |
786 | - In the case of Ubuntu, series that are beyond the current |
787 | - "development" release will be marked as "experimental". We create |
788 | - those so that people have a place to upload code which is expected to |
789 | - be part of that distant future release, but which we do not want to |
790 | - interfere with the current development release. |
791 | - """) |
792 | - |
793 | - DEVELOPMENT = DBItem(2, """ |
794 | - Active Development |
795 | - |
796 | - The series that is under active development. |
797 | - """) |
798 | - |
799 | - FROZEN = DBItem(3, """ |
800 | - Pre-release Freeze |
801 | - |
802 | - When a series is near to release the administrators will freeze it, |
803 | - which typically means all changes require significant review before |
804 | - being accepted. |
805 | - """) |
806 | - |
807 | - CURRENT = DBItem(4, """ |
808 | - Current Stable Release |
809 | - |
810 | - This is the latest stable release. Normally there will only |
811 | - be one of these for a given distribution. |
812 | - """) |
813 | - |
814 | - SUPPORTED = DBItem(5, """ |
815 | - Supported |
816 | - |
817 | - This series is still supported, but it is no longer the current stable |
818 | - release. |
819 | - """) |
820 | - |
821 | - OBSOLETE = DBItem(6, """ |
822 | - Obsolete |
823 | - |
824 | - This series is no longer supported, it is considered obsolete and |
825 | - should not be used on production systems. |
826 | - """) |
827 | - |
828 | - FUTURE = DBItem(7, """ |
829 | - Future |
830 | - |
831 | - This is a future series of this product/distro in which the developers |
832 | - haven't started working yet. |
833 | - """) |
834 | - |
835 | - |
836 | class DistroSeriesNameField(ContentNameField): |
837 | """A class to ensure `IDistroSeries` has unique names.""" |
838 | errormessage = _("%s is already in use by another series.") |
839 | @@ -273,7 +206,7 @@ |
840 | status = exported( |
841 | Choice( |
842 | title=_("Status"), required=True, |
843 | - vocabulary=DistroSeriesStatus)) |
844 | + vocabulary=SeriesStatus)) |
845 | datereleased = exported( |
846 | Datetime(title=_("Date released"))) |
847 | parent_series = exported( |
848 | |
849 | === modified file 'lib/lp/registry/interfaces/productseries.py' |
850 | --- lib/lp/registry/interfaces/productseries.py 2009-12-05 18:37:28 +0000 |
851 | +++ lib/lp/registry/interfaces/productseries.py 2010-01-05 16:22:16 +0000 |
852 | @@ -25,7 +25,7 @@ |
853 | IStructuralSubscriptionTarget) |
854 | from lp.code.interfaces.branch import IBranch |
855 | from lp.bugs.interfaces.bugtarget import IBugTarget |
856 | -from lp.registry.interfaces.distroseries import DistroSeriesStatus |
857 | +from lp.registry.interfaces.series import SeriesStatus |
858 | from canonical.launchpad.interfaces.launchpad import ( |
859 | IHasAppointedDriver, IHasDrivers) |
860 | from lp.registry.interfaces.role import IHasOwner |
861 | @@ -106,8 +106,8 @@ |
862 | |
863 | status = exported( |
864 | Choice( |
865 | - title=_('Status'), required=True, vocabulary=DistroSeriesStatus, |
866 | - default=DistroSeriesStatus.DEVELOPMENT)) |
867 | + title=_('Status'), required=True, vocabulary=SeriesStatus, |
868 | + default=SeriesStatus.DEVELOPMENT)) |
869 | |
870 | parent = Attribute('The structural parent of this series - the product') |
871 | |
872 | |
873 | === added file 'lib/lp/registry/interfaces/series.py' |
874 | --- lib/lp/registry/interfaces/series.py 1970-01-01 00:00:00 +0000 |
875 | +++ lib/lp/registry/interfaces/series.py 2010-01-05 16:22:16 +0000 |
876 | @@ -0,0 +1,78 @@ |
877 | +# Copyright 2009 Canonical Ltd. This software is licensed under the |
878 | +# GNU Affero General Public License version 3 (see the file LICENSE). |
879 | + |
880 | +# pylint: disable-msg=E0211,E0213 |
881 | + |
882 | +"""Interfaces including common IDistroSeries and IProductSeries classes.""" |
883 | + |
884 | +__metaclass__ = type |
885 | + |
886 | +__all__ = [ |
887 | + 'SeriesStatus' |
888 | + ] |
889 | + |
890 | +from lazr.enum import DBEnumeratedType, DBItem |
891 | + |
892 | +class SeriesStatus(DBEnumeratedType): |
893 | + """Distro/Product Series Status |
894 | + |
895 | + A Distro or Product series (warty, hoary, 1.4 for example) changes state |
896 | + throughout its development. This schema describes the level of |
897 | + development of the series. |
898 | + """ |
899 | + |
900 | + EXPERIMENTAL = DBItem(1, """ |
901 | + Experimental |
902 | + |
903 | + This series contains code that is far from active release planning or |
904 | + management. |
905 | + |
906 | + In the case of Ubuntu, series that are beyond the current |
907 | + "development" release will be marked as "experimental". We create |
908 | + those so that people have a place to upload code which is expected to |
909 | + be part of that distant future release, but which we do not want to |
910 | + interfere with the current development release. |
911 | + """) |
912 | + |
913 | + DEVELOPMENT = DBItem(2, """ |
914 | + Active Development |
915 | + |
916 | + The series that is under active development. |
917 | + """) |
918 | + |
919 | + FROZEN = DBItem(3, """ |
920 | + Pre-release Freeze |
921 | + |
922 | + When a series is near to release the administrators will freeze it, |
923 | + which typically means all changes require significant review before |
924 | + being accepted. |
925 | + """) |
926 | + |
927 | + CURRENT = DBItem(4, """ |
928 | + Current Stable Release |
929 | + |
930 | + This is the latest stable release. Normally there will only |
931 | + be one of these for a given distribution. |
932 | + """) |
933 | + |
934 | + SUPPORTED = DBItem(5, """ |
935 | + Supported |
936 | + |
937 | + This series is still supported, but it is no longer the current stable |
938 | + release. |
939 | + """) |
940 | + |
941 | + OBSOLETE = DBItem(6, """ |
942 | + Obsolete |
943 | + |
944 | + This series is no longer supported, it is considered obsolete and |
945 | + should not be used on production systems. |
946 | + """) |
947 | + |
948 | + FUTURE = DBItem(7, """ |
949 | + Future |
950 | + |
951 | + This is a future series of this product/distro in which the developers |
952 | + haven't started working yet. |
953 | + """) |
954 | + |
955 | |
956 | === modified file 'lib/lp/registry/model/distribution.py' |
957 | --- lib/lp/registry/model/distribution.py 2009-12-09 14:55:02 +0000 |
958 | +++ lib/lp/registry/model/distribution.py 2010-01-05 16:22:16 +0000 |
959 | @@ -84,8 +84,8 @@ |
960 | IDistributionSet) |
961 | from lp.registry.interfaces.distributionmirror import ( |
962 | IDistributionMirror, MirrorContent, MirrorStatus) |
963 | -from lp.registry.interfaces.distroseries import ( |
964 | - DistroSeriesStatus, NoSuchDistroSeries) |
965 | +from lp.registry.interfaces.series import SeriesStatus |
966 | +from lp.registry.interfaces.distroseries import NoSuchDistroSeries |
967 | from canonical.launchpad.interfaces.launchpad import ( |
968 | IHasIcon, IHasLogo, IHasMugshot, ILaunchpadCelebrities, ILaunchpadUsage) |
969 | from lp.soyuz.interfaces.queue import PackageUploadStatus |
970 | @@ -394,8 +394,9 @@ |
971 | |
972 | def newMirror(self, owner, speed, country, content, displayname=None, |
973 | description=None, http_base_url=None, |
974 | - ftp_base_url=None, rsync_base_url=None, official_candidate=False, |
975 | - enabled=False, whiteboard=None): |
976 | + ftp_base_url=None, rsync_base_url=None, |
977 | + official_candidate=False, enabled=False, |
978 | + whiteboard=None): |
979 | """See `IDistribution`.""" |
980 | # NB this functionality is only available to distributions that have |
981 | # the full functionality of Launchpad enabled. This is Ubuntu and |
982 | @@ -450,15 +451,15 @@ |
983 | |
984 | # If we have a frozen one, return that. |
985 | for series in self.series: |
986 | - if series.status == DistroSeriesStatus.FROZEN: |
987 | + if series.status == SeriesStatus.FROZEN: |
988 | return series |
989 | # If we have one in development, return that. |
990 | for series in self.series: |
991 | - if series.status == DistroSeriesStatus.DEVELOPMENT: |
992 | + if series.status == SeriesStatus.DEVELOPMENT: |
993 | return series |
994 | # If we have a stable one, return that. |
995 | for series in self.series: |
996 | - if series.status == DistroSeriesStatus.CURRENT: |
997 | + if series.status == SeriesStatus.CURRENT: |
998 | return series |
999 | # If we have ANY, return the first one. |
1000 | if len(self.series) > 0: |
1001 | @@ -509,7 +510,7 @@ |
1002 | """See `IDistribution`.""" |
1003 | return DistroSeries.selectBy( |
1004 | distribution=self, |
1005 | - status=DistroSeriesStatus.DEVELOPMENT) |
1006 | + status=SeriesStatus.DEVELOPMENT) |
1007 | |
1008 | def getMilestone(self, name): |
1009 | """See `IDistribution`.""" |
1010 | @@ -1002,7 +1003,7 @@ |
1011 | # we're searching for. |
1012 | return ( |
1013 | DistroSeries.distribution == self, |
1014 | - DistroSeries.status != DistroSeriesStatus.OBSOLETE, |
1015 | + DistroSeries.status != SeriesStatus.OBSOLETE, |
1016 | BinaryPackageRelease.binarypackagename == BinaryPackageName.id, |
1017 | DistroArchSeries.distroseries == DistroSeries.id, |
1018 | Build.distroarchseries == DistroArchSeries.id, |
1019 | @@ -1482,7 +1483,7 @@ |
1020 | summary=summary, |
1021 | description=description, |
1022 | version=version, |
1023 | - status=DistroSeriesStatus.EXPERIMENTAL, |
1024 | + status=SeriesStatus.EXPERIMENTAL, |
1025 | parent_series=parent_series, |
1026 | owner=owner) |
1027 | if owner.inTeam(self.driver) and not owner.inTeam(self.owner): |
1028 | |
1029 | === modified file 'lib/lp/registry/model/distroseries.py' |
1030 | --- lib/lp/registry/model/distroseries.py 2009-12-22 17:41:46 +0000 |
1031 | +++ lib/lp/registry/model/distroseries.py 2010-01-05 16:22:16 +0000 |
1032 | @@ -95,8 +95,9 @@ |
1033 | from lp.soyuz.interfaces.buildrecords import IHasBuildRecords |
1034 | from lp.soyuz.interfaces.binarypackagename import ( |
1035 | IBinaryPackageName) |
1036 | +from lp.registry.interfaces.series import SeriesStatus |
1037 | from lp.registry.interfaces.distroseries import ( |
1038 | - DistroSeriesStatus, IDistroSeries, IDistroSeriesSet, ISeriesMixin) |
1039 | + IDistroSeries, IDistroSeriesSet, ISeriesMixin) |
1040 | from lp.translations.interfaces.languagepack import LanguagePackType |
1041 | from canonical.launchpad.interfaces.librarian import ILibraryFileAliasSet |
1042 | from lp.soyuz.interfaces.queue import PackageUploadStatus |
1043 | @@ -129,10 +130,10 @@ |
1044 | @property |
1045 | def active(self): |
1046 | return self.status in [ |
1047 | - DistroSeriesStatus.DEVELOPMENT, |
1048 | - DistroSeriesStatus.FROZEN, |
1049 | - DistroSeriesStatus.CURRENT, |
1050 | - DistroSeriesStatus.SUPPORTED |
1051 | + SeriesStatus.DEVELOPMENT, |
1052 | + SeriesStatus.FROZEN, |
1053 | + SeriesStatus.CURRENT, |
1054 | + SeriesStatus.SUPPORTED |
1055 | ] |
1056 | |
1057 | |
1058 | @@ -157,7 +158,7 @@ |
1059 | description = StringCol(notNull=True) |
1060 | version = StringCol(notNull=True) |
1061 | status = EnumCol( |
1062 | - dbName='releasestatus', notNull=True, schema=DistroSeriesStatus) |
1063 | + dbName='releasestatus', notNull=True, schema=SeriesStatus) |
1064 | date_created = UtcDateTimeCol(notNull=False, default=UTC_NOW) |
1065 | datereleased = UtcDateTimeCol(notNull=False, default=None) |
1066 | parent_series = ForeignKey( |
1067 | @@ -332,8 +333,8 @@ |
1068 | @property |
1069 | def supported(self): |
1070 | return self.status in [ |
1071 | - DistroSeriesStatus.CURRENT, |
1072 | - DistroSeriesStatus.SUPPORTED |
1073 | + SeriesStatus.CURRENT, |
1074 | + SeriesStatus.SUPPORTED |
1075 | ] |
1076 | |
1077 | @property |
1078 | @@ -377,12 +378,12 @@ |
1079 | def canUploadToPocket(self, pocket): |
1080 | """See `IDistroSeries`.""" |
1081 | # Allow everything for distroseries in FROZEN state. |
1082 | - if self.status == DistroSeriesStatus.FROZEN: |
1083 | + if self.status == SeriesStatus.FROZEN: |
1084 | return True |
1085 | |
1086 | # Define stable/released states. |
1087 | - stable_states = (DistroSeriesStatus.SUPPORTED, |
1088 | - DistroSeriesStatus.CURRENT) |
1089 | + stable_states = (SeriesStatus.SUPPORTED, |
1090 | + SeriesStatus.CURRENT) |
1091 | |
1092 | # Deny uploads for RELEASE pocket in stable states. |
1093 | if (pocket == PackagePublishingPocket.RELEASE and |
1094 | @@ -727,14 +728,14 @@ |
1095 | return |
1096 | |
1097 | future = [ |
1098 | - DistroSeriesStatus.EXPERIMENTAL, |
1099 | - DistroSeriesStatus.DEVELOPMENT, |
1100 | - DistroSeriesStatus.FUTURE, |
1101 | + SeriesStatus.EXPERIMENTAL, |
1102 | + SeriesStatus.DEVELOPMENT, |
1103 | + SeriesStatus.FUTURE, |
1104 | ] |
1105 | if self.status in future: |
1106 | raise TranslationUnavailable( |
1107 | "Translations for this release series are not available yet.") |
1108 | - elif self.status == DistroSeriesStatus.OBSOLETE: |
1109 | + elif self.status == SeriesStatus.OBSOLETE: |
1110 | raise TranslationUnavailable( |
1111 | "This release series is obsolete. Its translations are no " |
1112 | "longer available.") |
1113 | @@ -830,9 +831,9 @@ |
1114 | def isUnstable(self): |
1115 | """See `IDistroSeries`.""" |
1116 | return self.status in [ |
1117 | - DistroSeriesStatus.FROZEN, |
1118 | - DistroSeriesStatus.DEVELOPMENT, |
1119 | - DistroSeriesStatus.EXPERIMENTAL, |
1120 | + SeriesStatus.FROZEN, |
1121 | + SeriesStatus.DEVELOPMENT, |
1122 | + SeriesStatus.EXPERIMENTAL, |
1123 | ] |
1124 | |
1125 | def getAllPublishedSources(self): |
1126 | @@ -1734,7 +1735,7 @@ |
1127 | return True |
1128 | |
1129 | # FROZEN state also allow all pockets to be published. |
1130 | - if self.status == DistroSeriesStatus.FROZEN: |
1131 | + if self.status == SeriesStatus.FROZEN: |
1132 | return True |
1133 | |
1134 | # If we're not republishing, we want to make sure that |
1135 | @@ -1875,14 +1876,14 @@ |
1136 | if isreleased: |
1137 | # The query is filtered on released releases. |
1138 | where_clause += "releasestatus in (%s, %s)" % sqlvalues( |
1139 | - DistroSeriesStatus.CURRENT, |
1140 | - DistroSeriesStatus.SUPPORTED) |
1141 | + SeriesStatus.CURRENT, |
1142 | + SeriesStatus.SUPPORTED) |
1143 | else: |
1144 | # The query is filtered on unreleased releases. |
1145 | where_clause += "releasestatus in (%s, %s, %s)" % sqlvalues( |
1146 | - DistroSeriesStatus.EXPERIMENTAL, |
1147 | - DistroSeriesStatus.DEVELOPMENT, |
1148 | - DistroSeriesStatus.FROZEN) |
1149 | + SeriesStatus.EXPERIMENTAL, |
1150 | + SeriesStatus.DEVELOPMENT, |
1151 | + SeriesStatus.FROZEN) |
1152 | if orderBy is not None: |
1153 | return DistroSeries.select(where_clause, orderBy=orderBy) |
1154 | else: |
1155 | |
1156 | === modified file 'lib/lp/registry/model/productseries.py' |
1157 | --- lib/lp/registry/model/productseries.py 2009-12-05 18:37:28 +0000 |
1158 | +++ lib/lp/registry/model/productseries.py 2010-01-05 16:22:16 +0000 |
1159 | @@ -50,7 +50,7 @@ |
1160 | from lp.registry.model.structuralsubscription import ( |
1161 | StructuralSubscriptionTargetMixin) |
1162 | from canonical.launchpad.helpers import shortlist |
1163 | -from lp.registry.interfaces.distroseries import DistroSeriesStatus |
1164 | +from lp.registry.interfaces.series import SeriesStatus |
1165 | from lp.registry.model.distroseries import SeriesMixin |
1166 | from canonical.launchpad.interfaces.launchpad import ILaunchpadCelebrities |
1167 | from lp.registry.interfaces.packaging import PackagingType |
1168 | @@ -89,8 +89,8 @@ |
1169 | |
1170 | product = ForeignKey(dbName='product', foreignKey='Product', notNull=True) |
1171 | status = EnumCol( |
1172 | - notNull=True, schema=DistroSeriesStatus, |
1173 | - default=DistroSeriesStatus.DEVELOPMENT) |
1174 | + notNull=True, schema=SeriesStatus, |
1175 | + default=SeriesStatus.DEVELOPMENT) |
1176 | name = StringCol(notNull=True) |
1177 | summary = StringCol(notNull=True) |
1178 | datecreated = UtcDateTimeCol(notNull=True, default=UTC_NOW) |
1179 | |
1180 | === modified file 'lib/lp/registry/stories/distribution/xx-distribution-packages.txt' |
1181 | --- lib/lp/registry/stories/distribution/xx-distribution-packages.txt 2009-11-18 02:58:23 +0000 |
1182 | +++ lib/lp/registry/stories/distribution/xx-distribution-packages.txt 2010-01-05 16:22:16 +0000 |
1183 | @@ -124,9 +124,9 @@ |
1184 | >>> publisher = SoyuzTestPublisher() |
1185 | >>> publisher.prepareBreezyAutotest() |
1186 | >>> ubuntutest = publisher.ubuntutest |
1187 | - >>> from lp.registry.interfaces.distroseries import DistroSeriesStatus |
1188 | - >>> ubuntutest['breezy-autotest'].status = DistroSeriesStatus.DEVELOPMENT |
1189 | - >>> ubuntutest['hoary-test'].status = DistroSeriesStatus.DEVELOPMENT |
1190 | + >>> from lp.registry.interfaces.series import SeriesStatus |
1191 | + >>> ubuntutest['breezy-autotest'].status = SeriesStatus.DEVELOPMENT |
1192 | + >>> ubuntutest['hoary-test'].status = SeriesStatus.DEVELOPMENT |
1193 | |
1194 | # Publish the source 'netapplet' in the breezy-autotest and |
1195 | # main archive. |
1196 | |
1197 | === modified file 'lib/lp/registry/stories/productseries/xx-productseries-series.txt' |
1198 | --- lib/lp/registry/stories/productseries/xx-productseries-series.txt 2009-09-18 15:24:30 +0000 |
1199 | +++ lib/lp/registry/stories/productseries/xx-productseries-series.txt 2010-01-05 16:22:16 +0000 |
1200 | @@ -4,14 +4,14 @@ |
1201 | # There are no obsolete series in the data, create one. |
1202 | >>> from zope.component import getUtility |
1203 | >>> from lp.registry.interfaces.product import IProductSet |
1204 | - >>> from lp.registry.interfaces.distroseries import DistroSeriesStatus |
1205 | + >>> from lp.registry.interfaces.series import SeriesStatus |
1206 | |
1207 | >>> login('test@canonical.com') |
1208 | >>> productset = getUtility(IProductSet) |
1209 | >>> firefox = productset.getByName('firefox') |
1210 | >>> series = factory.makeProductSeries( |
1211 | ... name='xxx', product=firefox, summary='Use true GTK UI.') |
1212 | - >>> series.status = DistroSeriesStatus.OBSOLETE |
1213 | + >>> series.status = SeriesStatus.OBSOLETE |
1214 | >>> transaction.commit() |
1215 | >>> logout() |
1216 | |
1217 | |
1218 | === modified file 'lib/lp/registry/tests/test_distribution.py' |
1219 | --- lib/lp/registry/tests/test_distribution.py 2009-11-07 22:19:06 +0000 |
1220 | +++ lib/lp/registry/tests/test_distribution.py 2010-01-05 16:22:16 +0000 |
1221 | @@ -13,7 +13,7 @@ |
1222 | TestDistroSeriesCurrentSourceReleases) |
1223 | from lp.soyuz.interfaces.distributionsourcepackagerelease import ( |
1224 | IDistributionSourcePackageRelease) |
1225 | -from lp.registry.interfaces.distroseries import DistroSeriesStatus |
1226 | +from lp.registry.interfaces.series import SeriesStatus |
1227 | |
1228 | |
1229 | class TestDistributionCurrentSourceReleases( |
1230 | @@ -36,7 +36,7 @@ |
1231 | # version numbers. We don't care whether the version is |
1232 | # published in a earlier or later series. |
1233 | self.current_series = self.factory.makeDistroRelease( |
1234 | - self.distribution, '1.0', status=DistroSeriesStatus.CURRENT) |
1235 | + self.distribution, '1.0', status=SeriesStatus.CURRENT) |
1236 | self.publisher.getPubSource( |
1237 | version='0.9', distroseries=self.current_series) |
1238 | self.publisher.getPubSource( |
1239 | |
1240 | === modified file 'lib/lp/registry/tests/test_sourcepackage.py' |
1241 | --- lib/lp/registry/tests/test_sourcepackage.py 2009-09-16 05:59:52 +0000 |
1242 | +++ lib/lp/registry/tests/test_sourcepackage.py 2010-01-05 16:22:16 +0000 |
1243 | @@ -13,7 +13,7 @@ |
1244 | |
1245 | from canonical.launchpad.ftests import login_person, logout |
1246 | from lp.registry.interfaces.distribution import NoPartnerArchive |
1247 | -from lp.registry.interfaces.distroseries import DistroSeriesStatus |
1248 | +from lp.registry.interfaces.series import SeriesStatus |
1249 | from canonical.launchpad.interfaces.launchpad import ILaunchpadCelebrities |
1250 | from lp.registry.interfaces.pocket import PackagePublishingPocket |
1251 | from lp.soyuz.interfaces.archive import ArchivePurpose |
1252 | @@ -145,9 +145,9 @@ |
1253 | # the source package. |
1254 | distribution = self.factory.makeDistribution() |
1255 | dev_series = self.factory.makeDistroRelease( |
1256 | - distribution=distribution, status=DistroSeriesStatus.DEVELOPMENT) |
1257 | + distribution=distribution, status=SeriesStatus.DEVELOPMENT) |
1258 | other_series = self.factory.makeDistroRelease( |
1259 | - distribution=distribution, status=DistroSeriesStatus.OBSOLETE) |
1260 | + distribution=distribution, status=SeriesStatus.OBSOLETE) |
1261 | self.assertEqual(dev_series, distribution.currentseries) |
1262 | dev_sourcepackage = self.factory.makeSourcePackage( |
1263 | distroseries=dev_series) |
1264 | |
1265 | === modified file 'lib/lp/soyuz/browser/archive.py' |
1266 | --- lib/lp/soyuz/browser/archive.py 2009-12-14 12:47:54 +0000 |
1267 | +++ lib/lp/soyuz/browser/archive.py 2010-01-05 16:22:16 +0000 |
1268 | @@ -66,7 +66,7 @@ |
1269 | BuildStatus, BuildSetStatus, IBuildSet) |
1270 | from lp.soyuz.interfaces.buildrecords import IHasBuildRecords |
1271 | from lp.soyuz.interfaces.component import IComponentSet |
1272 | -from lp.registry.interfaces.distroseries import DistroSeriesStatus |
1273 | +from lp.registry.interfaces.series import SeriesStatus |
1274 | from canonical.launchpad.interfaces.launchpad import ( |
1275 | ILaunchpadCelebrities, NotFoundError) |
1276 | from lp.soyuz.interfaces.packagecopyrequest import ( |
1277 | @@ -1190,7 +1190,7 @@ |
1278 | # it will be probably simpler to use the DistroSeries vocabulary |
1279 | # and validate the selected value before copying. |
1280 | for series in self.context.distribution.series: |
1281 | - if series.status == DistroSeriesStatus.OBSOLETE: |
1282 | + if series.status == SeriesStatus.OBSOLETE: |
1283 | continue |
1284 | terms.append( |
1285 | SimpleTerm(series, str(series.name), series.displayname)) |
1286 | |
1287 | === modified file 'lib/lp/soyuz/doc/build.txt' |
1288 | --- lib/lp/soyuz/doc/build.txt 2009-11-24 07:02:21 +0000 |
1289 | +++ lib/lp/soyuz/doc/build.txt 2010-01-05 16:22:16 +0000 |
1290 | @@ -261,12 +261,12 @@ |
1291 | We will reactivate ubuntu/warty allowing the pmount build to be |
1292 | retried. |
1293 | |
1294 | - >>> from canonical.launchpad.interfaces import DistroSeriesStatus |
1295 | + >>> from canonical.launchpad.interfaces import SeriesStatus |
1296 | >>> from lp.registry.interfaces.distribution import IDistributionSet |
1297 | >>> login('foo.bar@canonical.com') |
1298 | >>> ubuntu = getUtility(IDistributionSet)['ubuntu'] |
1299 | >>> warty = ubuntu.getSeries('warty') |
1300 | - >>> warty.status = DistroSeriesStatus.DEVELOPMENT |
1301 | + >>> warty.status = SeriesStatus.DEVELOPMENT |
1302 | >>> flush_database_updates() |
1303 | >>> login(ANONYMOUS) |
1304 | |
1305 | @@ -333,7 +333,7 @@ |
1306 | it won't interfere in the next tests. |
1307 | |
1308 | >>> login('foo.bar@canonical.com') |
1309 | - >>> warty.status = DistroSeriesStatus.SUPPORTED |
1310 | + >>> warty.status = SeriesStatus.SUPPORTED |
1311 | >>> flush_database_updates() |
1312 | >>> login(ANONYMOUS) |
1313 | |
1314 | |
1315 | === modified file 'lib/lp/soyuz/doc/buildd-slavescanner.txt' |
1316 | --- lib/lp/soyuz/doc/buildd-slavescanner.txt 2009-12-14 20:36:19 +0000 |
1317 | +++ lib/lp/soyuz/doc/buildd-slavescanner.txt 2010-01-05 16:22:16 +0000 |
1318 | @@ -1381,8 +1381,8 @@ |
1319 | Change the distroseries status for testing. FROZEN allows building in |
1320 | all pockets: |
1321 | |
1322 | - >>> from canonical.launchpad.interfaces import DistroSeriesStatus |
1323 | - >>> hoary_i386.distroseries.status = DistroSeriesStatus.FROZEN |
1324 | + >>> from canonical.launchpad.interfaces import SeriesStatus |
1325 | + >>> hoary_i386.distroseries.status = SeriesStatus.FROZEN |
1326 | |
1327 | Now we can start a build in other pockets, and see what archives are |
1328 | passed to the slave. |
1329 | |
1330 | === modified file 'lib/lp/soyuz/doc/nascentupload-announcements.txt' |
1331 | --- lib/lp/soyuz/doc/nascentupload-announcements.txt 2009-05-13 14:05:27 +0000 |
1332 | +++ lib/lp/soyuz/doc/nascentupload-announcements.txt 2010-01-05 16:22:16 +0000 |
1333 | @@ -58,11 +58,11 @@ |
1334 | address and allow uploads to universe: |
1335 | |
1336 | >>> from canonical.launchpad.interfaces import ( |
1337 | - ... DistroSeriesStatus, IComponentSet, IDistributionSet, |
1338 | + ... SeriesStatus, IComponentSet, IDistributionSet, |
1339 | ... ILibraryFileAliasSet) |
1340 | >>> ubuntu = getUtility(IDistributionSet)['ubuntu'] |
1341 | >>> hoary = ubuntu['hoary'] |
1342 | - >>> hoary.status = DistroSeriesStatus.DEVELOPMENT |
1343 | + >>> hoary.status = SeriesStatus.DEVELOPMENT |
1344 | >>> hoary.changeslist = "hoary-announce@lists.ubuntu.com" |
1345 | >>> from canonical.launchpad.database import ComponentSelection |
1346 | >>> universe = getUtility(IComponentSet)['universe'] |
1347 | @@ -393,7 +393,7 @@ |
1348 | |
1349 | Release hoary, enable uploads to post-release pockets: |
1350 | |
1351 | - >>> hoary.status = DistroSeriesStatus.CURRENT |
1352 | + >>> hoary.status = SeriesStatus.CURRENT |
1353 | |
1354 | UNAPPROVED source uploads for 'translations' section via insecure: |
1355 | |
1356 | @@ -730,7 +730,7 @@ |
1357 | Make hoary developmental again, as syncs only happen at that stage of a |
1358 | distroseries. |
1359 | |
1360 | - >>> hoary.status = DistroSeriesStatus.DEVELOPMENT |
1361 | + >>> hoary.status = SeriesStatus.DEVELOPMENT |
1362 | |
1363 | >>> bar_src = NascentUpload( |
1364 | ... datadir( |
1365 | @@ -779,7 +779,7 @@ |
1366 | |
1367 | Reset hoary back to released and remove disk files created during processing: |
1368 | |
1369 | - >>> hoary.status = DistroSeriesStatus.CURRENT |
1370 | + >>> hoary.status = SeriesStatus.CURRENT |
1371 | >>> os.remove(os.path.join(datadir('suite/bar_1.0-5_debian_auto_sync'), |
1372 | ... 'bar_1.0.orig.tar.gz')) |
1373 | >>> os.remove(os.path.join(datadir('suite/bar_1.0-6'), |
1374 | @@ -846,7 +846,7 @@ |
1375 | and binary known in hoary, then our operations in post-release |
1376 | pockets can work: |
1377 | |
1378 | - >>> hoary.status = DistroSeriesStatus.DEVELOPMENT |
1379 | + >>> hoary.status = SeriesStatus.DEVELOPMENT |
1380 | >>> modified_sync_policy = getPolicy( |
1381 | ... name='sync', distro='ubuntu', distroseries='hoary') |
1382 | >>> modified_sync_policy.can_upload_mixed = True |
1383 | @@ -859,7 +859,7 @@ |
1384 | >>> result = foo_v1.do_accept() |
1385 | >>> foo_v1.queue_root.setAccepted() |
1386 | >>> pub_records = foo_v1.queue_root.realiseUpload() |
1387 | - >>> hoary.status = DistroSeriesStatus.CURRENT |
1388 | + >>> hoary.status = SeriesStatus.CURRENT |
1389 | |
1390 | Get rid of any emails generated: |
1391 | |
1392 | @@ -975,7 +975,7 @@ |
1393 | permitted, but converted to ASCII, which is a limitation of the mailer. |
1394 | However, UTF-8 in the mail content is preserved. |
1395 | |
1396 | - >>> hoary.status = DistroSeriesStatus.DEVELOPMENT |
1397 | + >>> hoary.status = SeriesStatus.DEVELOPMENT |
1398 | >>> anything_policy = getPolicy( |
1399 | ... name='anything', distro='ubuntu', distroseries='hoary') |
1400 | >>> bar_upload = NascentUpload( |
1401 | |
1402 | === modified file 'lib/lp/soyuz/doc/nascentupload.txt' |
1403 | --- lib/lp/soyuz/doc/nascentupload.txt 2009-08-28 06:41:25 +0000 |
1404 | +++ lib/lp/soyuz/doc/nascentupload.txt 2010-01-05 16:22:16 +0000 |
1405 | @@ -18,11 +18,11 @@ |
1406 | "launchpad" to handle this. |
1407 | |
1408 | >>> from canonical.launchpad.interfaces import ( |
1409 | - ... DistroSeriesStatus, IComponentSet, IDistributionSet) |
1410 | + ... SeriesStatus, IComponentSet, IDistributionSet) |
1411 | >>> from canonical.launchpad.database import ComponentSelection |
1412 | >>> ubuntu = getUtility(IDistributionSet)['ubuntu'] |
1413 | >>> hoary = ubuntu['hoary'] |
1414 | - >>> hoary.status = DistroSeriesStatus.DEVELOPMENT |
1415 | + >>> hoary.status = SeriesStatus.DEVELOPMENT |
1416 | >>> universe = getUtility(IComponentSet)['universe'] |
1417 | >>> from canonical.testing import LaunchpadZopelessLayer |
1418 | >>> from canonical.database.sqlbase import commit |
1419 | @@ -717,7 +717,7 @@ |
1420 | to upload to -UPDATES in a DEVELOPMENT series. |
1421 | |
1422 | >>> LaunchpadZopelessLayer.switchDbUser('launchpad') |
1423 | - >>> hoary.status = DistroSeriesStatus.CURRENT |
1424 | + >>> hoary.status = SeriesStatus.CURRENT |
1425 | >>> commit() |
1426 | >>> LaunchpadZopelessLayer.switchDbUser('uploader') |
1427 | |
1428 | @@ -749,7 +749,7 @@ |
1429 | And pop it back to development now that we're done |
1430 | |
1431 | >>> LaunchpadZopelessLayer.switchDbUser('launchpad') |
1432 | - >>> hoary.status = DistroSeriesStatus.DEVELOPMENT |
1433 | + >>> hoary.status = SeriesStatus.DEVELOPMENT |
1434 | >>> commit() |
1435 | >>> LaunchpadZopelessLayer.switchDbUser('uploader') |
1436 | |
1437 | |
1438 | === modified file 'lib/lp/soyuz/doc/package-diff.txt' |
1439 | --- lib/lp/soyuz/doc/package-diff.txt 2009-09-23 12:02:35 +0000 |
1440 | +++ lib/lp/soyuz/doc/package-diff.txt 2010-01-05 16:22:16 +0000 |
1441 | @@ -172,8 +172,8 @@ |
1442 | We will release ubuntu/hoary so we can upload to post-RELEASE pockets |
1443 | and ubuntu/breezy-autotest. |
1444 | |
1445 | - >>> from canonical.launchpad.interfaces import DistroSeriesStatus |
1446 | - >>> hoary.status = DistroSeriesStatus.CURRENT |
1447 | + >>> from canonical.launchpad.interfaces import SeriesStatus |
1448 | + >>> hoary.status = SeriesStatus.CURRENT |
1449 | |
1450 | We upload version '1.0-9' to hoary-updates and get the diff against |
1451 | the last published version in the RELEASE pocket. |
1452 | |
1453 | === modified file 'lib/lp/soyuz/doc/soyuz-set-of-uploads.txt' |
1454 | --- lib/lp/soyuz/doc/soyuz-set-of-uploads.txt 2009-10-26 18:40:04 +0000 |
1455 | +++ lib/lp/soyuz/doc/soyuz-set-of-uploads.txt 2010-01-05 16:22:16 +0000 |
1456 | @@ -502,8 +502,8 @@ |
1457 | Set ubuntutest/breezy as the "current series" to activate post-release |
1458 | pockets. |
1459 | |
1460 | - >>> from canonical.launchpad.interfaces import DistroSeriesStatus |
1461 | - >>> breezy.status = DistroSeriesStatus.CURRENT |
1462 | + >>> from canonical.launchpad.interfaces import SeriesStatus |
1463 | + >>> breezy.status = SeriesStatus.CURRENT |
1464 | >>> LaunchpadZopelessLayer.txn.commit() |
1465 | |
1466 | Since we are using 'sync' policy in the following tests the packages |
1467 | @@ -599,7 +599,7 @@ |
1468 | Set ubuntutest/breezy to 'experimental' state again to not affect the |
1469 | rest of the test: |
1470 | |
1471 | - >>> breezy.status = DistroSeriesStatus.EXPERIMENTAL |
1472 | + >>> breezy.status = SeriesStatus.EXPERIMENTAL |
1473 | >>> breezy.syncUpdate() |
1474 | |
1475 | |
1476 | |
1477 | === modified file 'lib/lp/soyuz/doc/uploadpolicy.txt' |
1478 | --- lib/lp/soyuz/doc/uploadpolicy.txt 2009-05-13 14:05:27 +0000 |
1479 | +++ lib/lp/soyuz/doc/uploadpolicy.txt 2010-01-05 16:22:16 +0000 |
1480 | @@ -78,7 +78,7 @@ |
1481 | instead of UNAPPROVED) |
1482 | |
1483 | >>> from canonical.launchpad.interfaces import ( |
1484 | - ... DistroSeriesStatus, IDistributionSet) |
1485 | + ... SeriesStatus, IDistributionSet) |
1486 | >>> ubuntu = getUtility(IDistributionSet)['ubuntu'] |
1487 | >>> hoary = ubuntu['hoary'] |
1488 | |
1489 | @@ -102,7 +102,7 @@ |
1490 | When the distroseries is FROZEN the uploads should wait in UNAPPROVED queue: |
1491 | |
1492 | >>> login('foo.bar@canonical.com') |
1493 | - >>> hoary.status = DistroSeriesStatus.FROZEN |
1494 | + >>> hoary.status = SeriesStatus.FROZEN |
1495 | >>> from canonical.database.sqlbase import flush_database_updates |
1496 | >>> flush_database_updates() |
1497 | |
1498 | |
1499 | === modified file 'lib/lp/soyuz/scripts/buildd.py' |
1500 | --- lib/lp/soyuz/scripts/buildd.py 2009-10-26 18:40:04 +0000 |
1501 | +++ lib/lp/soyuz/scripts/buildd.py 2010-01-05 16:22:16 +0000 |
1502 | @@ -21,7 +21,7 @@ |
1503 | from lp.services.scripts.base import ( |
1504 | LaunchpadCronScript, LaunchpadScriptFailure) |
1505 | from lp.registry.interfaces.distribution import IDistributionSet |
1506 | -from lp.registry.interfaces.distroseries import DistroSeriesStatus |
1507 | +from lp.registry.interfaces.series import SeriesStatus |
1508 | |
1509 | # XXX cprov 2009-04-16: This function should live in |
1510 | # lp.registry.interfaces.distroseries. It cannot be done right now |
1511 | @@ -159,7 +159,7 @@ |
1512 | # Iterate over all supported distroarchseries with available chroot. |
1513 | build_set = getUtility(IBuildSet) |
1514 | for distroseries in distribution: |
1515 | - if distroseries.status == DistroSeriesStatus.OBSOLETE: |
1516 | + if distroseries.status == SeriesStatus.OBSOLETE: |
1517 | self.logger.debug( |
1518 | "Skipping obsolete distroseries: %s" % distroseries.title) |
1519 | continue |
1520 | |
1521 | === modified file 'lib/lp/soyuz/scripts/ftpmaster.py' |
1522 | --- lib/lp/soyuz/scripts/ftpmaster.py 2009-12-10 11:42:07 +0000 |
1523 | +++ lib/lp/soyuz/scripts/ftpmaster.py 2010-01-05 16:22:16 +0000 |
1524 | @@ -37,7 +37,7 @@ |
1525 | from canonical.launchpad.interfaces.librarian import ILibraryFileAliasSet |
1526 | from canonical.launchpad.webapp.interfaces import NotFoundError |
1527 | from lp.registry.interfaces.distribution import IDistributionSet |
1528 | -from lp.registry.interfaces.distroseries import DistroSeriesStatus |
1529 | +from lp.registry.interfaces.series import SeriesStatus |
1530 | from lp.registry.interfaces.person import IPersonSet |
1531 | from lp.registry.interfaces.pocket import ( |
1532 | PackagePublishingPocket, pocketsuffix) |
1533 | @@ -1064,7 +1064,7 @@ |
1534 | """ |
1535 | self.checkNoSuiteDefined() |
1536 | try: |
1537 | - series = self.getSeriesByStatus(DistroSeriesStatus.CURRENT) |
1538 | + series = self.getSeriesByStatus(SeriesStatus.CURRENT) |
1539 | except NotFoundError, err: |
1540 | raise LaunchpadScriptFailure(err) |
1541 | |
1542 | @@ -1087,8 +1087,8 @@ |
1543 | """ |
1544 | self.checkNoSuiteDefined() |
1545 | series = None |
1546 | - wanted_status = (DistroSeriesStatus.DEVELOPMENT, |
1547 | - DistroSeriesStatus.FROZEN) |
1548 | + wanted_status = (SeriesStatus.DEVELOPMENT, |
1549 | + SeriesStatus.FROZEN) |
1550 | for status in wanted_status: |
1551 | try: |
1552 | series = self.getSeriesByStatus(status) |
1553 | @@ -1118,8 +1118,8 @@ |
1554 | """ |
1555 | self.checkNoSuiteDefined() |
1556 | supported_series = [] |
1557 | - unsupported_status = (DistroSeriesStatus.EXPERIMENTAL, |
1558 | - DistroSeriesStatus.OBSOLETE) |
1559 | + unsupported_status = (SeriesStatus.EXPERIMENTAL, |
1560 | + SeriesStatus.OBSOLETE) |
1561 | for distroseries in self.location.distribution: |
1562 | if distroseries.status not in unsupported_status: |
1563 | supported_series.append(distroseries.name) |
1564 | @@ -1361,7 +1361,7 @@ |
1565 | "and which is not the most recent distroseries.") |
1566 | |
1567 | # Is the distroseries in an obsolete state? Bail out now if not. |
1568 | - if distroseries.status != DistroSeriesStatus.OBSOLETE: |
1569 | + if distroseries.status != SeriesStatus.OBSOLETE: |
1570 | raise SoyuzScriptError( |
1571 | "%s is not at status OBSOLETE." % distroseries.name) |
1572 | |
1573 | |
1574 | === modified file 'lib/lp/soyuz/scripts/tests/test_copypackage.py' |
1575 | --- lib/lp/soyuz/scripts/tests/test_copypackage.py 2009-12-21 12:54:47 +0000 |
1576 | +++ lib/lp/soyuz/scripts/tests/test_copypackage.py 2010-01-05 16:22:16 +0000 |
1577 | @@ -23,7 +23,7 @@ |
1578 | CreateBugParams, IBugSet) |
1579 | from lp.bugs.interfaces.bugtask import BugTaskStatus |
1580 | from lp.registry.interfaces.distribution import IDistributionSet |
1581 | -from lp.registry.interfaces.distroseries import DistroSeriesStatus |
1582 | +from lp.registry.interfaces.series import SeriesStatus |
1583 | from lp.registry.interfaces.person import IPersonSet |
1584 | from lp.registry.interfaces.pocket import PackagePublishingPocket |
1585 | from lp.soyuz.adapters.packagelocation import PackageLocationError |
1586 | @@ -947,7 +947,7 @@ |
1587 | # Make ubuntutest/breezy-autotest CURRENT so uploads to SECURITY |
1588 | # pocket can be accepted. |
1589 | self.test_publisher.breezy_autotest.status = ( |
1590 | - DistroSeriesStatus.CURRENT) |
1591 | + SeriesStatus.CURRENT) |
1592 | |
1593 | def createDelayedCopyContext(self): |
1594 | """Create a context to allow delayed-copies test. |
1595 | |
1596 | === modified file 'lib/lp/soyuz/scripts/tests/test_lpquerydistro.py' |
1597 | --- lib/lp/soyuz/scripts/tests/test_lpquerydistro.py 2009-06-25 04:06:00 +0000 |
1598 | +++ lib/lp/soyuz/scripts/tests/test_lpquerydistro.py 2010-01-05 16:22:16 +0000 |
1599 | @@ -15,7 +15,7 @@ |
1600 | from canonical.database.sqlbase import flush_database_updates |
1601 | from canonical.testing import LaunchpadLayer |
1602 | from lp.registry.interfaces.distribution import IDistributionSet |
1603 | -from lp.registry.interfaces.distroseries import DistroSeriesStatus |
1604 | +from lp.registry.interfaces.series import SeriesStatus |
1605 | from lp.services.scripts.base import LaunchpadScriptFailure |
1606 | from lp.soyuz.scripts.ftpmaster import LpQueryDistro |
1607 | from canonical.testing import LaunchpadZopelessLayer |
1608 | @@ -156,7 +156,7 @@ |
1609 | self.assertEqual(helper.location.distribution.name, u'ubuntu') |
1610 | self.assertEqual(self.test_output, u'hoary') |
1611 | |
1612 | - hoary.status = DistroSeriesStatus.FROZEN |
1613 | + hoary.status = SeriesStatus.FROZEN |
1614 | flush_database_updates() |
1615 | |
1616 | helper = self.getLpQueryDistro(test_args=['development']) |
1617 | |
1618 | === modified file 'lib/lp/soyuz/scripts/tests/test_obsoletedistroseries.py' |
1619 | --- lib/lp/soyuz/scripts/tests/test_obsoletedistroseries.py 2009-06-25 04:06:00 +0000 |
1620 | +++ lib/lp/soyuz/scripts/tests/test_obsoletedistroseries.py 2010-01-05 16:22:16 +0000 |
1621 | @@ -21,7 +21,7 @@ |
1622 | SecureSourcePackagePublishingHistory, |
1623 | SourcePackagePublishingHistory) |
1624 | from lp.registry.interfaces.distribution import IDistributionSet |
1625 | -from lp.registry.interfaces.distroseries import DistroSeriesStatus |
1626 | +from lp.registry.interfaces.series import SeriesStatus |
1627 | from lp.soyuz.interfaces.publishing import PackagePublishingStatus |
1628 | from canonical.testing import LaunchpadZopelessLayer |
1629 | |
1630 | @@ -132,7 +132,7 @@ |
1631 | def testNothingToDoCase(self): |
1632 | """When there is nothing to do, we expect an exception.""" |
1633 | obsoleter = self.getObsoleter() |
1634 | - self.warty.status = DistroSeriesStatus.OBSOLETE |
1635 | + self.warty.status = SeriesStatus.OBSOLETE |
1636 | |
1637 | # Get all the published sources in warty. |
1638 | published_sources, published_binaries = ( |
1639 | @@ -151,7 +151,7 @@ |
1640 | def testObsoleteDistroseriesWorks(self): |
1641 | """Make sure the required publications are obsoleted.""" |
1642 | obsoleter = self.getObsoleter() |
1643 | - self.warty.status = DistroSeriesStatus.OBSOLETE |
1644 | + self.warty.status = SeriesStatus.OBSOLETE |
1645 | |
1646 | # Get all the published sources in warty. |
1647 | published_sources, published_binaries = ( |
1648 | |
1649 | === modified file 'lib/lp/soyuz/scripts/tests/test_queue.py' |
1650 | --- lib/lp/soyuz/scripts/tests/test_queue.py 2009-08-28 07:34:44 +0000 |
1651 | +++ lib/lp/soyuz/scripts/tests/test_queue.py 2010-01-05 16:22:16 +0000 |
1652 | @@ -28,7 +28,7 @@ |
1653 | from lp.bugs.interfaces.bugtask import IBugTaskSet |
1654 | from canonical.launchpad.interfaces.librarian import ILibraryFileAliasSet |
1655 | from lp.registry.interfaces.distribution import IDistributionSet |
1656 | -from lp.registry.interfaces.distroseries import DistroSeriesStatus |
1657 | +from lp.registry.interfaces.series import SeriesStatus |
1658 | from lp.registry.interfaces.person import IPersonSet |
1659 | from lp.registry.interfaces.pocket import PackagePublishingPocket |
1660 | from lp.soyuz.interfaces.archive import ArchivePurpose, IArchiveSet |
1661 | @@ -474,7 +474,7 @@ |
1662 | # to BACKPORTS. |
1663 | breezy_autotest = getUtility( |
1664 | IDistributionSet)['ubuntu']['breezy-autotest'] |
1665 | - breezy_autotest.status = DistroSeriesStatus.CURRENT |
1666 | + breezy_autotest.status = SeriesStatus.CURRENT |
1667 | |
1668 | LaunchpadZopelessLayer.txn.commit() |
1669 | LaunchpadZopelessLayer.switchDbUser(self.dbuser) |
1670 | @@ -522,7 +522,7 @@ |
1671 | # to PROPOSED. |
1672 | breezy_autotest = getUtility( |
1673 | IDistributionSet)['ubuntu']['breezy-autotest'] |
1674 | - breezy_autotest.status = DistroSeriesStatus.CURRENT |
1675 | + breezy_autotest.status = SeriesStatus.CURRENT |
1676 | |
1677 | LaunchpadZopelessLayer.txn.commit() |
1678 | LaunchpadZopelessLayer.switchDbUser(self.dbuser) |
1679 | |
1680 | === modified file 'lib/lp/soyuz/tests/test_packageset.py' |
1681 | --- lib/lp/soyuz/tests/test_packageset.py 2009-10-29 14:12:58 +0000 |
1682 | +++ lib/lp/soyuz/tests/test_packageset.py 2010-01-05 16:22:16 +0000 |
1683 | @@ -9,7 +9,7 @@ |
1684 | |
1685 | from lp.testing import TestCaseWithFactory |
1686 | from lp.registry.interfaces.distribution import IDistributionSet |
1687 | -from lp.registry.interfaces.distroseries import DistroSeriesStatus |
1688 | +from lp.registry.interfaces.series import SeriesStatus |
1689 | from lp.soyuz.interfaces.packageset import ( |
1690 | DuplicatePackagesetName, IPackagesetSet) |
1691 | |
1692 | @@ -26,7 +26,7 @@ |
1693 | self.distroseries_current = self.distribution.currentseries |
1694 | self.distroseries_experimental = self.factory.makeDistroRelease( |
1695 | distribution = self.distribution, name="experimental", |
1696 | - status=DistroSeriesStatus.EXPERIMENTAL) |
1697 | + status=SeriesStatus.EXPERIMENTAL) |
1698 | |
1699 | self.person1 = self.factory.makePerson( |
1700 | name='hacker', displayname=u'Happy Hacker') |
1701 | @@ -133,10 +133,10 @@ |
1702 | self.distroseries_current = self.distribution.currentseries |
1703 | self.distroseries_experimental = self.factory.makeDistroRelease( |
1704 | distribution = self.distribution, name="experimental", |
1705 | - status=DistroSeriesStatus.EXPERIMENTAL) |
1706 | + status=SeriesStatus.EXPERIMENTAL) |
1707 | self.distroseries_experimental2 = self.factory.makeDistroRelease( |
1708 | distribution = self.distribution, name="experimental2", |
1709 | - status=DistroSeriesStatus.EXPERIMENTAL) |
1710 | + status=SeriesStatus.EXPERIMENTAL) |
1711 | |
1712 | self.person1 = self.factory.makePerson( |
1713 | name='hacker', displayname=u'Happy Hacker') |
1714 | |
1715 | === modified file 'lib/lp/soyuz/tests/test_packageupload.py' |
1716 | --- lib/lp/soyuz/tests/test_packageupload.py 2009-12-07 13:45:31 +0000 |
1717 | +++ lib/lp/soyuz/tests/test_packageupload.py 2010-01-05 16:22:16 +0000 |
1718 | @@ -15,7 +15,7 @@ |
1719 | from email import message_from_string |
1720 | from lp.archiveuploader.tests import datadir |
1721 | from lp.registry.interfaces.distribution import IDistributionSet |
1722 | -from lp.registry.interfaces.distroseries import DistroSeriesStatus |
1723 | +from lp.registry.interfaces.series import SeriesStatus |
1724 | from lp.registry.interfaces.pocket import PackagePublishingPocket |
1725 | from lp.services.mail import stub |
1726 | from lp.soyuz.interfaces.archive import ArchivePurpose |
1727 | @@ -180,7 +180,7 @@ |
1728 | # Release ubuntutest/breezy-autotest, so delayed-copies to |
1729 | # SECURITY pocket can be accepted. |
1730 | self.test_publisher.breezy_autotest.status = ( |
1731 | - DistroSeriesStatus.CURRENT) |
1732 | + SeriesStatus.CURRENT) |
1733 | |
1734 | # Create an ancestry publication in 'multiverse'. |
1735 | ancestry_source = self.test_publisher.getPubSource( |
1736 | @@ -281,7 +281,7 @@ |
1737 | # Create the default delayed-copy context. |
1738 | delayed_copy = self.createDelayedCopy(source_only=True) |
1739 | self.test_publisher.breezy_autotest.status = ( |
1740 | - DistroSeriesStatus.CURRENT) |
1741 | + SeriesStatus.CURRENT) |
1742 | self.layer.txn.commit() |
1743 | |
1744 | # Accept and publish the delayed-copy. |
1745 | |
1746 | === modified file 'lib/lp/soyuz/tests/test_publishing_top_level_api.py' |
1747 | --- lib/lp/soyuz/tests/test_publishing_top_level_api.py 2009-08-28 07:34:44 +0000 |
1748 | +++ lib/lp/soyuz/tests/test_publishing_top_level_api.py 2010-01-05 16:22:16 +0000 |
1749 | @@ -7,7 +7,7 @@ |
1750 | |
1751 | from lp.soyuz.tests.test_publishing import TestNativePublishingBase |
1752 | |
1753 | -from lp.registry.interfaces.distroseries import DistroSeriesStatus |
1754 | +from lp.registry.interfaces.series import SeriesStatus |
1755 | from lp.registry.interfaces.pocket import PackagePublishingPocket |
1756 | from lp.soyuz.interfaces.publishing import PackagePublishingStatus |
1757 | |
1758 | @@ -167,7 +167,7 @@ |
1759 | Publication to UPDATES pocket (post-release pockets) are ignored |
1760 | """ |
1761 | self.assertEqual( |
1762 | - self.breezy_autotest.status, DistroSeriesStatus.EXPERIMENTAL) |
1763 | + self.breezy_autotest.status, SeriesStatus.EXPERIMENTAL) |
1764 | self.assertEqual(self.breezy_autotest.isUnstable(), True) |
1765 | self.checkPublicationsAreConsidered(PackagePublishingPocket.RELEASE) |
1766 | self.checkPublicationsAreIgnored(PackagePublishingPocket.UPDATES) |
1767 | @@ -179,11 +179,11 @@ |
1768 | Publications to UPDATES pocket are considered. |
1769 | """ |
1770 | # Release ubuntu/breezy-autotest. |
1771 | - self.breezy_autotest.status = DistroSeriesStatus.CURRENT |
1772 | + self.breezy_autotest.status = SeriesStatus.CURRENT |
1773 | self.layer.commit() |
1774 | |
1775 | self.assertEqual( |
1776 | - self.breezy_autotest.status, DistroSeriesStatus.CURRENT) |
1777 | + self.breezy_autotest.status, SeriesStatus.CURRENT) |
1778 | self.assertEqual(self.breezy_autotest.isUnstable(), False) |
1779 | self.checkPublicationsAreConsidered(PackagePublishingPocket.UPDATES) |
1780 | self.checkPublicationsAreIgnored(PackagePublishingPocket.RELEASE) |
1781 | @@ -194,11 +194,11 @@ |
1782 | Publications to both, RELEASE and UPDATES, pockets are considered. |
1783 | """ |
1784 | # Release ubuntu/breezy-autotest. |
1785 | - self.breezy_autotest.status = DistroSeriesStatus.FROZEN |
1786 | + self.breezy_autotest.status = SeriesStatus.FROZEN |
1787 | self.layer.commit() |
1788 | |
1789 | self.assertEqual( |
1790 | - self.breezy_autotest.status, DistroSeriesStatus.FROZEN) |
1791 | + self.breezy_autotest.status, SeriesStatus.FROZEN) |
1792 | self.assertEqual( |
1793 | self.breezy_autotest.isUnstable(), True) |
1794 | self.checkPublicationsAreConsidered(PackagePublishingPocket.UPDATES) |
1795 | @@ -249,7 +249,7 @@ |
1796 | self._createDefaulSourcePublications()) |
1797 | |
1798 | # Release 'breezy-autotest'. |
1799 | - self.breezy_autotest.status = DistroSeriesStatus.CURRENT |
1800 | + self.breezy_autotest.status = SeriesStatus.CURRENT |
1801 | self.layer.commit() |
1802 | |
1803 | # Since the distroseries is stable, nothing is returned because |
1804 | @@ -282,7 +282,7 @@ |
1805 | pub_pending_release, pub_published_release, pub_pending_updates = ( |
1806 | self._createDefaulSourcePublications()) |
1807 | # Freeze 'breezy-autotest'. |
1808 | - self.breezy_autotest.status = DistroSeriesStatus.FROZEN |
1809 | + self.breezy_autotest.status = SeriesStatus.FROZEN |
1810 | self.layer.commit() |
1811 | |
1812 | # Usual publication procedure for a distroseries in development |
1813 | @@ -361,7 +361,7 @@ |
1814 | self._createDefaulBinaryPublications()) |
1815 | |
1816 | # Release 'breezy-autotest' |
1817 | - self.breezy_autotest.status = DistroSeriesStatus.CURRENT |
1818 | + self.breezy_autotest.status = SeriesStatus.CURRENT |
1819 | self.layer.commit() |
1820 | |
1821 | # Since the distroseries is stable, nothing is returned because |
1822 | @@ -394,7 +394,7 @@ |
1823 | pub_pending_release, pub_published_release, pub_pending_updates = ( |
1824 | self._createDefaulBinaryPublications()) |
1825 | # Freeze 'breezy-autotest' |
1826 | - self.breezy_autotest.status = DistroSeriesStatus.FROZEN |
1827 | + self.breezy_autotest.status = SeriesStatus.FROZEN |
1828 | self.layer.commit() |
1829 | |
1830 | # Usual publication procedure for a distroseries in development |
1831 | |
1832 | === modified file 'lib/lp/testing/factory.py' |
1833 | --- lib/lp/testing/factory.py 2010-01-05 00:53:47 +0000 |
1834 | +++ lib/lp/testing/factory.py 2010-01-05 16:22:16 +0000 |
1835 | @@ -14,11 +14,11 @@ |
1836 | ] |
1837 | |
1838 | from datetime import datetime, timedelta |
1839 | -from email.Encoders import encode_base64 |
1840 | -from email.Utils import make_msgid, formatdate |
1841 | -from email.Message import Message as EmailMessage |
1842 | -from email.MIMEText import MIMEText |
1843 | -from email.MIMEMultipart import MIMEMultipart |
1844 | +from email.encoders import encode_base64 |
1845 | +from email.utils import make_msgid, formatdate |
1846 | +from email.message import Message as EmailMessage |
1847 | +from email.mime.text import MIMEText |
1848 | +from email.mime.multipart import MIMEMultipart |
1849 | from itertools import count |
1850 | from StringIO import StringIO |
1851 | import os.path |
1852 | @@ -100,8 +100,8 @@ |
1853 | from lp.registry.model.milestone import Milestone |
1854 | from lp.registry.model.suitesourcepackage import SuiteSourcePackage |
1855 | from lp.registry.interfaces.distribution import IDistributionSet |
1856 | -from lp.registry.interfaces.distroseries import ( |
1857 | - DistroSeriesStatus, IDistroSeries) |
1858 | +from lp.registry.interfaces.series import SeriesStatus |
1859 | +from lp.registry.interfaces.distroseries import IDistroSeries |
1860 | from lp.registry.interfaces.gpg import GPGKeyAlgorithm, IGPGKeySet |
1861 | from lp.registry.interfaces.mailinglist import ( |
1862 | IMailingListSet, MailingListStatus) |
1863 | @@ -511,7 +511,8 @@ |
1864 | group = self.makeTranslationGroup() |
1865 | if person is None: |
1866 | person = self.makePerson() |
1867 | - ITranslationsPerson(person).translations_relicensing_agreement = license |
1868 | + ITranslationsPerson(person).translations_relicensing_agreement = ( |
1869 | + license) |
1870 | return getUtility(ITranslatorSet).new(group, language, person) |
1871 | |
1872 | def makeMilestone( |
1873 | @@ -1442,7 +1443,7 @@ |
1874 | members, owner) |
1875 | |
1876 | def makeDistroRelease(self, distribution=None, version=None, |
1877 | - status=DistroSeriesStatus.DEVELOPMENT, |
1878 | + status=SeriesStatus.DEVELOPMENT, |
1879 | parent_series=None, name=None): |
1880 | """Make a new distro release.""" |
1881 | if distribution is None: |
1882 | |
1883 | === modified file 'lib/lp/translations/browser/distribution.py' |
1884 | --- lib/lp/translations/browser/distribution.py 2009-10-26 18:40:04 +0000 |
1885 | +++ lib/lp/translations/browser/distribution.py 2010-01-05 16:22:16 +0000 |
1886 | @@ -19,7 +19,7 @@ |
1887 | LaunchpadView, Link) |
1888 | from canonical.launchpad.webapp.menu import NavigationMenu |
1889 | from lp.registry.interfaces.distribution import IDistribution |
1890 | -from lp.registry.interfaces.distroseries import DistroSeriesStatus |
1891 | +from lp.registry.interfaces.series import SeriesStatus |
1892 | from lp.registry.browser.distribution import DistributionEditView |
1893 | from lp.translations.browser.translations import TranslationsMixin |
1894 | |
1895 | @@ -100,7 +100,7 @@ |
1896 | series = [ |
1897 | series |
1898 | for series in self.context.series |
1899 | - if (series.status != DistroSeriesStatus.OBSOLETE |
1900 | + if (series.status != SeriesStatus.OBSOLETE |
1901 | and (self.translation_focus is None or |
1902 | self.translation_focus.id != series.id)) |
1903 | ] |
1904 | |
1905 | === modified file 'lib/lp/translations/browser/tests/distroseries-views.txt' |
1906 | --- lib/lp/translations/browser/tests/distroseries-views.txt 2009-07-16 14:40:28 +0000 |
1907 | +++ lib/lp/translations/browser/tests/distroseries-views.txt 2010-01-05 16:22:16 +0000 |
1908 | @@ -5,7 +5,7 @@ |
1909 | Let's use ubuntu/hoary for these tests. |
1910 | |
1911 | >>> from canonical.launchpad.interfaces import IDistributionSet |
1912 | - >>> from lp.registry.interfaces.distroseries import DistroSeriesStatus |
1913 | + >>> from lp.registry.interfaces.series import SeriesStatus |
1914 | >>> ubuntu = getUtility(IDistributionSet).getByName('ubuntu') |
1915 | >>> hoary = ubuntu.getSeries('hoary') |
1916 | |
1917 | @@ -13,7 +13,7 @@ |
1918 | message. |
1919 | |
1920 | >>> login('foo.bar@canonical.com') |
1921 | - >>> hoary.status = DistroSeriesStatus.CURRENT |
1922 | + >>> hoary.status = SeriesStatus.CURRENT |
1923 | |
1924 | == Hiding translations == |
1925 | |
1926 | |
1927 | === modified file 'lib/lp/translations/model/translationimportqueue.py' |
1928 | --- lib/lp/translations/model/translationimportqueue.py 2009-12-24 11:34:12 +0000 |
1929 | +++ lib/lp/translations/model/translationimportqueue.py 2010-01-05 16:22:16 +0000 |
1930 | @@ -36,8 +36,8 @@ |
1931 | from canonical.launchpad.interfaces.lpstorm import IMasterStore |
1932 | from canonical.launchpad.webapp.interfaces import NotFoundError |
1933 | from lp.registry.interfaces.distribution import IDistribution |
1934 | -from lp.registry.interfaces.distroseries import ( |
1935 | - IDistroSeries, DistroSeriesStatus) |
1936 | +from lp.registry.interfaces.series import SeriesStatus |
1937 | +from lp.registry.interfaces.distroseries import IDistroSeries |
1938 | from lp.registry.interfaces.person import ( |
1939 | IPerson, validate_person_not_private_membership) |
1940 | from lp.registry.interfaces.product import IProduct |
1941 | @@ -1284,7 +1284,7 @@ |
1942 | Distribution.id = DistroSeries.distribution |
1943 | WHERE DistroSeries.releasestatus = %s |
1944 | LIMIT 100) |
1945 | - """ % quote(DistroSeriesStatus.OBSOLETE)) |
1946 | + """ % quote(SeriesStatus.OBSOLETE)) |
1947 | return cur.rowcount |
1948 | |
1949 | def cleanUpQueue(self): |
1950 | |
1951 | === modified file 'lib/lp/translations/scripts/remove_obsolete_translations.py' |
1952 | --- lib/lp/translations/scripts/remove_obsolete_translations.py 2009-07-17 00:26:05 +0000 |
1953 | +++ lib/lp/translations/scripts/remove_obsolete_translations.py 2010-01-05 16:22:16 +0000 |
1954 | @@ -10,7 +10,7 @@ |
1955 | |
1956 | from canonical.database.sqlbase import quote |
1957 | |
1958 | -from lp.registry.interfaces.distroseries import DistroSeriesStatus |
1959 | +from lp.registry.interfaces.series import SeriesStatus |
1960 | from canonical.launchpad.interfaces.launchpad import ILaunchpadCelebrities |
1961 | from canonical.launchpad.interfaces.looptuner import ITunableLoop |
1962 | |
1963 | @@ -174,7 +174,7 @@ |
1964 | ON POTemplate.distroseries=DistroSeries.id |
1965 | WHERE DistroSeries.releasestatus=%s AND |
1966 | DistroSeries.distribution=%s""" % ( |
1967 | - quote(DistroSeriesStatus.OBSOLETE), |
1968 | + quote(SeriesStatus.OBSOLETE), |
1969 | quote(getUtility(ILaunchpadCelebrities).ubuntu)) |
1970 | result = self.store.execute(query) |
1971 | count = result.get_one() |
1972 | @@ -200,7 +200,7 @@ |
1973 | WHERE DistroSeries.releasestatus != %s |
1974 | GROUP BY DistroSeries.id |
1975 | ORDER BY DistroSeries.id""" % quote( |
1976 | - DistroSeriesStatus.OBSOLETE) |
1977 | + SeriesStatus.OBSOLETE) |
1978 | result = self.store.execute(query) |
1979 | return result.get_all() |
1980 | |
1981 | @@ -216,7 +216,7 @@ |
1982 | productseries IS NOT NULL |
1983 | GROUP BY POTemplate.id |
1984 | ORDER BY POTemplate.id""" % quote( |
1985 | - DistroSeriesStatus.OBSOLETE) |
1986 | + SeriesStatus.OBSOLETE) |
1987 | result = self.store.execute(query) |
1988 | return result.get_all() |
1989 | |
1990 | @@ -232,7 +232,7 @@ |
1991 | productseries IS NOT NULL |
1992 | GROUP BY POTemplate.id |
1993 | ORDER BY POTemplate.id""" % quote( |
1994 | - DistroSeriesStatus.OBSOLETE) |
1995 | + SeriesStatus.OBSOLETE) |
1996 | result = self.store.execute(query) |
1997 | return result.get_all() |
1998 | |
1999 | @@ -250,7 +250,7 @@ |
2000 | productseries IS NOT NULL |
2001 | GROUP BY POFile.id |
2002 | ORDER BY POFile.id""" % quote( |
2003 | - DistroSeriesStatus.OBSOLETE) |
2004 | + SeriesStatus.OBSOLETE) |
2005 | result = self.store.execute(query) |
2006 | return result.get_all() |
2007 | |
2008 | @@ -316,7 +316,7 @@ |
2009 | 'join_column' : 'distroseries', |
2010 | 'distribution' : |
2011 | quote(getUtility(ILaunchpadCelebrities).ubuntu), |
2012 | - 'releasestatus' : quote(DistroSeriesStatus.OBSOLETE), |
2013 | + 'releasestatus' : quote(SeriesStatus.OBSOLETE), |
2014 | 'collection_sql' : collect_obsolete_potemplates_query, |
2015 | }, |
2016 | } |
2017 | |
2018 | === modified file 'lib/lp/translations/templates/pofile-details.pt' |
2019 | --- lib/lp/translations/templates/pofile-details.pt 2009-12-13 08:28:51 +0000 |
2020 | +++ lib/lp/translations/templates/pofile-details.pt 2010-01-05 16:22:16 +0000 |
2021 | @@ -42,12 +42,10 @@ |
2022 | |
2023 | <ul tal:condition="view/contributors"> |
2024 | <li tal:repeat="contributor view/contributors"> |
2025 | - <tal:not-merged condition="not: contributor/merged"> |
2026 | - <a tal:replace="structure contributor/fmt:link" /> |
2027 | - (<a tal:attributes=" |
2028 | - href string:${context/fmt:url}/+filter?person=${contributor/name}" |
2029 | - >filter</a>) |
2030 | - </tal:not-merged> |
2031 | + <a tal:replace="structure contributor/fmt:link" /> |
2032 | + (<a tal:attributes=" |
2033 | + href string:${context/fmt:url}/+filter?person=${contributor/name}" |
2034 | + >filter</a>) |
2035 | </li> |
2036 | </ul> |
2037 | |
2038 | |
2039 | === modified file 'lib/lp/translations/tests/test_autoapproval.py' |
2040 | --- lib/lp/translations/tests/test_autoapproval.py 2009-12-18 09:25:14 +0000 |
2041 | +++ lib/lp/translations/tests/test_autoapproval.py 2010-01-05 16:22:16 +0000 |
2042 | @@ -18,7 +18,7 @@ |
2043 | from canonical.launchpad.interfaces.launchpad import ILaunchpadCelebrities |
2044 | from canonical.launchpad.interfaces.lpstorm import IMasterStore |
2045 | |
2046 | -from lp.registry.interfaces.distroseries import DistroSeriesStatus |
2047 | +from lp.registry.interfaces.series import SeriesStatus |
2048 | from lp.registry.model.distribution import Distribution |
2049 | from lp.registry.model.sourcepackagename import ( |
2050 | SourcePackageName, |
2051 | @@ -820,7 +820,7 @@ |
2052 | self.queue._cleanUpObsoleteDistroEntries(self.store) |
2053 | self.assertTrue(self._exists(entry_id)) |
2054 | |
2055 | - entry.distroseries.status = DistroSeriesStatus.OBSOLETE |
2056 | + entry.distroseries.status = SeriesStatus.OBSOLETE |
2057 | entry.distroseries.syncUpdate() |
2058 | |
2059 | become_the_gardener(self.layer) |
= Bug 496352 =
Since DistroSeriesStatus is also used for ProductSeries, it should be renamed and moved to a dedicated file.
This is the note from Salgado status as well.
# XXX: salgado, 2008-06-02: We should use a more generic name here as this
# enum is used in ProductSeries.
== Proposed fix ==
Just rename the class DistroSeriesStatus to SeriesStatus and create a new module Series to host it (in the future it can contain any other common classes (interfaces).
== Implementation details ==
After touching those files, now lint complain about them.
My changes should have not affect any of the reported problems.
Any hint in fixing them is much appreciated.
== Tests ==
A full test should be ran
== Demo and Q/A ==
After these changes nothings has to be changed from the users point of view.
= Lint =
I think there is a problem with pylint setup as it does not pick up lazr modules.
Also I don't know why this interface is not accepted lib/lp/ registry/ interfaces/ distroseries. py
= Launchpad lint =
Checking for conflicts. and issues in doctests and templates.
Running jslint, xmllint, pyflakes, and pylint.
Using normal rules.
Linting changed files: archiveuploader /uploadpolicy. py code/tests/ test_branch. py registry/ interfaces/ distroseries. py registry/ model/distribut ion.py testing/ factory. py translations/ browser/ product. py translations/ stories/ standalone/ xx-productserie s-translations. txt
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
== Pylint notices ==
lib/lp/ registry/ interfaces/ distroseries. py fields' (No module named restful) declarations' (No module named restful) sionField. _validate] Use super on an old style class blic.getPackage Uploads] Operator not preceded by a space =_("Return items that are more recent than this " False),
22: [F0401] Unable to import 'lazr.enum' (No module named enum)
49: [F0401] Unable to import 'lazr.restful.
50: [F0401] Unable to import 'lazr.restful.
115: [E1002, DistroSeriesVer
426: [C0322, IDistroSeriesPu
description
^
"timestamp."),
required=
status=Choice(
vocabulary= DBEnumeratedTyp e, _("Package Upload Status"), =_("Return only items that have this status."), False), Reference(
title=
description
required=
archive=
schema= Interface, _("Archive" ), =_("Return only items for this archive."), False),
title=
description
required=
pocket=Choice(
vocabulary= DBEnumeratedTyp e, _("Pocket" ), =_("Return only items targeted to this pocket"), False), type=Choice(
title=
description
required=
custom_
vocabulary= DBEnumeratedTyp e, =_("Return only items with custom files of this " False),
title=_("Custom Type"),
description
"type."),
required=
)
@operation_ returns_ collection_ of(Interface) read_operation( ) ds(created_ since_date, status, archive, pocket,
@export_
def getPackageUploa
custom_type):
lib/lp/ testing/ factory. py
17: [F0401] Unable to import 'email.Encoders' (No module named Encoders)
18: [F0401] Unable to import 'email.Utils' (No module named Utils)
19: [F0401] Unable to import 'email.Message' (No module named Message)
20: [F...