← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~jtv/launchpad/megalint-5 into lp:launchpad

 

Jeroen T. Vermeulen has proposed merging lp:~jtv/launchpad/megalint-5 into lp:launchpad.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~jtv/launchpad/megalint-5/+merge/82106

= Summary =

Removing lint in files that we touched.  This is lint that has no right to exist.  Please everybody, run these tools against your changes _before_ committing or they will miss changes!

 * “make lint”
 * “./utilities/update-copyright”
 * “./utilities/format-new-and-modified-imports”


= Launchpad lint =

There are always a few places where I dare not fix the lint.  We should be getting to a state where this kind of lint will stand out, and then we will do something about it.  Such as migrate doctests to unit tests, where the subtleties of syntax are easier to understand.


Checking for conflicts and issues in changed files.

Linting changed files:
  lib/lp/services/mailman/monkeypatches/__init__.py
  lib/lp/soyuz/model/buildfarmbuildjob.py
  lib/lp/codehosting/codeimport/worker.py
  lib/lp/translations/tests/test_translationmerger.py
  lib/lp/buildmaster/enums.py
  lib/lp/soyuz/tests/test_build.py
  lib/lp/soyuz/model/packagecopyjob.py
  lib/lp/bugs/templates/bugtask-delete.pt
  lib/lp/app/doc/displaying-paragraphs-of-text.txt
  lib/lp/soyuz/stories/ppa/xx-copy-packages.txt
  lib/lp/bugs/errors.py
  lib/lp/buildmaster/model/buildqueue.py
  lib/lp/testing/fixture.py
  lib/lp/bugs/model/bug.py
  lib/lp/bugs/doc/bug.txt
  lib/lp/bugs/javascript/bugtask_index.js
  lib/lp/registry/interfaces/distribution.py
  lib/lp/soyuz/stories/webservice/xx-builds.txt
  lib/lp/bugs/doc/externalbugtracker.txt
  lib/lp/bugs/browser/bugsubscription.py
  lib/devscripts/ec2test/testrunner.py
  lib/lp/codehosting/puller/tests/test_errors.py
  lib/lp/codehosting/tests/test_bzrutils.py
  lib/lp/translations/browser/tests/test_sharing_details.py
  lib/lp/code/model/branchmergeproposaljob.py
  lib/lp/codehosting/puller/tests/test_worker.py
  lib/canonical/launchpad/scripts/runlaunchpad.py
  lib/lp/codehosting/codeimport/tests/test_worker.py
  lib/lp/registry/browser/tests/test_milestone.py
  lib/lp/registry/tests/test_distribution.py
  lib/lp/registry/model/oopsreferences.py
  lib/lp/bugs/stories/bugs/xx-bug-index-lots-of-comments.txt
  lib/lp/bugs/stories/bugtask-management/xx-bugtask-edit-forms.txt
  lib/lp/bugs/stories/bugs/xx-bug-index.txt
  lib/lp/registry/tests/test_product.py
  lib/lp/buildmaster/tests/test_buildqueue.py

./lib/lp/app/doc/displaying-paragraphs-of-text.txt
      53: want exceeds 78 characters.
      87: want exceeds 78 characters.
      88: want exceeds 78 characters.
      90: want exceeds 78 characters.
      91: want exceeds 78 characters.
     106: want exceeds 78 characters.
     107: want exceeds 78 characters.
     108: want exceeds 78 characters.
     109: want exceeds 78 characters.
     110: want exceeds 78 characters.
     111: want exceeds 78 characters.
     161: want exceeds 78 characters.
     162: want exceeds 78 characters.
     163: want exceeds 78 characters.
     164: want exceeds 78 characters.
     165: want exceeds 78 characters.
     166: want exceeds 78 characters.
     167: want exceeds 78 characters.
     168: want exceeds 78 characters.
     169: want exceeds 78 characters.
     170: want exceeds 78 characters.
     171: want exceeds 78 characters.
     172: want exceeds 78 characters.
     173: want exceeds 78 characters.
     174: want exceeds 78 characters.
     175: want exceeds 78 characters.
     176: want exceeds 78 characters.
     177: want exceeds 78 characters.
     178: want exceeds 78 characters.
     179: want exceeds 78 characters.
     180: want exceeds 78 characters.
     181: want exceeds 78 characters.
     182: want exceeds 78 characters.
     183: want exceeds 78 characters.
     184: want exceeds 78 characters.
     185: want exceeds 78 characters.
     186: want exceeds 78 characters.
     187: want exceeds 78 characters.
     188: want exceeds 78 characters.
     189: want exceeds 78 characters.
     190: want exceeds 78 characters.
     191: want exceeds 78 characters.
     192: want exceeds 78 characters.
     193: want exceeds 78 characters.
     194: want exceeds 78 characters.
     195: want exceeds 78 characters.
     196: want exceeds 78 characters.
     197: want exceeds 78 characters.
     282: want exceeds 78 characters.
     288: want exceeds 78 characters.
     370: want exceeds 78 characters.
     372: want exceeds 78 characters.
     434: want exceeds 78 characters.
     440: want exceeds 78 characters.
     444: want exceeds 78 characters.
     448: want exceeds 78 characters.
-- 
https://code.launchpad.net/~jtv/launchpad/megalint-5/+merge/82106
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~jtv/launchpad/megalint-5 into lp:launchpad.
=== modified file 'lib/canonical/launchpad/scripts/runlaunchpad.py'
--- lib/canonical/launchpad/scripts/runlaunchpad.py	2011-11-03 22:13:25 +0000
+++ lib/canonical/launchpad/scripts/runlaunchpad.py	2011-11-14 08:41:25 +0000
@@ -368,15 +368,16 @@
         # here because we need to control fixtures within this process, and
         # because we want interactive tests to be as similar as possible to
         # tests run in the testrunner.
-        # Note that this changes the config instance-name, with the result that
-        # the configuration of utilities may become invalidated.
-        # XXX: Robert Collins - see bug 883980 about this. In short, we should
-        # inherit the other services from the test runner, rather than
-        # duplicating the work of test setup within the slave appserver. That
-        # will permit reuse of the librarian, DB, rabbit etc and
-        # correspondingly easier assertions and inspection of interactions with
-        # other services. That would mean we do not need to setup rabbit or the
-        # librarian here : the test runner would control and take care of that.
+        # Note that this changes the config instance-name, with the result
+        # that the configuration of utilities may become invalidated.
+        # XXX Robert Collins, bug=883980: In short, we should derive the
+        # other services from the test runner, rather than duplicating
+        # the work of test setup within the slave appserver. That will
+        # permit reuse of the librarian, DB, rabbit etc, and
+        # correspondingly easier assertions and inspection of interactions
+        # with other services. That would mean we do not need to set up rabbit
+        # or the librarian here: the test runner would control and take care
+        # of that.
         BaseLayer.setUp()
         teardowns.append(BaseLayer.tearDown)
         RabbitMQLayer.setUp()

=== modified file 'lib/devscripts/ec2test/testrunner.py'
--- lib/devscripts/ec2test/testrunner.py	2011-11-13 21:23:00 +0000
+++ lib/devscripts/ec2test/testrunner.py	2011-11-14 08:41:25 +0000
@@ -1,4 +1,4 @@
-# Copyright 2009 Canonical Ltd.  This software is licensed under the
+# Copyright 2009-2011 Canonical Ltd.  This software is licensed under the
 # GNU Affero General Public License version 3 (see the file LICENSE).
 
 """Code to actually run the tests in an EC2 instance."""
@@ -19,7 +19,9 @@
 from bzrlib.config import GlobalConfig
 from bzrlib.errors import UncommittedChanges
 from bzrlib.plugins.pqm.pqm_submit import (
-    NoPQMSubmissionAddress, PQMSubmission)
+    NoPQMSubmissionAddress,
+    PQMSubmission,
+    )
 
 
 TRUNK_BRANCH = 'bzr+ssh://bazaar.launchpad.net/~launchpad-pqm/launchpad/devel'
@@ -199,7 +201,7 @@
                         pqm_submit_location = trunk_branch
                 elif pqm_submit_location is None and trunk_specified:
                     pqm_submit_location = trunk_branch
-                # modified from pqm_submit.py
+                # Modified from pqm_submit.py.
                 submission = PQMSubmission(
                     source_branch=bzrbranch,
                     public_location=pqm_public_location,
@@ -207,14 +209,14 @@
                     submit_location=pqm_submit_location,
                     tree=tree)
                 if tree is not None:
-                    # this is the part we want to do whether or not we're
-                    # submitting.
-                    submission.check_tree() # any working changes
-                    submission.check_public_branch() # everything public
+                    # This is the part we want to do we're submitting or
+                    # not:
+                    submission.check_tree()  # Any working changes.
+                    submission.check_public_branch()  # Everything public.
                     branch = submission.public_location
                     if (include_download_cache_changes is None or
                         include_download_cache_changes):
