← Back to team overview

launchpad-reviewers team mailing list archive

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

 

Jonathan Lange has proposed merging lp:~jml/launchpad/remove-interface-import into lp:launchpad/devel.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)


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.
-- 
https://code.launchpad.net/~jml/launchpad/remove-interface-import/+merge/30375
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~jml/launchpad/remove-interface-import into lp:launchpad/devel.
=== 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 @@
 
     >>> from zope.component import getUtility
     >>> from canonical.launchpad.webapp import canonical_url
-    >>> from canonical.launchpad.interfaces import ILaunchpadCelebrities
+    >>> from canonical.launchpad.interfaces.launchpad import (
+    ...     ILaunchpadCelebrities)
     >>> celebs = getUtility(ILaunchpadCelebrities)
 
 The examples are divided into sections by theme.  Each section starts with
@@ -20,10 +21,10 @@
 
 == Application homepages ==
 
-    >>> from canonical.launchpad.interfaces import (
-    ...     IMaloneApplication, IBazaarApplication,
-    ...     ILaunchpadRoot, IQuestionSet
-    ...     )
+    >>> from canonical.launchpad.interfaces.launchpad import IBazaarApplication
+    >>> from canonical.launchpad.webapp.interfaces import ILaunchpadRoot
+    >>> from lp.answers.interfaces.questioncollection import IQuestionSet
+    >>> from lp.bugs.interfaces.malone import IMaloneApplication
 
 The Launchpad homepage.
 

=== 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 @@
 = Registry vocabularies =
 
-    >>> from canonical.launchpad.ftests import login
-    >>> from canonical.launchpad.interfaces import (
-    ...     IPersonSet, IOpenLaunchBag, IProductSet, IProjectGroupSet)
     >>> from canonical.database.sqlbase import flush_database_updates
+    >>> from canonical.launchpad.webapp.interfaces import IOpenLaunchBag
+    >>> from lp.registry.interfaces.person import IPersonSet
+    >>> from lp.registry.interfaces.product import IProductSet
+    >>> from lp.registry.interfaces.projectgroup import IProjectGroupSet
+    >>> from lp.testing import login
     >>> person_set = getUtility(IPersonSet)
     >>> product_set = getUtility(IProductSet)
     >>> login('foo.bar@xxxxxxxxxxxxx')
@@ -50,8 +52,9 @@
     >>> personset = getUtility(IPersonSet)
     >>> ddaa = personset.getByName('ddaa')
     >>> carlos = personset.getByName('carlos')
-    >>> from canonical.launchpad.interfaces import (
-    ...     IMailingListSet, MailingListStatus, TeamSubscriptionPolicy)
+    >>> from lp.registry.interfaces.mailinglist import (
+    ...     IMailingListSet, MailingListStatus)
+    >>> from lp.registry.interfaces.person import TeamSubscriptionPolicy
     >>> team_one = personset.newTeam(
     ...     ddaa, 'bass-players', 'Bass Players',
     ...     subscriptionpolicy=TeamSubscriptionPolicy.OPEN)
@@ -257,7 +260,7 @@
 The PersonActiveMembership vocabulary only shows teams where the
 membership is public.
 
-    >>> from canonical.launchpad.interfaces import PersonVisibility
+    >>> from lp.registry.interfaces.person import PersonVisibility
     >>> pubteam = factory.makeTeam(owner=foo_bar, name='public-team',
     ...                            displayname="Public Team",
     ...                            visibility=PersonVisibility.PUBLIC)
@@ -350,7 +353,7 @@
     >>> len(milestones)
     0
 
-    >>> from canonical.launchpad.interfaces import IMaloneApplication
+    >>> from lp.bugs.interfaces.malone import IMaloneApplication
     >>> malone = getUtility(IMaloneApplication)
     >>> milestones = get_naked_vocab(malone, 'Milestone')
     >>> len(milestones)
@@ -395,7 +398,7 @@
 If the context is a bugtask, only the bugtask's target's milestones are
 in the vocabulary.
 
-    >>> from canonical.launchpad.interfaces import IBugSet
+    >>> from lp.bugs.interfaces.bug import IBugSet
     >>> bug_one = getUtility(IBugSet).get(1)
     >>> firefox_task = bug_one.bugtasks[0]
     >>> firefox_task.bugtargetdisplayname
@@ -523,7 +526,7 @@
 
   The ProjectGroupVocabulary does not list inactive projects.
 
-    >>> from canonical.launchpad.interfaces import IProjectGroupSet
+    >>> from lp.registry.interfaces.projectgroup import IProjectGroupSet
     >>> moz_project = getUtility(IProjectGroupSet)['mozilla']
     >>> moz_project in project_vocabulary
     True
@@ -647,7 +650,7 @@
 
 A person with a single and unvalidated email address can be merged.
 
-    >>> from canonical.launchpad.interfaces import PersonCreationRationale
+    >>> from lp.registry.interfaces.person import PersonCreationRationale
     >>> fooperson, email = person_set.createPersonAndEmail(
     ...     'foobaz@xxxxxxx', PersonCreationRationale.UNKNOWN,
     ...     name='foobaz', displayname='foo baz')
@@ -679,7 +682,8 @@
 A person whose account_status is any of the statuses of
 INACTIVE_ACCOUNT_STATUSES is part of the vocabulary, though.
 
-    >>> from canonical.launchpad.interfaces import INACTIVE_ACCOUNT_STATUSES
+    >>> from canonical.launchpad.interfaces.account import (
+    ...     INACTIVE_ACCOUNT_STATUSES)
     >>> naked_cprov.merged = None
     >>> checked_count = 0
     >>> for status in INACTIVE_ACCOUNT_STATUSES:
@@ -1287,12 +1291,10 @@
 
 Inactive projects and project groups are not available.
 
-    >>> from canonical.launchpad.ftests import syncUpdate
     >>> tomcat = product_set.getByName('tomcat')
     >>> tomcat in vocab
     True
     >>> tomcat.active = False
-    >>> syncUpdate(tomcat)
     >>> tomcat in vocab
     False
 
@@ -1300,7 +1302,6 @@
     >>> apache in vocab
     True
     >>> apache.active = False
-    >>> syncUpdate(apache)
     >>> apache in vocab
     False
 
@@ -1349,7 +1350,8 @@
     thunderbird     Mozilla Thunderbird  Mozilla Thunderbird (Product)
     ubuntu          Ubuntu               Ubuntu Linux (Distribution)
 
-    >>> from canonical.launchpad.interfaces import ILaunchpadCelebrities
+    >>> from canonical.launchpad.interfaces.launchpad import (
+    ...     ILaunchpadCelebrities)
     >>> ubuntu = getUtility(ILaunchpadCelebrities).ubuntu
     >>> ubuntu in featured_project_vocabulary
     True
@@ -1373,7 +1375,7 @@
 The test data has one project with a proprietary license.  Let's
 change bzr's so we will get more interesting results.
 
-    >>> from canonical.launchpad.interfaces import License
+    >>> from lp.registry.interfaces.product import License
     >>> bzr = product_set.getByName('bzr')
     >>> bzr.licenses = [License.OTHER_PROPRIETARY]