Merge lp:~jml/launchpad/remove-interface-import into lp:launchpad

Proposed by Jonathan Lange
Status: Merged
Approved by: Robert Collins
Approved revision: no longer in the source branch.
Merged at revision: 11174
Proposed branch: lp:~jml/launchpad/remove-interface-import
Merge into: lp:launchpad
Diff against target: 153 lines (+24/-21)
2 files modified
lib/canonical/launchpad/doc/canonical_url_examples.txt (+6/-5)
lib/lp/registry/doc/vocabularies.txt (+18/-16)
To merge this branch: bzr merge lp:~jml/launchpad/remove-interface-import
Reviewer Review Type Date Requested Status
Robert Collins (community) Approve
Review via email: mp+30375@code.launchpad.net

Description of the change

This branch is part of a multi-stage quest to remove canonical.launchpad.interfaces.__init__ imports.

All it does is remove the first re-import in __init__ and then fix all of the things that appeared to import it. While in those other places, I did some drive-by cleanups.

To post a comment you must log in.
Revision history for this message
Robert Collins (lifeless) wrote :

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/canonical/launchpad/doc/canonical_url_examples.txt'
--- lib/canonical/launchpad/doc/canonical_url_examples.txt 2010-04-28 22:03:05 +0000
+++ lib/canonical/launchpad/doc/canonical_url_examples.txt 2010-07-20 10:27:55 +0000
@@ -9,7 +9,8 @@
99
10 >>> from zope.component import getUtility10 >>> from zope.component import getUtility
11 >>> from canonical.launchpad.webapp import canonical_url11 >>> from canonical.launchpad.webapp import canonical_url
12 >>> from canonical.launchpad.interfaces import ILaunchpadCelebrities12 >>> from canonical.launchpad.interfaces.launchpad import (
13 ... ILaunchpadCelebrities)
13 >>> celebs = getUtility(ILaunchpadCelebrities)14 >>> celebs = getUtility(ILaunchpadCelebrities)
1415
15The examples are divided into sections by theme. Each section starts with16The examples are divided into sections by theme. Each section starts with
@@ -20,10 +21,10 @@
2021
21== Application homepages ==22== Application homepages ==
2223
23 >>> from canonical.launchpad.interfaces import (24 >>> from canonical.launchpad.interfaces.launchpad import IBazaarApplication
24 ... IMaloneApplication, IBazaarApplication,25 >>> from canonical.launchpad.webapp.interfaces import ILaunchpadRoot
25 ... ILaunchpadRoot, IQuestionSet26 >>> from lp.answers.interfaces.questioncollection import IQuestionSet
26 ... )27 >>> from lp.bugs.interfaces.malone import IMaloneApplication
2728
28The Launchpad homepage.29The Launchpad homepage.
2930
3031
=== modified file 'lib/lp/registry/doc/vocabularies.txt'
--- lib/lp/registry/doc/vocabularies.txt 2010-07-14 15:59:44 +0000
+++ lib/lp/registry/doc/vocabularies.txt 2010-07-20 10:27:55 +0000
@@ -1,9 +1,11 @@
1= Registry vocabularies =1= Registry vocabularies =
22
3 >>> from canonical.launchpad.ftests import login
4 >>> from canonical.launchpad.interfaces import (
5 ... IPersonSet, IOpenLaunchBag, IProductSet, IProjectGroupSet)
6 >>> from canonical.database.sqlbase import flush_database_updates3 >>> from canonical.database.sqlbase import flush_database_updates
4 >>> from canonical.launchpad.webapp.interfaces import IOpenLaunchBag
5 >>> from lp.registry.interfaces.person import IPersonSet
6 >>> from lp.registry.interfaces.product import IProductSet
7 >>> from lp.registry.interfaces.projectgroup import IProjectGroupSet
8 >>> from lp.testing import login
7 >>> person_set = getUtility(IPersonSet)9 >>> person_set = getUtility(IPersonSet)
8 >>> product_set = getUtility(IProductSet)10 >>> product_set = getUtility(IProductSet)
9 >>> login('foo.bar@canonical.com')11 >>> login('foo.bar@canonical.com')
@@ -50,8 +52,9 @@
50 >>> personset = getUtility(IPersonSet)52 >>> personset = getUtility(IPersonSet)
51 >>> ddaa = personset.getByName('ddaa')53 >>> ddaa = personset.getByName('ddaa')
52 >>> carlos = personset.getByName('carlos')54 >>> carlos = personset.getByName('carlos')
53 >>> from canonical.launchpad.interfaces import (55 >>> from lp.registry.interfaces.mailinglist import (
54 ... IMailingListSet, MailingListStatus, TeamSubscriptionPolicy)56 ... IMailingListSet, MailingListStatus)
57 >>> from lp.registry.interfaces.person import TeamSubscriptionPolicy
55 >>> team_one = personset.newTeam(58 >>> team_one = personset.newTeam(
56 ... ddaa, 'bass-players', 'Bass Players',59 ... ddaa, 'bass-players', 'Bass Players',
57 ... subscriptionpolicy=TeamSubscriptionPolicy.OPEN)60 ... subscriptionpolicy=TeamSubscriptionPolicy.OPEN)
@@ -257,7 +260,7 @@
257The PersonActiveMembership vocabulary only shows teams where the260The PersonActiveMembership vocabulary only shows teams where the
258membership is public.261membership is public.
259262
260 >>> from canonical.launchpad.interfaces import PersonVisibility263 >>> from lp.registry.interfaces.person import PersonVisibility
261 >>> pubteam = factory.makeTeam(owner=foo_bar, name='public-team',264 >>> pubteam = factory.makeTeam(owner=foo_bar, name='public-team',
262 ... displayname="Public Team",265 ... displayname="Public Team",
263 ... visibility=PersonVisibility.PUBLIC)266 ... visibility=PersonVisibility.PUBLIC)
@@ -350,7 +353,7 @@
350 >>> len(milestones)353 >>> len(milestones)
351 0354 0
352355
353 >>> from canonical.launchpad.interfaces import IMaloneApplication356 >>> from lp.bugs.interfaces.malone import IMaloneApplication
354 >>> malone = getUtility(IMaloneApplication)357 >>> malone = getUtility(IMaloneApplication)
355 >>> milestones = get_naked_vocab(malone, 'Milestone')358 >>> milestones = get_naked_vocab(malone, 'Milestone')
356 >>> len(milestones)359 >>> len(milestones)
@@ -395,7 +398,7 @@
395If the context is a bugtask, only the bugtask's target's milestones are398If the context is a bugtask, only the bugtask's target's milestones are
396in the vocabulary.399in the vocabulary.
397400
398 >>> from canonical.launchpad.interfaces import IBugSet401 >>> from lp.bugs.interfaces.bug import IBugSet
399 >>> bug_one = getUtility(IBugSet).get(1)402 >>> bug_one = getUtility(IBugSet).get(1)
400 >>> firefox_task = bug_one.bugtasks[0]403 >>> firefox_task = bug_one.bugtasks[0]
401 >>> firefox_task.bugtargetdisplayname404 >>> firefox_task.bugtargetdisplayname
@@ -523,7 +526,7 @@
523526
524 The ProjectGroupVocabulary does not list inactive projects.527 The ProjectGroupVocabulary does not list inactive projects.
525528
526 >>> from canonical.launchpad.interfaces import IProjectGroupSet529 >>> from lp.registry.interfaces.projectgroup import IProjectGroupSet
527 >>> moz_project = getUtility(IProjectGroupSet)['mozilla']530 >>> moz_project = getUtility(IProjectGroupSet)['mozilla']
528 >>> moz_project in project_vocabulary531 >>> moz_project in project_vocabulary
529 True532 True
@@ -647,7 +650,7 @@
647650
648A person with a single and unvalidated email address can be merged.651A person with a single and unvalidated email address can be merged.
649652
650 >>> from canonical.launchpad.interfaces import PersonCreationRationale653 >>> from lp.registry.interfaces.person import PersonCreationRationale
651 >>> fooperson, email = person_set.createPersonAndEmail(654 >>> fooperson, email = person_set.createPersonAndEmail(
652 ... 'foobaz@bar.com', PersonCreationRationale.UNKNOWN,655 ... 'foobaz@bar.com', PersonCreationRationale.UNKNOWN,
653 ... name='foobaz', displayname='foo baz')656 ... name='foobaz', displayname='foo baz')
@@ -679,7 +682,8 @@
679A person whose account_status is any of the statuses of682A person whose account_status is any of the statuses of
680INACTIVE_ACCOUNT_STATUSES is part of the vocabulary, though.683INACTIVE_ACCOUNT_STATUSES is part of the vocabulary, though.
681684
682 >>> from canonical.launchpad.interfaces import INACTIVE_ACCOUNT_STATUSES685 >>> from canonical.launchpad.interfaces.account import (
686 ... INACTIVE_ACCOUNT_STATUSES)
683 >>> naked_cprov.merged = None687 >>> naked_cprov.merged = None
684 >>> checked_count = 0688 >>> checked_count = 0
685 >>> for status in INACTIVE_ACCOUNT_STATUSES:689 >>> for status in INACTIVE_ACCOUNT_STATUSES:
@@ -1287,12 +1291,10 @@
12871291
1288Inactive projects and project groups are not available.1292Inactive projects and project groups are not available.
12891293
1290 >>> from canonical.launchpad.ftests import syncUpdate
1291 >>> tomcat = product_set.getByName('tomcat')1294 >>> tomcat = product_set.getByName('tomcat')
1292 >>> tomcat in vocab1295 >>> tomcat in vocab
1293 True1296 True
1294 >>> tomcat.active = False1297 >>> tomcat.active = False
1295 >>> syncUpdate(tomcat)
1296 >>> tomcat in vocab1298 >>> tomcat in vocab
1297 False1299 False
12981300
@@ -1300,7 +1302,6 @@
1300 >>> apache in vocab1302 >>> apache in vocab
1301 True1303 True
1302 >>> apache.active = False1304 >>> apache.active = False
1303 >>> syncUpdate(apache)
1304 >>> apache in vocab1305 >>> apache in vocab
1305 False1306 False
13061307
@@ -1349,7 +1350,8 @@
1349 thunderbird Mozilla Thunderbird Mozilla Thunderbird (Product)1350 thunderbird Mozilla Thunderbird Mozilla Thunderbird (Product)
1350 ubuntu Ubuntu Ubuntu Linux (Distribution)1351 ubuntu Ubuntu Ubuntu Linux (Distribution)
13511352
1352 >>> from canonical.launchpad.interfaces import ILaunchpadCelebrities1353 >>> from canonical.launchpad.interfaces.launchpad import (
1354 ... ILaunchpadCelebrities)
1353 >>> ubuntu = getUtility(ILaunchpadCelebrities).ubuntu1355 >>> ubuntu = getUtility(ILaunchpadCelebrities).ubuntu
1354 >>> ubuntu in featured_project_vocabulary1356 >>> ubuntu in featured_project_vocabulary
1355 True1357 True
@@ -1373,7 +1375,7 @@
1373The test data has one project with a proprietary license. Let's1375The test data has one project with a proprietary license. Let's
1374change bzr's so we will get more interesting results.1376change bzr's so we will get more interesting results.
13751377
1376 >>> from canonical.launchpad.interfaces import License1378 >>> from lp.registry.interfaces.product import License
1377 >>> bzr = product_set.getByName('bzr')1379 >>> bzr = product_set.getByName('bzr')
1378 >>> bzr.licenses = [License.OTHER_PROPRIETARY]1380 >>> bzr.licenses = [License.OTHER_PROPRIETARY]
13791381