-                        # We need to get the download cache settings
+                        # We need to get the download cache settings.
                         cache_tree, cache_bzrbranch, cache_relpath = (
                             BzrDir.open_containing_tree_or_branch(
                                 os.path.join(
@@ -239,11 +241,10 @@
                 if pqm_message is not None:
                     if self.download_cache_additions:
                         raise UncommittedChanges(cache_tree)
-                    # get the submission message
+                    # Get the submission message.
                     mail_from = config.get_user_option('pqm_user_email')
                     if not mail_from:
                         mail_from = config.username()
-                    # Make sure this isn't unicode
                     mail_from = mail_from.encode('utf8')
                     if pqm_email is None:
                         if tree is None:
@@ -253,7 +254,7 @@
                             pqm_email = config.get_user_option('pqm_email')
                     if not pqm_email:
                         raise NoPQMSubmissionAddress(bzrbranch)
-                    mail_to = pqm_email.encode('utf8') # same here
+                    mail_to = pqm_email.encode('utf8')
                     self.message = submission.to_email(mail_from, mail_to)
                 elif (self.download_cache_additions and
                       self.include_download_cache_changes is None):
@@ -325,7 +326,8 @@
         as_user("sudo add-apt-repository ppa:bzr")
         as_user("sudo add-apt-repository ppa:launchpad")
         as_user("sudo aptitude update")
-        as_user("sudo DEBIAN_FRONTEND=noninteractive aptitude -y full-upgrade")
+        as_user(
+            "sudo DEBIAN_FRONTEND=noninteractive aptitude -y full-upgrade")
         # Set up bazaar.conf with smtp information if necessary
         if self.email or self.message:
             as_user('[ -d .bazaar ] || mkdir .bazaar')
@@ -384,7 +386,9 @@
         user_connection.run_with_ssh_agent(
             'bzr pull lp:lp-source-dependencies '
             '-d /var/launchpad/download-cache')
-        p('mv /var/launchpad/download-cache /var/launchpad/tmp/download-cache')
+        p(
+            'mv /var/launchpad/download-cache '
+            '/var/launchpad/tmp/download-cache')
         if (self.include_download_cache_changes and
             self.download_cache_additions):
             root = os.path.realpath(
@@ -394,7 +398,8 @@
                 self.log('Copying %s to remote machine.\n' % (src,))
                 user_connection.sftp.put(
                     src,
-                    os.path.join('/var/launchpad/tmp/download-cache', info[0]))
+                    os.path.join(
+                        '/var/launchpad/tmp/download-cache', info[0]))
         p('/var/launchpad/test/utilities/link-external-sourcecode '
           '-p/var/launchpad/tmp -t/var/launchpad/test'),
         # set up database

=== modified file 'lib/lp/app/doc/displaying-paragraphs-of-text.txt'
--- lib/lp/app/doc/displaying-paragraphs-of-text.txt	2011-11-03 03:24:57 +0000
+++ lib/lp/app/doc/displaying-paragraphs-of-text.txt	2011-11-14 08:41:25 +0000
@@ -1,10 +1,12 @@
-= Displaying Paragraphs of Text with ZPT =
+Displaying Paragraphs of Text with ZPT
+======================================
 
 To display paragraphs of text in HTML, use fmt:text-to-html. For details,
 see <https://launchpad.canonical.com/DisplayingParagraphsOfText>.
 
 
-== Basics ==
+Basics
+------
 
     >>> from lp.testing import test_tales
 
@@ -29,8 +31,10 @@
     ...     '* elation'
     ...     )
     >>> print test_tales('foo/fmt:text-to-html', foo=text)
-    <p>This is a paragraph that has been hard-wrapped by an e-mail application.<br />
-    We used to handle this specially, but we no longer do because it was disturbing<br />
+    <p>This is a paragraph that has been hard-wrapped by an e-mail
+    application.<br />
+    We used to handle this specially, but we no longer do because it was
+    disturbing<br />
     the display of backtraces. Expected results:<br />
     * joy<br />
     * elation</p>
@@ -40,8 +44,8 @@
     ...     " 2. where a list is followed by a paragraph.\n"
     ...     "   Leading spaces in a line or paragraph are presented, which "
     ...     "means converting them to &nbsp;. Trailing spaces are passed "
-    ...     "through as-is, which means browsers will ignore them, but that's "
-    ...     "fine, they're not important anyway.\n"
+    ...     "through as-is, which means browsers will ignore them, but "
+    ...     "that's fine, they're not important anyway.\n"
     ...     )
     >>> print test_tales('foo/fmt:text-to-html', foo=text)
     <p>&nbsp;1. Here's an example<br />
@@ -107,7 +111,8 @@
     Foo Bar &lt;<a rel="nofollow" href="mailto:foo.bar@xxxxxxxxxxx";>mailto:<wbr></wbr>foo.bar@<wbr></wbr>example.<wbr></wbr>net</a>&gt;</p>
 
 
-== URL linkification ==
+URL linkification
+-----------------
 
 fmt:text-to-html knows how to linkify URLs:
 
@@ -135,7 +140,8 @@
     ...     'http://localhost/bar/baz/foo.bar.html?a=b&b=a,\n'
     ...     'http://localhost/bar/baz/foo.bar.html?a=b&b=a;\n'
     ...     'http://localhost/bar/baz/foo.bar.html?a=b&b=a:\n'
-    ...     'http://localhost/bar/baz/foo.bar.html?a=b&b=a:b;c@d_e%f~g#h,j!k-l+m$n*o\'p\n'
+    ...     'http://localhost/bar/baz/foo.bar.html?'
+    ...         'a=b&b=a:b;c@d_e%f~g#h,j!k-l+m$n*o\'p\n'
     ...     'http://www.searchtools.com/test/urls/(parens).html\n'
     ...     'http://www.searchtools.com/test/urls/-dash.html\n'
     ...     'http://www.searchtools.com/test/urls/_underscore.html\n'
@@ -201,7 +207,8 @@
     http::No-cache=True</p>
 
 
-== Bug references ==
+Bug references
+--------------
 
 fmt:text-to-html is also smart enough to convert bug references into
 links:
@@ -311,7 +318,8 @@
     <p><a href="/bugs/6" class="bug-link">bug 6</a></p>
 
 
-== FAQ references ==
+FAQ references
+--------------
 
 FAQ references are global, and also linkified:
 
@@ -329,7 +337,7 @@
     <a href="http://answers.launchpad.dev/ubuntu/+faq/2";>faq-2</a><br />
     <a href="http://answers.launchpad.dev/ubuntu/+faq/2";>faq=2</a><br />
     <a href="http://answers.launchpad.dev/ubuntu/+faq/1";>faq item 1</a><br />
-    <a href="http://answers.launchpad.dev/ubuntu/+faq/2";>faq  number  2</a></p>
+    <a href="http://answers.launchpad.dev/ubuntu/+faq/2";>faq number 2</a></p>
 
 Except, that is, when the FAQ doesn't exist:
 
@@ -340,7 +348,8 @@
     <p>faq 999</p>
 
 
-== Branch references ==
+Branch references
+-----------------
 
 Branch references are linkified:
 
@@ -384,7 +393,8 @@
     <p><a href="/bugs/1234" class="bug-link">lp:1234</a>,</p>
 
 
-== OOPS references ==
+OOPS references
+---------------
 
 fmt:text-to-html is also smart enough to convert OOPS references into
 links. However, it only does this if the logged in person is a member of the
@@ -465,7 +475,8 @@
     False
 
 
-== Regex helper functions ==
+Regex helper functions
+----------------------
 
 The _substitute_matchgroup_for_spaces() static method is part of the
 fmt:text-to-html code.  It is a helper for writing regular expressions where
@@ -480,9 +491,9 @@
     >>> FormattersAPI._substitute_matchgroup_for_spaces(matchobj)
     '&nbsp;&nbsp;&nbsp;'
 
-The _linkify_substitution() static method is used for converting bug references
-or URLs into links.  It uses the named matchgroups 'bug' and 'bugnum' when it
-is dealing with bugs, and 'url' when it is dealing with URLs.
+The _linkify_substitution() static method is used for converting bug
+references or URLs into links.  It uses the named matchgroups 'bug' and
+'bugnum' when it is dealing with bugs, and 'url' when it is dealing with URLs.
 
 First, let's try a match of nothing it understands.  This is a bug, so we get
 an AssertionError.

=== modified file 'lib/lp/bugs/browser/bugsubscription.py'
--- lib/lp/bugs/browser/bugsubscription.py	2011-11-04 18:12:08 +0000
+++ lib/lp/bugs/browser/bugsubscription.py	2011-11-14 08:41:25 +0000
@@ -73,7 +73,8 @@
     def add_action(self, action, data):
         person = data['person']
         try:
-            self.context.bug.subscribe(person, self.user, suppress_notify=False)
+            self.context.bug.subscribe(
+                person, self.user, suppress_notify=False)
         except SubscriptionPrivacyViolation as error:
             self.setFieldError('person', unicode(error))
         else:

=== modified file 'lib/lp/bugs/doc/bug.txt'
--- lib/lp/bugs/doc/bug.txt	2011-10-25 02:12:44 +0000
+++ lib/lp/bugs/doc/bug.txt	2011-11-14 08:41:25 +0000
@@ -758,12 +758,14 @@
     >>> private_bug.addTask(owner=foobar, target=tomcat)
     Traceback (most recent call last):
     ...
-    IllegalTarget: This private bug already affects Mozilla Firefox. Private bugs cannot affect multiple projects.
+    IllegalTarget: This private bug already affects Mozilla Firefox.
+    Private bugs cannot affect multiple projects.
 
     >>> private_bug.addTask(owner=foobar, target=ubuntu)
     Traceback (most recent call last):
     ...
-    IllegalTarget: This private bug already affects Mozilla Firefox. Private bugs cannot affect multiple projects.
+    IllegalTarget: This private bug already affects Mozilla Firefox.
+    Private bugs cannot affect multiple projects.
 
 We can add a new product series task so long as it's for the same product as
 is already targeted.
@@ -776,7 +778,8 @@
     >>> private_bug.addTask(owner=foobar, target=target)
     Traceback (most recent call last):
     ...
-    IllegalTarget: This private bug already affects Mozilla Firefox. Private bugs cannot affect multiple projects.
+    IllegalTarget: This private bug already affects Mozilla Firefox.
+    Private bugs cannot affect multiple projects.
 
 Now we create a bug on a distribution.
 
@@ -804,12 +807,14 @@
     >>> private_bug.addTask(owner=foobar, target=warty)
     Traceback (most recent call last):
     ...
-    IllegalTarget: This private bug already affects Tubuntu. Private bugs cannot affect multiple projects.
+    IllegalTarget: This private bug already affects Tubuntu.
+    Private bugs cannot affect multiple projects.
 
     >>> private_bug.addTask(owner=foobar, target=warty_fox_package)
     Traceback (most recent call last):
     ...
-    IllegalTarget: This private bug already affects Tubuntu. Private bugs cannot affect multiple projects.
+    IllegalTarget: This private bug already affects Tubuntu.
+    Private bugs cannot affect multiple projects.
 
 
 Changing bug visibility.

=== modified file 'lib/lp/bugs/doc/externalbugtracker.txt'
--- lib/lp/bugs/doc/externalbugtracker.txt	2011-10-17 07:58:30 +0000
+++ lib/lp/bugs/doc/externalbugtracker.txt	2011-11-14 08:41:25 +0000
@@ -1,10 +1,12 @@
-= Generic ExternalBugTracker Tests =
+Generic ExternalBugTracker Tests
+================================
 
 ExternalBugTracker instances are used to communicate with remote bug
 trackers. This document tests those features that are common to all
 ExternalBugTracker instances.
 
-== Updating bug watches ==
+Updating bug watches
+--------------------
 
 All the ExternalBugTrackers know how to update the status of a bug
 watch. The method that updates the bug watches is
@@ -12,7 +14,8 @@
 and the bug watches to update.
 
 
-=== Initializing ===
+Initializing
+............
 
 Before updating the bug watches, the initializeRemoteBugDB() method on
 the ExternalBugTracker is called. It gets the information for the bug
@@ -33,7 +36,8 @@
     initializeRemoteBugDB() called: []
 
 
-=== Choosing another ExternalBugTracker instance ===
+Choosing another ExternalBugTracker instance
+............................................
 
 Sometimes there is more than one ExternalBugTracker instance for a
 single bug tracker type. For example, for different versions, for
@@ -305,7 +309,8 @@
     1
 
 
-=== Checking the server DB time ===
+Checking the server DB time
+...........................
 
 Before initializeRemoteBugDB is called and we start importing
 information from the remote bug tracker, we check what the bug tracker
@@ -389,7 +394,9 @@
 logged saying that comments won't be imported.
 
     >>> from zope.interface import implements
-    >>> from lp.bugs.interfaces.externalbugtracker import ISupportsCommentImport
+    >>> from lp.bugs.interfaces.externalbugtracker import (
+    ...     ISupportsCommentImport,
+    ...     )
     >>> class CommentImportExternalBugTracker(TimeUnknownExternalBugTracker):
     ...     baseurl = 'http://whatever.com'
     ...     implements(ISupportsCommentImport)
@@ -404,7 +411,8 @@
                 trusted. No comments will be imported. (OOPS-...)
 
 
-=== Limiting which bug watches to update ===
+Limiting which bug watches to update
+....................................
 
 XXX: GavinPanella 2010-01-13 bug=507205: Move this section to
 checkwatches-batching.txt.
@@ -643,7 +651,8 @@
     []
 
 
-== Configuration Options ==
+Configuration Options
+---------------------
 
 All ExternalBugTrackers have a batch_query_threshold attribute which is
 set by configuration options in launchpad.conf. This attribute is used
@@ -664,7 +673,8 @@
     True
 
 
-== Error Handling ==
+Error Handling
+--------------
 
 When an error occurs during the updating of bug watches it will be
 recorded against the bug watches themselves so that it can be displayed
@@ -691,8 +701,10 @@
     ...     example_bug_tracker, '1', sample_person)
 
     >>> from lp.bugs.externalbugtracker import (
-    ...     BugNotFound, BugTrackerConnectError, InvalidBugId,
-    ...     UnparsableBugData, UnparsableBugTrackerVersion)
+    ...     BugTrackerConnectError,
+    ...     UnparsableBugData,
+    ...     UnparsableBugTrackerVersion,
+    ...     )
 
 TestBrokenExternalBugTracker allows us to force errors to occur, so we
 can use it to check that bug watches' last_error_types are being set
