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
1=== modified file 'lib/canonical/launchpad/doc/canonical_url_examples.txt'
2--- lib/canonical/launchpad/doc/canonical_url_examples.txt 2010-04-28 22:03:05 +0000
3+++ lib/canonical/launchpad/doc/canonical_url_examples.txt 2010-07-20 10:27:55 +0000
4@@ -9,7 +9,8 @@
5
6 >>> from zope.component import getUtility
7 >>> from canonical.launchpad.webapp import canonical_url
8- >>> from canonical.launchpad.interfaces import ILaunchpadCelebrities
9+ >>> from canonical.launchpad.interfaces.launchpad import (
10+ ... ILaunchpadCelebrities)
11 >>> celebs = getUtility(ILaunchpadCelebrities)
12
13 The examples are divided into sections by theme. Each section starts with
14@@ -20,10 +21,10 @@
15
16 == Application homepages ==
17
18- >>> from canonical.launchpad.interfaces import (
19- ... IMaloneApplication, IBazaarApplication,
20- ... ILaunchpadRoot, IQuestionSet
21- ... )
22+ >>> from canonical.launchpad.interfaces.launchpad import IBazaarApplication
23+ >>> from canonical.launchpad.webapp.interfaces import ILaunchpadRoot
24+ >>> from lp.answers.interfaces.questioncollection import IQuestionSet
25+ >>> from lp.bugs.interfaces.malone import IMaloneApplication
26
27 The Launchpad homepage.
28
29
30=== modified file 'lib/lp/registry/doc/vocabularies.txt'
31--- lib/lp/registry/doc/vocabularies.txt 2010-07-14 15:59:44 +0000
32+++ lib/lp/registry/doc/vocabularies.txt 2010-07-20 10:27:55 +0000
33@@ -1,9 +1,11 @@
34 = Registry vocabularies =
35
36- >>> from canonical.launchpad.ftests import login
37- >>> from canonical.launchpad.interfaces import (
38- ... IPersonSet, IOpenLaunchBag, IProductSet, IProjectGroupSet)
39 >>> from canonical.database.sqlbase import flush_database_updates
40+ >>> from canonical.launchpad.webapp.interfaces import IOpenLaunchBag
41+ >>> from lp.registry.interfaces.person import IPersonSet
42+ >>> from lp.registry.interfaces.product import IProductSet
43+ >>> from lp.registry.interfaces.projectgroup import IProjectGroupSet
44+ >>> from lp.testing import login
45 >>> person_set = getUtility(IPersonSet)
46 >>> product_set = getUtility(IProductSet)
47 >>> login('foo.bar@canonical.com')
48@@ -50,8 +52,9 @@
49 >>> personset = getUtility(IPersonSet)
50 >>> ddaa = personset.getByName('ddaa')
51 >>> carlos = personset.getByName('carlos')
52- >>> from canonical.launchpad.interfaces import (
53- ... IMailingListSet, MailingListStatus, TeamSubscriptionPolicy)
54+ >>> from lp.registry.interfaces.mailinglist import (
55+ ... IMailingListSet, MailingListStatus)
56+ >>> from lp.registry.interfaces.person import TeamSubscriptionPolicy
57 >>> team_one = personset.newTeam(
58 ... ddaa, 'bass-players', 'Bass Players',
59 ... subscriptionpolicy=TeamSubscriptionPolicy.OPEN)
60@@ -257,7 +260,7 @@
61 The PersonActiveMembership vocabulary only shows teams where the
62 membership is public.
63
64- >>> from canonical.launchpad.interfaces import PersonVisibility
65+ >>> from lp.registry.interfaces.person import PersonVisibility
66 >>> pubteam = factory.makeTeam(owner=foo_bar, name='public-team',
67 ... displayname="Public Team",
68 ... visibility=PersonVisibility.PUBLIC)
69@@ -350,7 +353,7 @@
70 >>> len(milestones)
71 0
72
73- >>> from canonical.launchpad.interfaces import IMaloneApplication
74+ >>> from lp.bugs.interfaces.malone import IMaloneApplication
75 >>> malone = getUtility(IMaloneApplication)
76 >>> milestones = get_naked_vocab(malone, 'Milestone')
77 >>> len(milestones)
78@@ -395,7 +398,7 @@
79 If the context is a bugtask, only the bugtask's target's milestones are
80 in the vocabulary.
81
82- >>> from canonical.launchpad.interfaces import IBugSet
83+ >>> from lp.bugs.interfaces.bug import IBugSet
84 >>> bug_one = getUtility(IBugSet).get(1)
85 >>> firefox_task = bug_one.bugtasks[0]
86 >>> firefox_task.bugtargetdisplayname
87@@ -523,7 +526,7 @@
88
89 The ProjectGroupVocabulary does not list inactive projects.
90
91- >>> from canonical.launchpad.interfaces import IProjectGroupSet
92+ >>> from lp.registry.interfaces.projectgroup import IProjectGroupSet
93 >>> moz_project = getUtility(IProjectGroupSet)['mozilla']
94 >>> moz_project in project_vocabulary
95 True
96@@ -647,7 +650,7 @@
97
98 A person with a single and unvalidated email address can be merged.
99
100- >>> from canonical.launchpad.interfaces import PersonCreationRationale
101+ >>> from lp.registry.interfaces.person import PersonCreationRationale
102 >>> fooperson, email = person_set.createPersonAndEmail(
103 ... 'foobaz@bar.com', PersonCreationRationale.UNKNOWN,
104 ... name='foobaz', displayname='foo baz')
105@@ -679,7 +682,8 @@
106 A person whose account_status is any of the statuses of
107 INACTIVE_ACCOUNT_STATUSES is part of the vocabulary, though.
108
109- >>> from canonical.launchpad.interfaces import INACTIVE_ACCOUNT_STATUSES
110+ >>> from canonical.launchpad.interfaces.account import (
111+ ... INACTIVE_ACCOUNT_STATUSES)
112 >>> naked_cprov.merged = None
113 >>> checked_count = 0
114 >>> for status in INACTIVE_ACCOUNT_STATUSES:
115@@ -1287,12 +1291,10 @@
116
117 Inactive projects and project groups are not available.
118
119- >>> from canonical.launchpad.ftests import syncUpdate
120 >>> tomcat = product_set.getByName('tomcat')
121 >>> tomcat in vocab
122 True
123 >>> tomcat.active = False
124- >>> syncUpdate(tomcat)
125 >>> tomcat in vocab
126 False
127
128@@ -1300,7 +1302,6 @@
129 >>> apache in vocab
130 True
131 >>> apache.active = False
132- >>> syncUpdate(apache)
133 >>> apache in vocab
134 False
135
136@@ -1349,7 +1350,8 @@
137 thunderbird Mozilla Thunderbird Mozilla Thunderbird (Product)
138 ubuntu Ubuntu Ubuntu Linux (Distribution)
139
140- >>> from canonical.launchpad.interfaces import ILaunchpadCelebrities
141+ >>> from canonical.launchpad.interfaces.launchpad import (
142+ ... ILaunchpadCelebrities)
143 >>> ubuntu = getUtility(ILaunchpadCelebrities).ubuntu
144 >>> ubuntu in featured_project_vocabulary
145 True
146@@ -1373,7 +1375,7 @@
147 The test data has one project with a proprietary license. Let's
148 change bzr's so we will get more interesting results.
149
150- >>> from canonical.launchpad.interfaces import License
151+ >>> from lp.registry.interfaces.product import License
152 >>> bzr = product_set.getByName('bzr')
153 >>> bzr.licenses = [License.OTHER_PROPRIETARY]
154