launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #06861
[Merge] lp:~stevenk/launchpad/imports-once-more-with-feeling into lp:launchpad
Steve Kowalik has proposed merging lp:~stevenk/launchpad/imports-once-more-with-feeling into lp:launchpad.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~stevenk/launchpad/imports-once-more-with-feeling/+merge/98944
While working on a different branch, I noticed some files that put multiple imports on one line, which is against our coding standards. I have gone through and fixed the ones under lib/lp, and then ran format-imports for good measure.
--
https://code.launchpad.net/~stevenk/launchpad/imports-once-more-with-feeling/+merge/98944
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~stevenk/launchpad/imports-once-more-with-feeling into lp:launchpad.
=== modified file 'lib/lp/blueprints/tests/test_workitem_migration.py'
--- lib/lp/blueprints/tests/test_workitem_migration.py 2012-03-02 16:49:21 +0000
+++ lib/lp/blueprints/tests/test_workitem_migration.py 2012-03-23 00:16:22 +0000
@@ -5,15 +5,13 @@
from textwrap import dedent
-from testtools.matchers import (
- MatchesStructure,
- )
+from testtools.matchers import MatchesStructure
from lp.blueprints.enums import SpecificationWorkItemStatus
from lp.blueprints.workitemmigration import (
extractWorkItemsFromWhiteboard,
+ WorkItemParseError,
WorkitemParser,
- WorkItemParseError,
)
from lp.testing import (
TestCase,
=== modified file 'lib/lp/blueprints/workitemmigration.py'
--- lib/lp/blueprints/workitemmigration.py 2012-03-02 16:49:21 +0000
+++ lib/lp/blueprints/workitemmigration.py 2012-03-23 00:16:22 +0000
@@ -18,7 +18,6 @@
from zope.security.proxy import removeSecurityProxy
from lp.blueprints.enums import SpecificationWorkItemStatus
-
from lp.registry.interfaces.person import IPersonSet
=== modified file 'lib/lp/bugs/scripts/bugexport.py'
--- lib/lp/bugs/scripts/bugexport.py 2011-12-22 05:37:22 +0000
+++ lib/lp/bugs/scripts/bugexport.py 2012-03-23 00:16:22 +0000
@@ -18,7 +18,10 @@
from zope.component import getUtility
from lp.app.interfaces.launchpad import ILaunchpadCelebrities
from lp.services.librarian.browser import ProxiedLibraryFileAlias
-from lp.bugs.interfaces.bugtask import BugTaskSearchParams, IBugTaskSet
+from lp.bugs.interfaces.bugtask import (
+ BugTaskSearchParams,
+ IBugTaskSet,
+ )
from lp.bugs.browser.bugtask import get_comments_for_bugtask
BUGS_XMLNS = 'https://launchpad.net/xmlns/2006/bugs'
=== modified file 'lib/lp/bugs/scripts/bugimport.py'
--- lib/lp/bugs/scripts/bugimport.py 2012-03-16 03:50:33 +0000
+++ lib/lp/bugs/scripts/bugimport.py 2012-03-23 00:16:22 +0000
@@ -40,15 +40,29 @@
from lp.app.interfaces.launchpad import ILaunchpadCelebrities
from lp.services.librarian.interfaces import ILibraryFileAliasSet
from lp.services.messages.interfaces.message import IMessageSet
-from lp.bugs.interfaces.bug import CreateBugParams, IBugSet
+from lp.bugs.interfaces.bug import (
+ CreateBugParams,
+ IBugSet,
+ )
from lp.bugs.interfaces.bugactivity import IBugActivitySet
from lp.bugs.interfaces.bugattachment import (
- BugAttachmentType, IBugAttachmentSet)
-from lp.bugs.interfaces.bugtask import BugTaskImportance, BugTaskStatus
+ BugAttachmentType,
+ IBugAttachmentSet,
+ )
+from lp.bugs.interfaces.bugtask import (
+ BugTaskImportance,
+ BugTaskStatus,
+ )
from lp.bugs.interfaces.bugtracker import IBugTrackerSet
-from lp.bugs.interfaces.bugwatch import IBugWatchSet, NoBugTrackerFound
+from lp.bugs.interfaces.bugwatch import (
+ IBugWatchSet,
+ NoBugTrackerFound,
+ )
from lp.bugs.interfaces.cve import ICveSet
-from lp.registry.interfaces.person import IPersonSet, PersonCreationRationale
+from lp.registry.interfaces.person import (
+ IPersonSet,
+ PersonCreationRationale,
+ )
from lp.bugs.scripts.bugexport import BUGS_XMLNS
=== modified file 'lib/lp/code/browser/branch.py'
--- lib/lp/code/browser/branch.py 2012-03-07 00:58:37 +0000
+++ lib/lp/code/browser/branch.py 2012-03-23 00:16:22 +0000
@@ -121,9 +121,7 @@
from lp.code.interfaces.branchmergeproposal import IBranchMergeProposal
from lp.code.interfaces.branchnamespace import IBranchNamespacePolicy
from lp.code.interfaces.codereviewvote import ICodeReviewVoteReference
-from lp.registry.interfaces.person import (
- IPersonSet,
- )
+from lp.registry.interfaces.person import IPersonSet
from lp.registry.interfaces.productseries import IProductSeries
from lp.registry.vocabularies import UserTeamsParticipationPlusSelfVocabulary
from lp.services import searchbuilder
=== modified file 'lib/lp/code/bzr.py'
--- lib/lp/code/bzr.py 2012-02-24 16:51:25 +0000
+++ lib/lp/code/bzr.py 2012-03-23 00:16:22 +0000
@@ -18,6 +18,7 @@
# FIRST Ensure correct plugins are loaded. Do not delete this comment or the
# line below this comment.
import lp.codehosting
+
# Silence lint warning.
lp.codehosting
=== modified file 'lib/lp/codehosting/scripts/tests/test_upgrade_all_branches.py'
--- lib/lp/codehosting/scripts/tests/test_upgrade_all_branches.py 2012-03-08 20:18:51 +0000
+++ lib/lp/codehosting/scripts/tests/test_upgrade_all_branches.py 2012-03-23 00:16:22 +0000
@@ -4,15 +4,15 @@
__metaclass__ = type
+import logging
import os.path
-import logging
from bzrlib.repofmt.groupcompress_repo import RepositoryFormat2a
import transaction
from lp.code.bzr import branch_changed
+from lp.codehosting.tests.test_upgrade import upgrade_target
from lp.codehosting.upgrade import Upgrader
-from lp.codehosting.tests.test_upgrade import upgrade_target
from lp.testing import (
person_logged_in,
run_script,
=== modified file 'lib/lp/codehosting/tests/test_upgrade.py'
--- lib/lp/codehosting/tests/test_upgrade.py 2012-03-08 20:18:51 +0000
+++ lib/lp/codehosting/tests/test_upgrade.py 2012-03-23 00:16:22 +0000
@@ -8,23 +8,26 @@
from os.path import dirname
from bzrlib.branch import Branch
-from bzrlib.bzrdir import BzrDir, format_registry
+from bzrlib.bzrdir import (
+ BzrDir,
+ format_registry,
+ )
from bzrlib.plugins.loom.branch import loomify
from bzrlib.repofmt.groupcompress_repo import (
- RepositoryFormat2a, RepositoryFormat2aSubtree)
+ RepositoryFormat2a,
+ RepositoryFormat2aSubtree,
+ )
from bzrlib.revision import NULL_REVISION
from bzrlib.transport import get_transport
from lp.code.bzr import (
+ branch_changed,
BranchFormat,
- branch_changed,
get_branch_formats,
RepositoryFormat,
)
from lp.codehosting.bzrutils import read_locked
-from lp.codehosting.upgrade import (
- Upgrader,
- )
+from lp.codehosting.upgrade import Upgrader
from lp.services.config import config
from lp.testing import (
temp_dir,
=== modified file 'lib/lp/codehosting/upgrade.py'
--- lib/lp/codehosting/upgrade.py 2012-02-07 16:53:15 +0000
+++ lib/lp/codehosting/upgrade.py 2012-03-23 00:16:22 +0000
@@ -18,7 +18,10 @@
from shutil import rmtree
from tempfile import mkdtemp
-from bzrlib.bzrdir import BzrDir, format_registry
+from bzrlib.bzrdir import (
+ BzrDir,
+ format_registry,
+ )
from bzrlib.errors import UpToDateFormat
from bzrlib.plugins.loom.formats import (
NotALoom,
@@ -27,7 +30,6 @@
from bzrlib.repofmt.groupcompress_repo import RepositoryFormat2aSubtree
from bzrlib.upgrade import upgrade
-from lp.services.database.lpstorm import IStore
from lp.code.bzr import (
branch_changed,
RepositoryFormat,
@@ -35,6 +37,7 @@
from lp.code.model.branch import Branch
from lp.codehosting.bzrutils import read_locked
from lp.codehosting.vfs.branchfs import get_real_branch_path
+from lp.services.database.lpstorm import IStore
class AlreadyUpgraded(Exception):
=== modified file 'lib/lp/registry/browser/pillar.py'
--- lib/lp/registry/browser/pillar.py 2012-03-22 22:30:38 +0000
+++ lib/lp/registry/browser/pillar.py 2012-03-23 00:16:22 +0000
@@ -16,11 +16,10 @@
from operator import attrgetter
-import simplejson
from lazr.restful import ResourceJSONEncoder
from lazr.restful.interfaces import IJSONRequestCache
-
+import simplejson
from zope.component import getUtility
from zope.interface import (
implements,
@@ -32,11 +31,11 @@
from lp.app.browser.launchpad import iter_view_registrations
from lp.app.browser.tales import MenuAPI
+from lp.app.browser.vocabulary import vocabulary_filters
from lp.app.enums import (
service_uses_launchpad,
ServiceUsage,
)
-from lp.app.browser.vocabulary import vocabulary_filters
from lp.app.interfaces.launchpad import IServiceUsage
from lp.app.interfaces.services import IService
from lp.bugs.browser.structuralsubscription import (
@@ -50,13 +49,13 @@
IDistributionSourcePackage,
)
from lp.registry.interfaces.distroseries import IDistroSeries
+from lp.registry.interfaces.person import IPersonSet
from lp.registry.interfaces.pillar import IPillar
from lp.registry.interfaces.projectgroup import IProjectGroup
-from lp.registry.interfaces.person import IPersonSet
from lp.registry.model.pillar import PillarPerson
from lp.services.config import config
+from lp.services.features import getFeatureFlag
from lp.services.propertycache import cachedproperty
-from lp.services.features import getFeatureFlag
from lp.services.webapp.authorization import check_permission
from lp.services.webapp.batching import (
BatchNavigator,
=== modified file 'lib/lp/registry/browser/product.py'
--- lib/lp/registry/browser/product.py 2012-03-19 13:47:09 +0000
+++ lib/lp/registry/browser/product.py 2012-03-23 00:16:22 +0000
@@ -194,9 +194,7 @@
from lp.services.webapp.authorization import check_permission
from lp.services.webapp.batching import BatchNavigator
from lp.services.webapp.breadcrumb import Breadcrumb
-from lp.services.webapp.interfaces import (
- UnsafeFormGetSubmissionError,
- )
+from lp.services.webapp.interfaces import UnsafeFormGetSubmissionError
from lp.services.webapp.menu import NavigationMenu
from lp.services.worlddata.helpers import browser_languages
from lp.services.worlddata.interfaces.country import ICountry
=== modified file 'lib/lp/registry/browser/tests/test_pillar_sharing.py'
--- lib/lp/registry/browser/tests/test_pillar_sharing.py 2012-03-22 22:30:38 +0000
+++ lib/lp/registry/browser/tests/test_pillar_sharing.py 2012-03-23 00:16:22 +0000
@@ -5,10 +5,9 @@
__metaclass__ = type
-import simplejson
-
from BeautifulSoup import BeautifulSoup
from lazr.restful.interfaces import IJSONRequestCache
+import simplejson
from testtools.matchers import (
LessThan,
MatchesException,
=== modified file 'lib/lp/registry/interfaces/productjob.py'
--- lib/lp/registry/interfaces/productjob.py 2012-03-19 20:22:48 +0000
+++ lib/lp/registry/interfaces/productjob.py 2012-03-23 00:16:22 +0000
@@ -17,7 +17,6 @@
from lp import _
from lp.registry.interfaces.product import IProduct
-
from lp.services.job.interfaces.job import (
IJob,
IJobSource,
=== modified file 'lib/lp/registry/interfaces/webservice.py'
--- lib/lp/registry/interfaces/webservice.py 2012-03-08 03:12:23 +0000
+++ lib/lp/registry/interfaces/webservice.py 2012-03-23 00:16:22 +0000
@@ -44,7 +44,6 @@
# import bugs. Break this up into a per-package thing.
from lp import _schema_circular_imports
from lp.app.interfaces.services import IServiceFactory
-from lp.registry.interfaces.sharingservice import ISharingService
from lp.registry.interfaces.commercialsubscription import (
ICommercialSubscription,
)
@@ -98,6 +97,7 @@
IProjectGroup,
IProjectGroupSet,
)
+from lp.registry.interfaces.sharingservice import ISharingService
from lp.registry.interfaces.sourcepackage import ISourcePackage
from lp.registry.interfaces.sourcepackagename import ISourcePackageName
from lp.registry.interfaces.ssh import ISSHKey
=== modified file 'lib/lp/registry/model/productjob.py'
--- lib/lp/registry/model/productjob.py 2012-03-19 20:36:29 +0000
+++ lib/lp/registry/model/productjob.py 2012-03-23 00:16:22 +0000
@@ -10,9 +10,7 @@
from lazr.delegates import delegates
import simplejson
-from storm.expr import (
- And,
- )
+from storm.expr import And
from storm.locals import (
Int,
Reference,
@@ -24,9 +22,7 @@
)
from lp.registry.enums import ProductJobType
-from lp.registry.interfaces.product import (
- IProduct,
- )
+from lp.registry.interfaces.product import IProduct
from lp.registry.interfaces.productjob import (
IProductJob,
IProductJobSource,
=== modified file 'lib/lp/registry/services/sharingservice.py'
--- lib/lp/registry/services/sharingservice.py 2012-03-22 09:00:36 +0000
+++ lib/lp/registry/services/sharingservice.py 2012-03-23 00:16:22 +0000
@@ -10,7 +10,6 @@
from lazr.restful.interfaces import IWebBrowserOriginatingRequest
from lazr.restful.utils import get_current_web_service_request
-
from zope.component import getUtility
from zope.interface import implements
from zope.security.interfaces import Unauthorized
@@ -22,13 +21,13 @@
)
from lp.registry.interfaces.accesspolicy import (
IAccessArtifactGrantSource,
- IAccessPolicySource,
IAccessPolicyGrantFlatSource,
IAccessPolicyGrantSource,
+ IAccessPolicySource,
)
-from lp.registry.interfaces.sharingservice import ISharingService
from lp.registry.interfaces.product import IProduct
from lp.registry.interfaces.projectgroup import IProjectGroup
+from lp.registry.interfaces.sharingservice import ISharingService
from lp.registry.model.person import Person
from lp.services.features import getFeatureFlag
from lp.services.webapp.authorization import available_with_permission
=== modified file 'lib/lp/registry/subscribers.py'
--- lib/lp/registry/subscribers.py 2012-03-20 14:59:48 +0000
+++ lib/lp/registry/subscribers.py 2012-03-23 00:16:22 +0000
@@ -12,7 +12,6 @@
import textwrap
import pytz
-
from zope.security.proxy import removeSecurityProxy
from lp.registry.interfaces.person import IPerson
=== modified file 'lib/lp/registry/tests/test_pillar.py'
--- lib/lp/registry/tests/test_pillar.py 2012-03-09 19:46:33 +0000
+++ lib/lp/registry/tests/test_pillar.py 2012-03-23 00:16:22 +0000
@@ -10,7 +10,6 @@
IPillarPerson,
)
from lp.registry.model.pillar import PillarPerson
-
from lp.testing import (
login,
TestCaseWithFactory,
=== modified file 'lib/lp/registry/tests/test_productjob.py'
--- lib/lp/registry/tests/test_productjob.py 2012-03-19 20:18:41 +0000
+++ lib/lp/registry/tests/test_productjob.py 2012-03-23 00:16:22 +0000
@@ -11,7 +11,6 @@
)
import pytz
-
from zope.interface import (
classProvides,
implements,
=== modified file 'lib/lp/registry/tests/test_subscribers.py'
--- lib/lp/registry/tests/test_subscribers.py 2012-03-20 14:59:48 +0000
+++ lib/lp/registry/tests/test_subscribers.py 2012-03-23 00:16:22 +0000
@@ -7,10 +7,9 @@
from datetime import datetime
+from lazr.lifecycle.event import ObjectModifiedEvent
import pytz
-
from zope.security.proxy import removeSecurityProxy
-from lazr.lifecycle.event import ObjectModifiedEvent
from lp.registry.interfaces.product import License
from lp.registry.subscribers import (
=== modified file 'lib/lp/scripts/utilities/warninghandler.py'
--- lib/lp/scripts/utilities/warninghandler.py 2011-06-23 12:23:05 +0000
+++ lib/lp/scripts/utilities/warninghandler.py 2012-03-23 00:16:22 +0000
@@ -58,7 +58,10 @@
return '\n'.join(L)
# PageTemplateFile has .filename.
-from z3c.ptcompat import PageTemplateFile, ViewPageTemplateFile
+from z3c.ptcompat import (
+ PageTemplateFile,
+ ViewPageTemplateFile,
+ )
# PythonExpr has .text, the text of the expression.
from zope.tales.pythonexpr import PythonExpr
=== modified file 'lib/lp/services/enterpriseid.py'
--- lib/lp/services/enterpriseid.py 2012-03-05 08:15:08 +0000
+++ lib/lp/services/enterpriseid.py 2012-03-23 00:16:22 +0000
@@ -14,6 +14,7 @@
from lp.registry.model.person import Person
from lp.services.config import config
+
known_types = {
'Person': Person,
}
=== modified file 'lib/lp/services/feeds/tests/helper.py'
--- lib/lp/services/feeds/tests/helper.py 2011-12-24 17:49:30 +0000
+++ lib/lp/services/feeds/tests/helper.py 2012-03-23 00:16:22 +0000
@@ -26,7 +26,11 @@
from cStringIO import StringIO
from textwrap import wrap
-from zope.interface import implements, Interface, Attribute
+from zope.interface import (
+ Attribute,
+ implements,
+ Interface,
+ )
from BeautifulSoup import BeautifulStoneSoup as BSS
from BeautifulSoup import SoupStrainer
=== modified file 'lib/lp/services/scripts/tests/loglevels.py'
--- lib/lp/services/scripts/tests/loglevels.py 2011-12-21 19:44:48 +0000
+++ lib/lp/services/scripts/tests/loglevels.py 2012-03-23 00:16:22 +0000
@@ -20,7 +20,10 @@
from optparse import OptionParser
-from lp.services.scripts.logger import logger, logger_options
+from lp.services.scripts.logger import (
+ logger,
+ logger_options,
+ )
parser = OptionParser()
logger_options(parser)
=== modified file 'lib/lp/services/webapp/authorization.py'
--- lib/lp/services/webapp/authorization.py 2012-03-18 01:26:52 +0000
+++ lib/lp/services/webapp/authorization.py 2012-03-23 00:16:22 +0000
@@ -20,7 +20,10 @@
from zope.proxy import removeAllProxies
from zope.publisher.interfaces import IApplicationRequest
from zope.security.checker import CheckerPublic
-from zope.security.interfaces import ISecurityPolicy, Unauthorized
+from zope.security.interfaces import (
+ ISecurityPolicy,
+ Unauthorized,
+ )
from zope.security.management import (
checkPermission as zcheckPermission,
getInteraction,
=== modified file 'lib/lp/services/webapp/tests/test_session.py'
--- lib/lp/services/webapp/tests/test_session.py 2012-02-29 10:35:12 +0000
+++ lib/lp/services/webapp/tests/test_session.py 2012-03-23 00:16:22 +0000
@@ -6,8 +6,8 @@
from lp.services.webapp.servers import LaunchpadTestRequest
from lp.services.webapp.session import (
+ get_cookie_domain,
LaunchpadCookieClientIdManager,
- get_cookie_domain,
)
=== modified file 'lib/lp/testing/keyserver/testkeyserver.tac'
--- lib/lp/testing/keyserver/testkeyserver.tac 2011-12-29 05:29:36 +0000
+++ lib/lp/testing/keyserver/testkeyserver.tac 2012-03-23 00:16:22 +0000
@@ -4,7 +4,10 @@
# Twisted Application Configuration file.
# Use with "twistd -y <file.tac>", e.g. "twistd -noy server.tac"
-from twisted.application import service, strports
+from twisted.application import (
+ service,
+ strports,
+ )
from twisted.web import server
from lp.services.config import config