@@ -754,13 +766,13 @@
     >>> capture.cleanUp()
 
 
-== Using `LookupTree` to map statuses ==
+Using `LookupTree` to map statuses
+----------------------------------
 
 Most of the status conversions are assisted by a customized LookupTree
 class.
 
-  >>> from lp.bugs.externalbugtracker import (
-  ...     LookupTree)
+    >>> from lp.bugs.externalbugtracker import LookupTree
 
 This is flexible enough to cover all current mapping scenarios with
 minimal preparation from `convertRemoteStatus`. Crucially, it also
@@ -769,72 +781,73 @@
 
 First, we need a tree to document.
 
-  >>> from lp.bugs.interfaces.bugtask import BugTaskStatus
-  >>> tree = LookupTree(
-  ...     ('ASSIGNED', 'STARTED', BugTaskStatus.INPROGRESS),
-  ...     ('NEEDINFO', 'WAITING', 'SUSPENDED', BugTaskStatus.INCOMPLETE),
-  ...     ('PENDINGUPLOAD', 'RELEASE_PENDING', BugTaskStatus.FIXCOMMITTED),
-  ...     ('REJECTED', BugTaskStatus.INVALID),
-  ...     ('RESOLVED', 'CLOSED', LookupTree(
-  ...         ('ERRATA', 'FIXED', BugTaskStatus.FIXRELEASED),
-  ...         ('WONTFIX', BugTaskStatus.WONTFIX),
-  ...         (BugTaskStatus.INVALID,))),
-  ...     ('REOPENED', 'NEW', 'DEFERRED', BugTaskStatus.CONFIRMED),
-  ...     ('UNCONFIRMED', BugTaskStatus.NEW),
-  ...     (BugTaskStatus.UNKNOWN,),
-  ...     )
+    >>> from lp.bugs.interfaces.bugtask import BugTaskStatus
+    >>> tree = LookupTree(
+    ...     ('ASSIGNED', 'STARTED', BugTaskStatus.INPROGRESS),
+    ...     ('NEEDINFO', 'WAITING', 'SUSPENDED', BugTaskStatus.INCOMPLETE),
+    ...     ('PENDINGUPLOAD', 'RELEASE_PENDING', BugTaskStatus.FIXCOMMITTED),
+    ...     ('REJECTED', BugTaskStatus.INVALID),
+    ...     ('RESOLVED', 'CLOSED', LookupTree(
+    ...         ('ERRATA', 'FIXED', BugTaskStatus.FIXRELEASED),
+    ...         ('WONTFIX', BugTaskStatus.WONTFIX),
+    ...         (BugTaskStatus.INVALID,))),
+    ...     ('REOPENED', 'NEW', 'DEFERRED', BugTaskStatus.CONFIRMED),
+    ...     ('UNCONFIRMED', BugTaskStatus.NEW),
+    ...     (BugTaskStatus.UNKNOWN,),
+    ...     )
 
 The customized LookupTree instance has a method to generate a MoinMoin
 compatible table that describes the paths through the tree. The result
 is always assumed to be a member of `BugTaskStatus`.
 
-  >>> for line in tree.moinmoin_table():
-  ...     print line
-  || ASSIGNED '''or''' STARTED || - (''ignored'') || In Progress ||
-  || NEEDINFO '''or''' WAITING '''or''' SUSPENDED || - (''ignored'') ...
-  || PENDINGUPLOAD '''or''' RELEASE_PENDING || - (''ignored'') || Fix...
-  || REJECTED || - (''ignored'') || Invalid ||
-  || RESOLVED '''or''' CLOSED || ERRATA '''or''' FIXED || Fix Released ||
-  ||  || WONTFIX || Won't Fix ||
-  ||  || * (''any'') || Invalid ||
-  || REOPENED '''or''' NEW '''or''' DEFERRED || - (''ignored'') || Co...
-  || UNCONFIRMED || - (''ignored'') || New ||
-  || * (''any'') || - (''ignored'') || Unknown ||
+    >>> for line in tree.moinmoin_table():
+    ...     print line
+    || ASSIGNED '''or''' STARTED || - (''ignored'') || In Progress ||
+    || NEEDINFO '''or''' WAITING '''or''' SUSPENDED || - (''ignored'') ...
+    || PENDINGUPLOAD '''or''' RELEASE_PENDING || - (''ignored'') || Fix...
+    || REJECTED || - (''ignored'') || Invalid ||
+    || RESOLVED '''or''' CLOSED || ERRATA '''or''' FIXED || Fix Released ||
+    ||  || WONTFIX || Won't Fix ||
+    ||  || * (''any'') || Invalid ||
+    || REOPENED '''or''' NEW '''or''' DEFERRED || - (''ignored'') || Co...
+    || UNCONFIRMED || - (''ignored'') || New ||
+    || * (''any'') || - (''ignored'') || Unknown ||
 
 Titles can also be provided for the table.
 
-  >>> titles = ('Status', 'Resolution', 'LP status')
-  >>> for line in tree.moinmoin_table(titles):
-  ...     print line
-  || '''Status''' || '''Resolution''' || '''LP status''' ||
-  || ASSIGNED '''or''' STARTED || - (''ignored'') || In Progress ||
-  || NEEDINFO '''or''' WAITING '''or''' SUSPENDED || - (''ignored'') ...
-  ...
+    >>> titles = ('Status', 'Resolution', 'LP status')
+    >>> for line in tree.moinmoin_table(titles):
+    ...     print line
+    || '''Status''' || '''Resolution''' || '''LP status''' ||
+    || ASSIGNED '''or''' STARTED || - (''ignored'') || In Progress ||
+    || NEEDINFO '''or''' WAITING '''or''' SUSPENDED || - (''ignored'') ...
+    ...
 
 It will complain if you don't provide a suitable number of titles.
 
-  >>> titles = ('Status', 'Resolution')
-  >>> for line in tree.moinmoin_table(titles):
-  ...     print line
-  Traceback (most recent call last):
-  ...
-  ValueError: Table of 3 columns needs 3 titles, but 2 given.
+    >>> titles = ('Status', 'Resolution')
+    >>> for line in tree.moinmoin_table(titles):
+    ...     print line
+    Traceback (most recent call last):
+    ...
+    ValueError: Table of 3 columns needs 3 titles, but 2 given.
 
 When constructing a status mapping tree, you are forced to choose a
 valid Launchpad status as the result of any lookup. This goes some way
 to ensuring that the tree is valid, and that `moinmoin_table` is safe
 to make that assumption.
 
-  >>> tree = LookupTree(
-  ...     ('ASSIGNED', BugTaskStatus.INPROGRESS),
-  ...     ('NEEDSINFO', 'Not a BugTaskStatus'),
-  ...     )
-  Traceback (most recent call last):
-  ...
-  TypeError: Result is not a member of BugTaskStatus: 'Not a BugTaskStatus'
-
-
-== Getting the remote product from a remote bug ==
+    >>> tree = LookupTree(
+    ...     ('ASSIGNED', BugTaskStatus.INPROGRESS),
+    ...     ('NEEDSINFO', 'Not a BugTaskStatus'),
+    ...     )
+    Traceback (most recent call last):
+    ...
+    TypeError: Result is not a member of BugTaskStatus: 'Not a BugTaskStatus'
+
+
+Getting the remote product from a remote bug
+--------------------------------------------
 
 Some ExternalBugTrackers offer a method by which can be used to get the
 remote product for a given remote bug.
@@ -870,7 +883,8 @@
     None
 
 
-== Prioritisation of watches ==
+Prioritisation of watches
+-------------------------
 
 _getRemoteIdsToCheck() prioritizes the IDs it returns. Bug watches which have
 comments to push or which have never been checked will always be returned in
@@ -977,7 +991,8 @@
     [u'0', u'1', u'2', u'3', u'4', u'5', u'6', u'7', u'8', u'9']
 
 
-== Setting the batch size ==
+Setting the batch size
+----------------------
 
 It's possible to set the batch size for a particular checkwatches run by
 passing a batch_size parameter to _getRemoteIdsToCheck(). This overrides

=== modified file 'lib/lp/bugs/errors.py'
--- lib/lp/bugs/errors.py	2011-11-04 18:12:08 +0000
+++ lib/lp/bugs/errors.py	2011-11-14 08:41:25 +0000
@@ -1,4 +1,4 @@
-# Copyright 2009 Canonical Ltd.  This software is licensed under the
+# Copyright 2009-2011 Canonical Ltd.  This software is licensed under the
 # GNU Affero General Public License version 3 (see the file LICENSE).
 
 """Errors used in the lp/bugs modules."""
@@ -26,6 +26,7 @@
 class InvalidDuplicateValue(LaunchpadValidationError):
     """A bug cannot be set as the duplicate of another."""
 
+
 @error_status(httplib.BAD_REQUEST)
 class SubscriptionPrivacyViolation(Exception):
     """The subscription would violate privacy policies."""

=== modified file 'lib/lp/bugs/javascript/bugtask_index.js'
--- lib/lp/bugs/javascript/bugtask_index.js	2011-11-10 10:51:37 +0000
+++ lib/lp/bugs/javascript/bugtask_index.js	2011-11-14 08:41:25 +0000
@@ -678,13 +678,12 @@
             // embedded in the picker tales so we need to ensure we handle
             // this case.
             var tr = Y.one('#' + conf.form_row_id);
-            if (tr === null) {
-                //The row has been deleted.
-                continue;
+            if (tr !== null) {
+                // The row has not been deleted.
+                tr.all('a').each(process_link);
+                // Now wire up the javascript widgets in the table row.
+                namespace.setup_bugtask_row(conf);
             }
-            tr.all('a').each(process_link);
-            // Now wire up the javascript widgets in the table row.
-            namespace.setup_bugtask_row(conf);
         }
     }
 };

=== modified file 'lib/lp/bugs/model/bug.py'
--- lib/lp/bugs/model/bug.py	2011-11-07 21:25:46 +0000
+++ lib/lp/bugs/model/bug.py	2011-11-14 08:41:25 +0000
@@ -179,8 +179,8 @@
     )
 from lp.bugs.model.bugwatch import BugWatch
 from lp.bugs.model.structuralsubscription import (
+    get_structural_subscribers,
     get_structural_subscriptions_for_bug,
-    get_structural_subscribers,
     )
 from lp.code.interfaces.branchcollection import IAllBranches
 from lp.hardwaredb.interfaces.hwdb import IHWSubmissionBugSet
@@ -190,7 +190,6 @@
     IPersonSet,
     validate_person,
     validate_public_person,
-    TeamSubscriptionPolicy,
     )
 from lp.registry.interfaces.product import IProduct
 from lp.registry.interfaces.productseries import IProductSeries

=== modified file 'lib/lp/bugs/stories/bugs/xx-bug-index-lots-of-comments.txt'
--- lib/lp/bugs/stories/bugs/xx-bug-index-lots-of-comments.txt	2011-11-09 15:38:51 +0000
+++ lib/lp/bugs/stories/bugs/xx-bug-index-lots-of-comments.txt	2011-11-14 08:41:25 +0000
@@ -1,4 +1,5 @@
-== Bugs with lots of comments ==
+Bugs with lots of comments
+==========================
 
 When a bug has a very large number of comments, only some of them are
 displayed. A notice is added at the end of the comment list to tell

=== modified file 'lib/lp/bugs/stories/bugs/xx-bug-index.txt'
--- lib/lp/bugs/stories/bugs/xx-bug-index.txt	2011-11-04 14:01:34 +0000
+++ lib/lp/bugs/stories/bugs/xx-bug-index.txt	2011-11-14 08:41:25 +0000
@@ -1,4 +1,5 @@
-= Bug report index page =
+Bug report index page
+=====================
 
 The bug index is the main page of a bug report. It contains all sorts of
 interesting things related to fixing a problem: the bug description,
@@ -17,7 +18,8 @@
     Tabs:
     * Overview - http://launchpad.dev/debian/+source/mozilla-firefox
     * Code - http://code.launchpad.dev/debian/+source/mozilla-firefox
-    * Bugs (selected) - http://bugs.launchpad.dev/debian/+source/mozilla-firefox
+    * Bugs (selected) -
+      http://bugs.launchpad.dev/debian/+source/mozilla-firefox
     * Blueprints - not linked
     * Translations - not linked
     * Answers - http://answers.launchpad.dev/debian/+source/mozilla-firefox
@@ -123,7 +125,8 @@
     http://bugs.launchpad.dev/ubuntu/+source/.../+bug/1/+addcomment
 
 
-== Navigatig to a bug in the wrong context ==
+Navigatig to a bug in the wrong context
+---------------------------------------
 
 If we navigate to a bug in a context in which it doesn't exist, we are
 redirected to the default context.
@@ -133,7 +136,8 @@
     http://bugs.launchpad.dev/ubuntu/+source/linux-source-2.6.15/+bug/10
 
 
-== Bugs with many tasks ==
+Bugs with many tasks
+--------------------
 
 Some bugs have many bug tasks, which causes the Javascript initialization
 code for them take too long. As a last resort optimization we disable that

=== modified file 'lib/lp/bugs/stories/bugtask-management/xx-bugtask-edit-forms.txt'
--- lib/lp/bugs/stories/bugtask-management/xx-bugtask-edit-forms.txt	2011-11-04 14:01:34 +0000
+++ lib/lp/bugs/stories/bugtask-management/xx-bugtask-edit-forms.txt	2011-11-14 08:41:25 +0000
@@ -11,52 +11,52 @@
 of the bug task table lead him to the bug task edit forms of the
 respective bug task.
 
->>> admin_browser.open('http://bugs.launchpad.dev/firefox/+bug/1')
->>> print extract_text(
-...     find_tag_by_id(admin_browser.contents, 'affected-software'))
-Affects                     Status    Importance   Assigned to...
-Mozilla Firefox...          New       Low          Mark Shuttleworth...
-mozilla-firefox (Debian)... Confirmed Low          debbugs #304014...
-mozilla-firefox (Ubuntu)... New       Medium       Unassigned
-...
-
->>> print admin_browser.getLink('New', index=0).url
-http://bugs.launchpad.dev/firefox/+bug/1/+editstatus
->>> print admin_browser.getLink('Low', index=0).url
-http://bugs.launchpad.dev/firefox/+bug/1/+editstatus
-
->>> print admin_browser.getLink('Confirmed').url
-Traceback (most recent call last):
-...
-LinkNotFoundError
->>> print admin_browser.getLink('Low', index=1).url
-Traceback (most recent call last):
-...
-LinkNotFoundError
-
->>> print admin_browser.getLink('New', index=1).url
-http://bugs.launchpad.dev/ubuntu/+source/mozilla-firefox/+bug/1/+editstatus
->>> print admin_browser.getLink('Medium').url
-http://bugs.launchpad.dev/ubuntu/+source/mozilla-firefox/+bug/1/+editstatus
-
->>> admin_browser.getLink('New').click()
->>> print extract_text(admin_browser.contents)
-Edit status...
-...
-Affecting: Mozilla Firefox
-Filed here by: Sample Person
-When: 2004-01-02
-Assigned: 2005-01-02
-Target
-Distribution
-...
-Project (Find&hellip;)
-Status  Importance  Milestone
-New...  Low...      (no value)...
-Assigned to... Mark Shuttleworth (mark)
-...
-Comment on this change (optional)
-...
+    >>> admin_browser.open('http://bugs.launchpad.dev/firefox/+bug/1')
+    >>> print extract_text(
+    ...     find_tag_by_id(admin_browser.contents, 'affected-software'))
+    Affects                     Status    Importance   Assigned to...
+    Mozilla Firefox...          New       Low          Mark Shuttleworth...
+    mozilla-firefox (Debian)... Confirmed Low          debbugs #304014...
+    mozilla-firefox (Ubuntu)... New       Medium       Unassigned
+    ...
+
+    >>> print admin_browser.getLink('New', index=0).url
+    http://bugs.launchpad.dev/firefox/+bug/1/+editstatus
+    >>> print admin_browser.getLink('Low', index=0).url
+    http://bugs.launchpad.dev/firefox/+bug/1/+editstatus
+
+    >>> print admin_browser.getLink('Confirmed').url
+    Traceback (most recent call last):
+    ...
+    LinkNotFoundError
+    >>> print admin_browser.getLink('Low', index=1).url
+    Traceback (most recent call last):
+    ...
+    LinkNotFoundError
+
+    >>> print admin_browser.getLink('New', index=1).url
+    http://bugs...dev/ubuntu/+source/mozilla-firefox/+bug/1/+editstatus
+    >>> print admin_browser.getLink('Medium').url
+    http://bugs...dev/ubuntu/+source/mozilla-firefox/+bug/1/+editstatus
+
+    >>> admin_browser.getLink('New').click()
+    >>> print extract_text(admin_browser.contents)
+    Edit status...
+    ...
+    Affecting: Mozilla Firefox
+    Filed here by: Sample Person
+    When: 2004-01-02
+    Assigned: 2005-01-02
+    Target
+    Distribution
+    ...
+    Project (Find&hellip;)
+    Status  Importance  Milestone
+    New...  Low...      (no value)...
+    Assigned to... Mark Shuttleworth (mark)
+    ...
+    Comment on this change (optional)
+    ...
 
 For more details of the +editstatus page, see xx-bug-privileged-statuses.txt,
 xx-view-editable-bug-task.txt.

=== modified file 'lib/lp/bugs/templates/bugtask-delete.pt'
--- lib/lp/bugs/templates/bugtask-delete.pt	2011-11-01 00:38:35 +0000
+++ lib/lp/bugs/templates/bugtask-delete.pt	2011-11-14 08:41:25 +0000
@@ -13,11 +13,11 @@
         <p class="large-warning" style="padding:2px 2px 0 36px;">
             You are about to mark bug
             "<tal:bug replace="context/bug/title">some bug</tal:bug>"
-            <br>as no longer affecting
+            <br />as no longer affecting
             <tal:target
                 replace="context/target/bugtargetdisplayname">some target
             </tal:target>.
-        <br><br>
+        <br /><br />
         <strong>Please confirm you really want to do this.</strong></p>
     </div>
   </div>

=== modified file 'lib/lp/buildmaster/enums.py'
--- lib/lp/buildmaster/enums.py	2011-10-28 10:26:04 +0000
+++ lib/lp/buildmaster/enums.py	2011-11-14 08:41:25 +0000
@@ -1,4 +1,4 @@
-# Copyright 2009-2010 Canonical Ltd.  This software is licensed under the
+# Copyright 2009-2011 Canonical Ltd.  This software is licensed under the
 # GNU Affero General Public License version 3 (see the file LICENSE).
 
 # pylint: disable-msg=E0211,E0213
@@ -37,9 +37,9 @@
     FULLYBUILT = DBItem(1, """
         Successfully built
 
-        Build record is an historic account of the build. The build is complete
-        and needs no further work to complete it. The build log etc are all
-        in place if available.
+        Build record is an historic account of the build. The build is
+        complete and needs no further work to complete it. The build log etc
+        are all in place if available.
         """)
 
     FAILEDTOBUILD = DBItem(2, """
@@ -108,8 +108,8 @@
         Cancelling build
 
         A cancellation request was made for the build. It cannot be cancelled
-        immediately because a request is made in the webapp but we need to wait
-        for the buildd-manager to actually cancel it.
+        immediately because a request is made in the webapp but we need to
+        wait for the buildd-manager to actually cancel it.
         """)
 
     CANCELLED = DBItem(10, """

=== modified file 'lib/lp/buildmaster/model/buildqueue.py'
--- lib/lp/buildmaster/model/buildqueue.py	2011-10-28 10:26:04 +0000
+++ lib/lp/buildmaster/model/buildqueue.py	2011-11-14 08:41:25 +0000
@@ -1,4 +1,4 @@
-# Copyright 2009 Canonical Ltd.  This software is licensed under the
+# Copyright 2009-2011 Canonical Ltd.  This software is licensed under the
 # GNU Affero General Public License version 3 (see the file LICENSE).
 
 # pylint: disable-msg=E0611,W0212
@@ -46,9 +46,7 @@
     )
 from lp.app.errors import NotFoundError
 from lp.buildmaster.enums import BuildFarmJobType
-from lp.buildmaster.interfaces.buildfarmjob import (
-    IBuildFarmJob,
-    )
+from lp.buildmaster.interfaces.buildfarmjob import IBuildFarmJob
 from lp.buildmaster.interfaces.buildfarmjobbehavior import (
     IBuildFarmJobBehavior,
     )
@@ -463,7 +461,7 @@
             # the delays should be averaged/divided by the number of jobs.
             denominator = (jobs if jobs < builders else builders)
             if denominator > 1:
-                duration = int(duration/float(denominator))
+                duration = int(duration / float(denominator))
 
             sum_of_delays += duration
 

=== modified file 'lib/lp/buildmaster/tests/test_buildqueue.py'
--- lib/lp/buildmaster/tests/test_buildqueue.py	2011-10-28 10:26:04 +0000
+++ lib/lp/buildmaster/tests/test_buildqueue.py	2011-11-14 08:41:25 +0000
@@ -1,4 +1,4 @@
-# Copyright 2009-2010 Canonical Ltd.  This software is licensed under the
+# Copyright 2009-2011 Canonical Ltd.  This software is licensed under the
 # GNU Affero General Public License version 3 (see the file LICENSE).
 # pylint: disable-msg=C0324
 
@@ -8,10 +8,10 @@
     datetime,
     timedelta,
     )
+
+from pytz import utc
+from storm.sqlobject import SQLObjectNotFound
 from storm.store import Store
-from storm.sqlobject import SQLObjectNotFound
-
-from pytz import utc
 from zope import component
 from zope.component import (
     getGlobalSiteManager,
@@ -85,7 +85,7 @@
     builder = None
     builders = test.builders.get(builder_key(bq), [])
     try:
-        for builder in builders[n-1:]:
+        for builder in builders[n - 1:]:
             if builder.builderok:
                 break
     except IndexError:

=== modified file 'lib/lp/code/model/branchmergeproposaljob.py'
--- lib/lp/code/model/branchmergeproposaljob.py	2011-11-03 02:50:57 +0000
+++ lib/lp/code/model/branchmergeproposaljob.py	2011-11-14 08:41:25 +0000
@@ -1,4 +1,4 @@
-# Copyright 2009, 2010, 2011 Canonical Ltd.  This software is licensed under the
+# Copyright 2009-2011 Canonical Ltd.  This software is licensed under the
 # GNU Affero General Public License version 3 (see the file LICENSE).
 
 

=== modified file 'lib/lp/codehosting/codeimport/tests/test_worker.py'
--- lib/lp/codehosting/codeimport/tests/test_worker.py	2011-11-03 14:46:46 +0000
+++ lib/lp/codehosting/codeimport/tests/test_worker.py	2011-11-14 08:41:25 +0000
@@ -97,7 +97,6 @@
     TestCase,
     TestCaseWithFactory,
     )
-from zope.security.proxy import removeSecurityProxy
 
 
 class ForeignBranchPluginLayer(BaseLayer):

=== modified file 'lib/lp/codehosting/codeimport/worker.py'
--- lib/lp/codehosting/codeimport/worker.py	2011-11-03 01:51:50 +0000
+++ lib/lp/codehosting/codeimport/worker.py	2011-11-14 08:41:25 +0000
@@ -227,8 +227,8 @@
                     upgrade_url, format=required_format)
             else:
                 old_branch = None
-        # This can be done safely, since only modern formats are used to import
-        # to.
+        # This can be done safely, since only modern formats are used to
+        # import to.
         if stacked_on_url is not None:
             remote_branch.set_stacked_on_url(stacked_on_url)
         pull_result = remote_branch.pull(bzr_branch, overwrite=True)

=== modified file 'lib/lp/codehosting/puller/tests/test_errors.py'
--- lib/lp/codehosting/puller/tests/test_errors.py	2011-10-17 05:41:34 +0000
+++ lib/lp/codehosting/puller/tests/test_errors.py	2011-11-14 08:41:25 +0000
@@ -1,4 +1,4 @@
-# Copyright 2009 Canonical Ltd.  This software is licensed under the
+# Copyright 2009-2011 Canonical Ltd.  This software is licensed under the
 # GNU Affero General Public License version 3 (see the file LICENSE).
 
 """Unit tests for the error presentation in worker.py."""
@@ -61,6 +61,7 @@
         def __init__(self, exc):
             super(TestErrorCatching.CustomErrorOpener, self).__init__(None)
             self.exc = exc
+
         def open(self, url):
             raise self.exc
 

=== modified file 'lib/lp/codehosting/puller/tests/test_worker.py'
--- lib/lp/codehosting/puller/tests/test_worker.py	2011-10-30 20:36:51 +0000
+++ lib/lp/codehosting/puller/tests/test_worker.py	2011-11-14 08:41:25 +0000
@@ -1,4 +1,4 @@
-# Copyright 2009 Canonical Ltd.  This software is licensed under the
+# Copyright 2009-2011 Canonical Ltd.  This software is licensed under the
 # GNU Affero General Public License version 3 (see the file LICENSE).
 
 # pylint: disable-msg=W0231
@@ -11,12 +11,8 @@
 from StringIO import StringIO
 
 import bzrlib.branch
-from bzrlib.branch import (
-    BranchReferenceFormat,
-    )
-from bzrlib.bzrdir import (
-    BzrDir,
-    )
+from bzrlib.branch import BranchReferenceFormat
+from bzrlib.bzrdir import BzrDir
 from bzrlib.errors import (
     IncompatibleRepositories,
     NotBranchError,
@@ -67,10 +63,10 @@
     while len(line) > 0:
         colon_index = line.find(':')
         length = int(line[:colon_index])
-        strings.append(line[colon_index+1:colon_index+1+length])
-        assert ',' == line[colon_index+1+length], (
-            'Expected %r == %r' % (',', line[colon_index+1+length]))
-        line = line[colon_index+length+2:]
+        strings.append(line[(colon_index + 1):(colon_index + 1 + length)])
+        assert ',' == line[colon_index + 1 + length], (
+            'Expected %r == %r' % (',', line[colon_index + 1 + length]))
+        line = line[colon_index + length + 2:]
     return strings
 
 
@@ -495,6 +491,7 @@
         """A stub for PullerWorkerProtocol that just defines progressMade."""
         def __init__(self):
             self.calls = []
+
         def progressMade(self, type):
             self.calls.append(type)
 

=== modified file 'lib/lp/codehosting/tests/test_bzrutils.py'
--- lib/lp/codehosting/tests/test_bzrutils.py	2011-10-30 20:36:51 +0000
+++ lib/lp/codehosting/tests/test_bzrutils.py	2011-11-14 08:41:25 +0000
@@ -1,4 +1,4 @@
-# Copyright 2009 Canonical Ltd.  This software is licensed under the
+# Copyright 2009-2011 Canonical Ltd.  This software is licensed under the
 # GNU Affero General Public License version 3 (see the file LICENSE).
 
 """Tests for bzrutils."""
@@ -12,12 +12,8 @@
     errors,
     trace,
     )
-from bzrlib.branch import (
-    Branch,
-    )
-from bzrlib.bzrdir import (
-    format_registry,
-    )
+from bzrlib.branch import Branch
+from bzrlib.bzrdir import format_registry
 from bzrlib.remote import RemoteBranch
 from bzrlib.tests import (
     multiply_tests,
@@ -165,8 +161,10 @@
         # add_exception_logging_hook adds a hook function that's called
         # whenever Bazaar logs an exception.
         exceptions = []
+
         def hook():
             exceptions.append(sys.exc_info()[:2])
+
         add_exception_logging_hook(hook)
         self.addCleanup(remove_exception_logging_hook, hook)
         exception = RuntimeError('foo')
@@ -177,8 +175,10 @@
         # remove_exception_logging_hook removes the hook function, ensuring
         # it's not called when Bazaar logs an exception.
         exceptions = []
+
         def hook():
             exceptions.append(sys.exc_info()[:2])
+
         add_exception_logging_hook(hook)
         remove_exception_logging_hook(hook)
         self.logException(RuntimeError('foo'))
@@ -217,7 +217,6 @@
             get_vfs_format_classes(remote_branch))
 
 
-
 def load_tests(basic_tests, module, loader):
     """Parametrize the tests of get_branch_stacked_on_url by branch format."""
     result = loader.suiteClass()

=== modified file 'lib/lp/registry/browser/tests/test_milestone.py'
--- lib/lp/registry/browser/tests/test_milestone.py	2011-11-11 13:47:03 +0000
+++ lib/lp/registry/browser/tests/test_milestone.py	2011-11-14 08:41:25 +0000
@@ -1,4 +1,4 @@
-# Copyright 2010 Canonical Ltd.  This software is licensed under the
+# Copyright 2010-2011 Canonical Ltd.  This software is licensed under the
 # GNU Affero General Public License version 3 (see the file LICENSE).
 
 """Test milestone views."""
@@ -7,10 +7,7 @@
 
 from textwrap import dedent
 
-from testtools.matchers import (
-    LessThan,
-    Matcher,
-    )
+from testtools.matchers import LessThan
 from zope.component import getUtility
 
 from canonical.config import config

=== modified file 'lib/lp/registry/interfaces/distribution.py'
--- lib/lp/registry/interfaces/distribution.py	2011-11-11 02:07:17 +0000
+++ lib/lp/registry/interfaces/distribution.py	2011-11-14 08:41:25 +0000
@@ -136,9 +136,9 @@
     IBugTarget, ICanGetMilestonesDirectly, IHasAppointedDriver,
     IHasBuildRecords, IHasDrivers, IHasMilestones,
     IHasOOPSReferences, IHasOwner, IHasSecurityContact, IHasSprints,
-    IHasTranslationImports, ITranslationPolicy, IKarmaContext, ILaunchpadUsage,
-    IMakesAnnouncements, IOfficialBugTagTargetPublic, IPillar, IServiceUsage,
-    ISpecificationTarget):
+    IHasTranslationImports, ITranslationPolicy, IKarmaContext,
+    ILaunchpadUsage, IMakesAnnouncements, IOfficialBugTagTargetPublic,
+    IPillar, IServiceUsage, ISpecificationTarget):
     """Public IDistribution properties."""
 
     id = Attribute("The distro's unique number.")

=== modified file 'lib/lp/registry/model/oopsreferences.py'
--- lib/lp/registry/model/oopsreferences.py	2011-11-11 02:12:24 +0000
+++ lib/lp/registry/model/oopsreferences.py	2011-11-14 08:41:25 +0000
@@ -24,9 +24,9 @@
      - any message, message chunk or bug.
      - any question that passes context_clause.
 
-    Privacy and access controls are ignored: the maximum disclosure is a single
-    word immediately after the word 'OOPS'. Future iterations may tighten the
-    returned references up.
+    Privacy and access controls are ignored: the maximum disclosure is a
+    single word immediately after the word 'OOPS'.  Future iterations may
+    tighten up the returned references.
 
     :param start_date: The earliest modification date to consider.
     :param end_date: The last modification date to consider.

=== modified file 'lib/lp/registry/tests/test_distribution.py'
--- lib/lp/registry/tests/test_distribution.py	2011-11-11 02:07:17 +0000
+++ lib/lp/registry/tests/test_distribution.py	2011-11-14 08:41:25 +0000
@@ -553,7 +553,7 @@
         # check we can access context filtered references - e.g. on question.
         oopsid = "OOPS-abcdef1234"
         distro = self.factory.makeDistribution()
-        question = self.factory.makeQuestion(
+        self.factory.makeQuestion(
             title="Crash with %s" % oopsid, target=distro)
         transaction.commit()
         ws_distro = self.wsObject(distro, distro.owner)

=== modified file 'lib/lp/registry/tests/test_product.py'
--- lib/lp/registry/tests/test_product.py	2011-11-11 02:07:17 +0000
+++ lib/lp/registry/tests/test_product.py	2011-11-14 08:41:25 +0000
@@ -16,7 +16,6 @@
     IHasLogo,
     IHasMugshot,
     )
-from canonical.launchpad.interfaces.lpstorm import IStore
 from canonical.launchpad.testing.pages import (
     find_main_content,
     get_feedback_messages,

=== modified file 'lib/lp/services/mailman/monkeypatches/__init__.py'
--- lib/lp/services/mailman/monkeypatches/__init__.py	2011-11-11 21:59:00 +0000
+++ lib/lp/services/mailman/monkeypatches/__init__.py	2011-11-14 08:41:25 +0000
@@ -62,20 +62,20 @@
             smtp_host=host,
             smtp_port=port,
             smtp_max_rcpts=config.mailman.smtp_max_rcpts,
-            smtp_max_sesions_per_connection
-                =config.mailman.smtp_max_sesions_per_connection,
+            smtp_max_sesions_per_connection=(
+                config.mailman.smtp_max_sesions_per_connection),
             xmlrpc_url=config.mailman.xmlrpc_url,
             xmlrpc_sleeptime=config.mailman.xmlrpc_runner_sleep,
             xmlrpc_timeout=config.mailman.xmlrpc_timeout,
-            xmlrpc_subscription_batch_size
-                =config.mailman.subscription_batch_size,
+            xmlrpc_subscription_batch_size=(
+                config.mailman.subscription_batch_size),
             site_list_owner=owner_address,
             list_help_header=config.mailman.list_help_header,
-            list_subscription_headers
-                =config.mailman.list_subscription_headers,
+            list_subscription_headers=(
+                config.mailman.list_subscription_headers),
             archive_url_template=config.mailman.archive_url_template,
-            list_owner_header_template
-                =config.mailman.list_owner_header_template,
+            list_owner_header_template=(
+                config.mailman.list_owner_header_template),
             footer=footer,
             var_dir=config.mailman.build_var_dir,
             shared_secret=config.mailman.shared_secret,

=== modified file 'lib/lp/soyuz/model/buildfarmbuildjob.py'
--- lib/lp/soyuz/model/buildfarmbuildjob.py	2011-10-28 10:26:04 +0000
+++ lib/lp/soyuz/model/buildfarmbuildjob.py	2011-11-14 08:41:25 +0000
@@ -1,4 +1,4 @@
-# Copyright 2010 Canonical Ltd.  This software is licensed under the
+# Copyright 2010-2011 Canonical Ltd.  This software is licensed under the
 # GNU Affero General Public License version 3 (see the file LICENSE).
 
 __metaclass__ = type
@@ -18,6 +18,7 @@
 class BuildFarmBuildJob(BuildFarmJobOld):
     """See `IBuildFaramBuildJob`."""
     implements(IBuildFarmBuildJob)
+
     def __init__(self, build):
         """Store the build for this package build farm job.
 

=== modified file 'lib/lp/soyuz/model/packagecopyjob.py'
--- lib/lp/soyuz/model/packagecopyjob.py	2011-11-04 11:18:24 +0000
+++ lib/lp/soyuz/model/packagecopyjob.py	2011-11-14 08:41:25 +0000
@@ -517,7 +517,7 @@
             to_sourcepackagerelease = ancestry.sourcepackagerelease
             copied_source = copied_sources[0]
             try:
-                diff = to_sourcepackagerelease.requestDiffTo(
+                to_sourcepackagerelease.requestDiffTo(
                     self.requester, copied_source.sourcepackagerelease)
             except PackageDiffAlreadyRequested:
                 pass

=== modified file 'lib/lp/soyuz/stories/ppa/xx-copy-packages.txt'
--- lib/lp/soyuz/stories/ppa/xx-copy-packages.txt	2011-11-03 10:58:26 +0000
+++ lib/lp/soyuz/stories/ppa/xx-copy-packages.txt	2011-11-14 08:41:25 +0000
@@ -1,4 +1,5 @@
-= PPA Package Copying =
+PPA Package Copying
+===================
 
 We allow users to copy packages from PPAs they can view to another
 that they upload packages to.
@@ -23,7 +24,8 @@
 information.
 
 
-== Who can copy packages ? ==
+Who can copy packages?
+----------------------
 
 Copying is only permitted for valid users, so Anonymous user can't
 access 'Copy package' page from any PPA.
@@ -95,7 +97,8 @@
     pmount - 0.1-1    2007-07-09  Published  Warty            Editors
 
 
-== How does this copy-thing work ? ==
+How does this copy-thing work?
+------------------------------
 
 As mentioned before, James can select one or more sources to be copied
 to a PPA he has permission to upload.
@@ -108,7 +111,9 @@
     >>> from canonical.launchpad.ftests import login, logout
 
     >>> login('foo.bar@xxxxxxxxxxxxx')
-    >>> from canonical.launchpad.interfaces.librarian import ILibraryFileAliasSet
+    >>> from canonical.launchpad.interfaces.librarian import (
+    ...     ILibraryFileAliasSet,
+    ...     )
     >>> from lp.registry.interfaces.distribution import IDistributionSet
     >>> from lp.soyuz.model.processor import ProcessorFamily
 
@@ -184,7 +189,8 @@
       * Fix description (Malone #1)
       * Fix debian (Debian #2000)
       * Fix warty (Warty Ubuntu #1)
-      -- Sample Person &lt;test@xxxxxxxxxxxxx&gt; Tue, 7 Feb 2006 12:10:08 +0300
+      -- Sample Person &lt;test@xxxxxxxxxxxxx&gt;
+      Tue, 7 Feb 2006 12:10:08 +0300
     Builds
       i386
     Built packages
@@ -272,7 +278,8 @@
       * Fix description (Malone #1)
       * Fix debian (Debian #2000)
       * Fix warty (Warty Ubuntu #1)
-      -- Sample Person &lt;test@xxxxxxxxxxxxx&gt; Tue, 7 Feb 2006 12:10:08 +0300
+      -- Sample Person &lt;test@xxxxxxxxxxxxx&gt;
+      Tue, 7 Feb 2006 12:10:08 +0300
     Builds
       i386
     Package files
@@ -315,7 +322,8 @@
 Very nice, but now James gets really excited about the possibilities ...
 
 
-=== Copying packages within the PPA ===
+Copying packages within the PPA
+...............................
 
 James thinks that having Celso's 'pmount' copy in his PPA for hoary is
 great, however some of his friends are already using grumpy, the new
@@ -650,7 +658,8 @@
     pmount - 0.1-1 (Newer...)   Deleted    Hoary            Editors
 
 
-=== Copying packages to other PPAs you participate ===
+Copying packages to other PPAs you participate
+..............................................
 
 The Copy-UI excitement is endless for James, he informed his friends
 and decided to open a team PPA where he and his friends could work
@@ -1115,8 +1124,8 @@
     >>> jblack_browser.getControl("Filter").click()
 
     >>> print_ppa_packages(jblack_browser.contents)
-    Source          Uploader  Published  Status     Series  Section Build Status
-    foo - 9.9 (...) name16    ...        Published  Hoary   Base    i386
+    Source          Uploader Published Status    Series Section Build Status
+    foo - 9.9 (...) name16   ...       Published Hoary  Base    i386
 
 But James doesn't think straight, he sees that foo-9.9 failed to build
 in i386, but even though, he tries to copy it including binaries. He

=== modified file 'lib/lp/soyuz/stories/webservice/xx-builds.txt'
--- lib/lp/soyuz/stories/webservice/xx-builds.txt	2011-10-31 15:58:32 +0000
+++ lib/lp/soyuz/stories/webservice/xx-builds.txt	2011-11-14 08:41:25 +0000
@@ -46,13 +46,15 @@
     can_be_rescored: False
     can_be_retried: True
     changesfile_url: None
-    current_source_publication_link: u'http://.../beta/~cprov/+archive/ppa/+sourcepub/27'
+    current_source_publication_link:
+    u'http://.../beta/~cprov/+archive/ppa/+sourcepub/27'
     date_created: u'2007-07-08T00:00:00+00:00'
     date_finished: u'2007-07-08T00:00:01+00:00'
     date_first_dispatched: None
     dependencies: None
     distribution_link: u'http://.../beta/ubuntu'
-    log_url: u'http://.../~cprov/+archive/ppa/+build/26/+files/netapplet-1.0.0.tar.gz'
+    log_url:
+    u'http://.../~cprov/+archive/ppa/+build/26/+files/netapplet-1.0.0.tar.gz'
     pocket: u'Release'
     resource_type_link: u'http://api.launchpad.dev/beta/#build'
     score: None
@@ -66,17 +68,19 @@
 (without underscores):
 
     >>> builds_1_0 = webservice.named_get(
-    ...     source_pub['self_link'].replace('beta', '1.0'), 'getBuilds').jsonBody()
-    >>> pprint_entry(builds_1_0['entries'][0])
+    ...     source_pub['self_link'].replace('beta', '1.0'), 'getBuilds')
+    >>> pprint_entry(builds_1_0.jsonBody()['entries'][0])
     arch_tag: u'i386'
     archive_link: u'http://.../~cprov/+archive/ppa'
-    build_log_url: u'http://.../~cprov/+archive/ppa/+build/26/+files/netapplet-1.0.0.tar.gz'
+    build_log_url:
+    u'http://.../~cprov/+archive/ppa/+build/26/+files/netapplet-1.0.0.tar.gz'
     buildstate: u'Failed to build'
     can_be_cancelled: False
     can_be_rescored: False
     can_be_retried: True
     changesfile_url: None
-    current_source_publication_link: u'http://.../~cprov/+archive/ppa/+sourcepub/27'
+    current_source_publication_link:
+    u'http://.../~cprov/+archive/ppa/+sourcepub/27'
     date_first_dispatched: None
     datebuilt: u'2007-07-08T00:00:01+00:00'
     datecreated: u'2007-07-08T00:00:00+00:00'

=== modified file 'lib/lp/soyuz/tests/test_build.py'
--- lib/lp/soyuz/tests/test_build.py	2011-11-08 10:00:31 +0000
+++ lib/lp/soyuz/tests/test_build.py	2011-11-14 08:41:25 +0000
@@ -8,6 +8,7 @@
     timedelta,
     )
 from exceptions import AssertionError
+
 import pytz
 import transaction
 from zope.component import getUtility
@@ -100,8 +101,8 @@
         # Builds which were already processed also offer additional
         # information about its process such as the time it was started and
         # finished and its 'log' and 'upload_changesfile' as librarian files.
-        spn=self.factory.getUniqueString()
-        version="%s.1" % self.factory.getUniqueInteger()
+        spn = self.factory.getUniqueString()
+        version = "%s.1" % self.factory.getUniqueInteger()
         spph = self.publisher.getPubSource(
             sourcename=spn, version=version,
             distroseries=self.distroseries,
@@ -391,7 +392,7 @@
         self.assertEquals(
             timedelta(0, 72 * 60),
             new_build.buildqueue_record.estimated_duration)
-        
+
     def test_store_uploadlog_refuses_to_overwrite(self):
         # Storing an upload log for a build will fail if the build already
         # has an upload log.
@@ -403,4 +404,4 @@
         with person_logged_in(self.admin):
             build.status = BuildStatus.FAILEDTOUPLOAD
             build.storeUploadLog('foo')
-        self.assertRaises(AssertionError, build.storeUploadLog, 'bar')   
+        self.assertRaises(AssertionError, build.storeUploadLog, 'bar')

=== modified file 'lib/lp/testing/fixture.py'
--- lib/lp/testing/fixture.py	2011-10-28 05:24:51 +0000
+++ lib/lp/testing/fixture.py	2011-11-14 08:41:25 +0000
@@ -241,8 +241,8 @@
     def setUpQueue(self):
         """Sets up the queue to be used to receive reports.
 
-        The queue is autodelete which means we can only use it once: after that
-        it will be automatically nuked and must be recreated.
+        The queue is autodelete which means we can only use it once: after
+        that it will be automatically nuked and must be recreated.
         """
         self.queue_name, _, _ = self.channel.queue_declare(
             durable=True, auto_delete=True)
@@ -296,6 +296,6 @@
         try:
             receiver.run_forever()
         finally:
-            # Ensure we leave the queue ready to roll, or later calls to sync()
-            # will fail.
+            # Ensure we leave the queue ready to roll, or later calls to
+            # sync() will fail.
             self.setUpQueue()

=== modified file 'lib/lp/translations/browser/tests/test_sharing_details.py'
--- lib/lp/translations/browser/tests/test_sharing_details.py	2011-11-09 14:15:40 +0000
+++ lib/lp/translations/browser/tests/test_sharing_details.py	2011-11-14 08:41:25 +0000
@@ -10,7 +10,7 @@
 from soupmatchers import (
     HTMLContains,
     Tag,
-)
+    )
 
 from canonical.launchpad.testing.pages import (
     extract_text,
@@ -18,9 +18,7 @@
     )
 from canonical.launchpad.webapp import canonical_url
 from canonical.launchpad.webapp.servers import LaunchpadTestRequest
-from canonical.testing.layers import (
-    DatabaseFunctionalLayer,
-    )
+from canonical.testing.layers import DatabaseFunctionalLayer
 from lp.app.enums import ServiceUsage
 from lp.services.features.testing import FeatureFixture
 from lp.testing import (
@@ -215,16 +213,16 @@
         # If only template synchronization is enabled on the upstream series,
         # is_upstream_synchronization_enabled returns False.
         self.configureSharing(
-            translation_import_mode=
-                TranslationsBranchImportMode.IMPORT_TEMPLATES)
+            translation_import_mode=(
+                TranslationsBranchImportMode.IMPORT_TEMPLATES))
         self.assertFalse(self.view.is_upstream_synchronization_enabled)
 
     def test_is_upstream_synchronization_enabled__import_translations(self):
         # If full translation synchronization is enabled on the upstream
         # series, is_upstream_synchronization_enabled returns False.
         self.configureSharing(
-            translation_import_mode=
-                TranslationsBranchImportMode.IMPORT_TRANSLATIONS)
+            translation_import_mode=(
+                TranslationsBranchImportMode.IMPORT_TRANSLATIONS))
         self.assertTrue(self.view.is_upstream_synchronization_enabled)
 
     def test_is_configuration_complete__nothing_configured(self):
@@ -251,7 +249,7 @@
         # If the packaging link is set and if an upstream series
         # uses Launchpad translations but if the other conditions
         # are not fulfilled, is_configuration_complete is False.
-        self.configureSharing(translations_usage = ServiceUsage.LAUNCHPAD)
+        self.configureSharing(translations_usage=ServiceUsage.LAUNCHPAD)
         self.assertFalse(self.view.is_configuration_complete)
 
     def test_is_configuration_complete__no_auto_sync(self):
@@ -262,8 +260,8 @@
         # but if the upstream series does not synchronize translations
         # then is_configuration_complete is False.
         self.configureSharing(
-            set_upstream_branch = True,
-            translations_usage = ServiceUsage.LAUNCHPAD)
+            set_upstream_branch=True,
+            translations_usage=ServiceUsage.LAUNCHPAD)
         self.assertFalse(self.view.is_configuration_complete)
 
     def test_is_configuration_complete__all_conditions_fulfilled(self):
@@ -274,10 +272,10 @@
         #   - the upstream series synchronizes translations
         # then is_configuration_complete is True.
         self.configureSharing(
-            set_upstream_branch = True,
-            translations_usage = ServiceUsage.LAUNCHPAD,
-            translation_import_mode =
-                TranslationsBranchImportMode.IMPORT_TRANSLATIONS)
+            set_upstream_branch=True,
+            translations_usage=ServiceUsage.LAUNCHPAD,
+            translation_import_mode=(
+                TranslationsBranchImportMode.IMPORT_TRANSLATIONS))
         self.assertTrue(self.view.is_configuration_complete)
 
     def test_template_info__no_sharing(self):
@@ -308,8 +306,8 @@
         self.configureSharing(
             set_upstream_branch=True,
             translations_usage=ServiceUsage.LAUNCHPAD,
-            translation_import_mode=
-                TranslationsBranchImportMode.IMPORT_TRANSLATIONS)
+            translation_import_mode=(
+                TranslationsBranchImportMode.IMPORT_TRANSLATIONS))
         expected = [
             {
                 'name': 'shared-template',

=== modified file 'lib/lp/translations/tests/test_translationmerger.py'
--- lib/lp/translations/tests/test_translationmerger.py	2011-10-28 21:39:25 +0000
+++ lib/lp/translations/tests/test_translationmerger.py	2011-11-14 08:41:25 +0000
@@ -77,8 +77,7 @@
         # one.
         trunk_potmsgset = self.factory.makePOTMsgSet(
             self.trunk_template, singular='foo')
-        stable_potmsgset = self.factory.makePOTMsgSet(
-            self.stable_template, singular='foo')
+        self.factory.makePOTMsgSet(self.stable_template, singular='foo')
 
         self.merger.mergePOTMsgSets()
 
@@ -93,8 +92,7 @@
         # produced.  It will produce the same situation.
         trunk_potmsgset = self.factory.makePOTMsgSet(
             self.trunk_template, singular='foo')
-        stable_potmsgset = self.factory.makePOTMsgSet(
-            self.stable_template, singular='foo')
+        self.factory.makePOTMsgSet(self.stable_template, singular='foo')
 
         self.merger.mergePOTMsgSets()
         self.merger.mergePOTMsgSets()
@@ -301,7 +299,6 @@
         self.merger.mergePOTMsgSets()
 
         # The POTMsgSets are now merged.
-        potmsgset = self.trunk_template.getPOTMsgSetByMsgIDText('foo')
 
         # The "losing" message stays current within its template.
         self.assertEqual(self._getTranslations(), ('bar2', 'splat2'))
@@ -637,7 +634,6 @@
         message2.is_current_ubuntu = True
         message2.potmsgset = self.trunk_potmsgset
         message2.potemplate = self.trunk_template
-        ids = (message1.id, message2.id)
 
         self.merger._scrubPOTMsgSetTranslations(self.trunk_potmsgset)
 
@@ -829,7 +825,7 @@
 
     def test_no_templates(self):
         """A Packaging with no templates is ignored."""
-        packaging = self.makePackagingLink()
+        self.makePackagingLink()
         self.assertContentEqual(
             [], TranslationMerger.findMergeablePackagings())