← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~cjwatson/launchpad/dead-code into lp:launchpad

 

Colin Watson has proposed merging lp:~cjwatson/launchpad/dead-code into lp:launchpad.

Commit message:
Remove various pieces of unused code.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/dead-code/+merge/272670

Remove various pieces of unused code.

This is based on an initial run of a version of https://pypi.python.org/pypi/vulture modified to understand at least some bits of ZCML registration.  There's still a very large amount of noise in its output, for all sorts of reasons: some are just straightforward dynamic name computations or references from dependencies that I didn't scan, but it also doesn't understand tests being referenced by the testrunner, page templates, webservice registrations, browser actions, or various other patterns like that.  It's therefore a long way off being suitable for any kind of automatic CI use, but it was just about feasible to use it as a basic cruft scanner in conjunction with some thought and some grep verification.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~cjwatson/launchpad/dead-code into lp:launchpad.
=== modified file 'lib/lp/answers/tests/test_doc.py'
--- lib/lp/answers/tests/test_doc.py	2012-06-06 16:04:34 +0000
+++ lib/lp/answers/tests/test_doc.py	2015-09-28 21:49:16 +0000
@@ -70,12 +70,6 @@
     test.globs['newFAQ'] = newFAQ
 
 
-def sourcepackageSetUp(test):
-    setUp(test)
-    ubuntu = getUtility(IDistributionSet).getByName('ubuntu')
-    test.globs['target'] = ubuntu.currentseries.getSourcePackage('evolution')
-
-
 def distributionsourcepackageSetUp(test):
     setUp(test)
     ubuntu = getUtility(IDistributionSet).getByName('ubuntu')

=== removed file 'lib/lp/app/templates/launchpad-readonlyfailure.pt'
--- lib/lp/app/templates/launchpad-readonlyfailure.pt	2012-02-24 04:29:17 +0000
+++ lib/lp/app/templates/launchpad-readonlyfailure.pt	1970-01-01 00:00:00 +0000
@@ -1,24 +0,0 @@
-<html
-  xmlns="http://www.w3.org/1999/xhtml";
-  xmlns:tal="http://xml.zope.org/namespaces/tal";
-  xmlns:metal="http://xml.zope.org/namespaces/metal";
-  xmlns:i18n="http://xml.zope.org/namespaces/i18n";
-  metal:use-macro="view/macro:page/main_only"
-  i18n:domain="launchpad"
->
-  <body>
-    <div class="top-portlet" metal:fill-slot="main">
-      <h1 class="exception">Sorry, you can't do this right now</h1>
-      <p>
-          You cannot make any changes at this time. Launchpad is
-          undergoing maintenance and is running in
-          <strong>read-only</strong> mode.
-      </p>
-      <p>Normal service will resume as soon as possible. You can find more
-         information on the <a href="http://identi.ca/launchpadstatus";>
-         Launchpad system status</a> page.
-      </p>
-      <tal:replace tal:replace="structure view/maybeShowTraceback" />
-    </div>
-  </body>
-</html>

=== modified file 'lib/lp/app/validators/validation.py'
--- lib/lp/app/validators/validation.py	2013-04-10 07:45:16 +0000
+++ lib/lp/app/validators/validation.py	2015-09-28 21:49:16 +0000
@@ -5,7 +5,6 @@
 
 __all__ = [
     'can_be_nominated_for_series',
-    'non_duplicate_branch',
     'valid_bug_number',
     'valid_cve_sequence',
     'validate_new_team_email',
@@ -13,8 +12,6 @@
     'validate_date_interval',
     ]
 
-from textwrap import dedent
-
 from zope.component import getUtility
 from zope.formlib.interfaces import WidgetsError
 
@@ -49,17 +46,6 @@
     return True
 
 
-def non_duplicate_branch(value):
-    """Ensure that this branch hasn't already been linked to this bug."""
-    current_bug = getUtility(ILaunchBag).bug
-    if current_bug.hasBranch(value):
-        raise LaunchpadValidationError(_(dedent("""
-            This branch is already registered on this bug.
-            """)))
-
-    return True
-
-
 def valid_bug_number(value):
     from lp.bugs.interfaces.bug import IBugSet
     bugset = getUtility(IBugSet)

=== removed file 'lib/lp/app/widgets/context.py'
--- lib/lp/app/widgets/context.py	2015-07-08 16:05:11 +0000
+++ lib/lp/app/widgets/context.py	1970-01-01 00:00:00 +0000
@@ -1,36 +0,0 @@
-# Copyright 2009-2011 Canonical Ltd.  This software is licensed under the
-# GNU Affero General Public License version 3 (see the file LICENSE).
-
-#
-# Code to create a widget that encodes the value of the request context into
-# the form.
-#
-
-__metaclass__ = type
-
-from zope.interface import (
-    implementer,
-    Interface,
-    )
-
-from lp.app.widgets.owner import RequestWidget
-
-
-class IContextWidget(Interface):
-    """The interface for a ContextWidget. A ContextWidget provides a hidden
-    field that equates to the context object. So, for example, say you are
-    creating a form to add a new CVE reference on a bug, you can provide the
-    bug to the form using a contextWidget. It's similar to the OwnerWidget,
-    which provides the user to the form as a field. This just provides the
-    context object that the form was rendered off."""
-    pass
-
-
-@implementer(IContextWidget)
-class ContextWidget(RequestWidget):
-    def __init__(self, context, vocabulary, request):
-        RequestWidget.__init__(self, context, request)
-
-    def getInputValue(self):
-        return self.context.context.id
-

=== modified file 'lib/lp/app/widgets/image.py'
--- lib/lp/app/widgets/image.py	2015-07-08 16:05:11 +0000
+++ lib/lp/app/widgets/image.py	2015-09-28 21:49:16 +0000
@@ -167,61 +167,3 @@
             return self._image_file_alias
         elif action == "delete":
             return None
-
-
-class GotchiTiedWithHeadingWidget(ImageChangeWidget):
-    """Widget for adding an image which also returns a copy of the uploaded
-    image.
-
-    If the uploaded image's width is bigger than resized_image_width or its
-    height is bigger than resized_image_height, the copy image will be scaled
-    down, otherwise the copy image will be the same as the original one.
-    """
-
-    resized_image_width = float(64)
-    resized_image_height = float(64)
-
-    def getInputValue(self):
-        retval = ImageChangeWidget.getInputValue(self)
-        if retval is None or retval is KEEP_SAME_IMAGE:
-            # This is just for consistency, so that our callsites can always
-            # unpack the value we return.
-            return (retval, retval)
-
-        file_alias_orig = retval
-        import PIL.Image
-        self._image.seek(0)
-        original_content = StringIO(self._image.read())
-        image = PIL.Image.open(original_content)
-        width, height = image.size
-        if (width <= self.resized_image_width and
-            height <= self.resized_image_height):
-            # No resize needed.
-            content = original_content
-        else:
-            # Get the new (width, height), keeping the original scale.
-            if width > height:
-                new_width = self.resized_image_width
-                new_height = (self.resized_image_height / width) * height
-            else:
-                new_height = self.resized_image_height
-                new_width = (self.resized_image_width / height) * width
-
-            new_image = image.resize(
-                (int(new_width), int(new_height)), PIL.Image.ANTIALIAS)
-            content = StringIO()
-            format = None
-            for key, mime in PIL.Image.MIME.items():
-                if mime == file_alias_orig.mimetype:
-                    format = key
-                    break
-            assert format is not None, (
-                "No format found for mimetype '%s'" % file_alias_orig.mimetype)
-            new_image.save(content, format=format)
-
-        content.seek(0)
-        file_alias_small = getUtility(ILibraryFileAliasSet).create(
-            name=file_alias_orig.filename, size=content.len,
-            file=content, contentType=file_alias_orig.mimetype)
-        return file_alias_orig, file_alias_small
-

=== removed file 'lib/lp/app/widgets/link.py'
--- lib/lp/app/widgets/link.py	2013-04-10 08:05:17 +0000
+++ lib/lp/app/widgets/link.py	1970-01-01 00:00:00 +0000
@@ -1,28 +0,0 @@
-# Copyright 2009 Canonical Ltd.  This software is licensed under the
-# GNU Affero General Public License version 3 (see the file LICENSE).
-
-"""A simple display widget that renders like the tal expression fmt:link."""
-
-__metaclass__ = type
-__all__ = [
-    'LinkWidget',
-    ]
-
-from zope.component import queryAdapter
-from zope.formlib.widget import DisplayWidget
-from zope.traversing.interfaces import IPathAdapter
-
-
-class LinkWidget(DisplayWidget):
-    """Renders using the tal formatter for fmt:link.
-
-    Used by specifying `custom_widget('fieldname', LinkWidget)`.
-    """
-
-    def __init__(self, context, request, *ignored):
-        """Ignores extra params such as vocabularies."""
-        super(DisplayWidget, self).__init__(context, request)
-
-    def __call__(self):
-        adapter = queryAdapter(self._data, IPathAdapter, 'fmt')
-        return adapter.link('')

=== modified file 'lib/lp/archivepublisher/utils.py'
--- lib/lp/archivepublisher/utils.py	2013-08-29 10:29:01 +0000
+++ lib/lp/archivepublisher/utils.py	2015-09-28 21:49:16 +0000
@@ -13,7 +13,6 @@
 
 import bz2
 import gzip
-from operator import itemgetter
 import os
 import stat
 import tempfile
@@ -37,18 +36,6 @@
     return ppa.owner.name
 
 
-def count_alive(store, logger):
-    """Print counts of how many alive objects the store knows about."""
-    counts = {}
-    for obj_info in store._iter_alive():
-        name = obj_info.cls_info.cls.__name__
-        counts[name] = counts.get(name, 0) + 1
-
-    sorted_items = sorted(counts.items(), key=itemgetter(0), reverse=True)
-    for (name, count) in sorted_items:
-        logger.debug('%-20s %d' % (name, count))
-
-
 class PlainTempFile:
 
     # Filename suffix.

=== modified file 'lib/lp/blueprints/interfaces/specificationmessage.py'
--- lib/lp/blueprints/interfaces/specificationmessage.py	2013-01-07 02:40:55 +0000
+++ lib/lp/blueprints/interfaces/specificationmessage.py	2015-09-28 21:49:16 +0000
@@ -46,9 +46,3 @@
 
     def get(specificationmessageid):
         """Retrieve an ISpecificationMessage by its ID."""
-
-    def getBySpecificationAndMessage(specification, message):
-        """Return the corresponding ISpecificationMesssage.
-
-        Return None if no such ISpecificationMesssage exists.
-        """

=== modified file 'lib/lp/blueprints/model/specificationmessage.py'
--- lib/lp/blueprints/model/specificationmessage.py	2015-07-08 16:05:11 +0000
+++ lib/lp/blueprints/model/specificationmessage.py	2015-09-28 21:49:16 +0000
@@ -52,8 +52,3 @@
     def get(self, specmessageid):
         """See ISpecificationMessageSet."""
         return SpecificationMessage.get(specmessageid)
-
-    def getBySpecificationAndMessage(self, spec, message):
-        """See ISpecificationMessageSet."""
-        return SpecificationMessage.selectOneBy(
-            specification=spec, message=message)

=== modified file 'lib/lp/bugs/browser/bugalsoaffects.py'
--- lib/lp/bugs/browser/bugalsoaffects.py	2014-06-09 22:32:44 +0000
+++ lib/lp/bugs/browser/bugalsoaffects.py	2015-09-28 21:49:16 +0000
@@ -342,15 +342,6 @@
         self.next_url = canonical_url(task_added)
 
 
-class IAddDistroBugTaskForm(IAddBugTaskForm):
-
-    sourcepackagename = Choice(
-        title=_("Source Package Name"), required=False,
-        description=_("The source package in which the bug occurs. "
-                      "Leave blank if you are not sure."),
-        vocabulary='DistributionSourcePackage')
-
-
 class DistroBugTaskCreationStep(BugTaskCreationStep):
     """Specialized BugTaskCreationStep for reporting a bug in a distribution.
     """

=== modified file 'lib/lp/bugs/browser/bugcomment.py'
--- lib/lp/bugs/browser/bugcomment.py	2015-07-09 20:06:17 +0000
+++ lib/lp/bugs/browser/bugcomment.py	2015-09-28 21:49:16 +0000
@@ -310,13 +310,6 @@
     def page_description(self):
         return self.comment.text_contents
 
-    @property
-    def privacy_notice_classes(self):
-        if not self.context.bug.private:
-            return 'hidden'
-        else:
-            return ''
-
 
 class BugCommentBoxViewMixin:
     """A class which provides proxied Librarian URLs for bug attachments."""

=== modified file 'lib/lp/bugs/browser/buglisting.py'
--- lib/lp/bugs/browser/buglisting.py	2015-09-08 05:39:50 +0000
+++ lib/lp/bugs/browser/buglisting.py	2015-09-28 21:49:16 +0000
@@ -1673,12 +1673,6 @@
         tasklist = self.context.searchTasks(params)
         return tasklist[:quantity]
 
-    def getMostRecentlyUpdatedBugTasks(self, limit=5):
-        """Return the most recently updated bugtasks for this target."""
-        params = BugTaskSearchParams(
-            orderby="-date_last_updated", omit_dupes=True, user=self.user)
-        return list(self.context.searchTasks(params)[:limit])
-
 
 class TextualBugTaskSearchListingView(BugTaskSearchListingView):
     """View that renders a list of bug IDs for a given set of search criteria.
@@ -1747,11 +1741,6 @@
         return target_has_expirable_bugs_listing(self.context)
 
     @property
-    def inactive_expiration_age(self):
-        """Return the number of days an bug must be inactive to expire."""
-        return config.malone.days_before_expiration
-
-    @property
     def columns_to_show(self):
         """Show the columns that summarise expirable bugs."""
         if (IDistribution.providedBy(self.context)

=== modified file 'lib/lp/bugs/browser/bugsubscription.py'
--- lib/lp/bugs/browser/bugsubscription.py	2015-07-09 20:06:17 +0000
+++ lib/lp/bugs/browser/bugsubscription.py	2015-09-28 21:49:16 +0000
@@ -202,19 +202,14 @@
     def _subscribers_for_current_user(self):
         """Return a dict of the subscribers for the current user."""
         persons_for_user = {}
-        person_count = 0
         bug = self.context.bug
         for person in bug.getSubscribersForPerson(self.user):
             if person.id not in persons_for_user:
                 persons_for_user[person.id] = person
-                person_count += 1
-
-        self._subscriber_count_for_current_user = person_count
         return persons_for_user.values()
 
     def initialize(self):
         """See `LaunchpadFormView`."""
-        self._subscriber_count_for_current_user = 0
         self._redirecting_to_bug_list = False
         super(BugSubscriptionSubscribeSelfView, self).initialize()
 

=== modified file 'lib/lp/bugs/browser/bugtask.py'
--- lib/lp/bugs/browser/bugtask.py	2015-09-15 01:56:17 +0000
+++ lib/lp/bugs/browser/bugtask.py	2015-09-28 21:49:16 +0000
@@ -909,13 +909,6 @@
             '<span><a href="/+help-bugs/bug-heat.html" target="help" '
             'class="sprite flame">%d</a></span>' % self.context.bug.heat)
 
-    @property
-    def privacy_notice_classes(self):
-        if not self.context.bug.private:
-            return 'hidden'
-        else:
-            return ''
-
 
 class BugTaskBatchedCommentsAndActivityView(BugTaskView):
     """A view for displaying batches of bug comments and activity."""

=== modified file 'lib/lp/bugs/browser/bugtracker.py'
--- lib/lp/bugs/browser/bugtracker.py	2015-07-08 16:05:11 +0000
+++ lib/lp/bugs/browser/bugtracker.py	2015-09-28 21:49:16 +0000
@@ -7,7 +7,6 @@
 
 __all__ = [
     'BugTrackerAddView',
-    'BugTrackerBreadcrumb',
     'BugTrackerComponentGroupNavigation',
     'BugTrackerEditView',
     'BugTrackerEditComponentView',
@@ -550,16 +549,6 @@
         return u"Bug trackers"
 
 
-class BugTrackerBreadcrumb(Breadcrumb):
-    """Builds a breadcrumb for an `IBugTracker`."""
-
-    rootsite = None
-
-    @property
-    def text(self):
-        return self.context.title
-
-
 @implementer(IRemoteBug)
 class RemoteBug:
     """Represents a bug in a remote bug tracker."""

=== modified file 'lib/lp/bugs/browser/structuralsubscription.py'
--- lib/lp/bugs/browser/structuralsubscription.py	2015-07-21 09:04:01 +0000
+++ lib/lp/bugs/browser/structuralsubscription.py	2015-09-28 21:49:16 +0000
@@ -320,15 +320,6 @@
         """Return the teams that the current user is an administrator of."""
         return list(self.user.getAdministratedTeams())
 
-    @property
-    def show_details_portlet(self):
-        """Show details portlet?
-
-        Returns `True` if the portlet details is available
-        and should be shown for the context.
-        """
-        return IDistributionSourcePackage.providedBy(self.context)
-
 
 class StructuralSubscriptionTargetTraversalMixin:
     """Mix-in class that provides +subscription/<SUBSCRIBER> traversal."""

=== modified file 'lib/lp/bugs/externalbugtracker/mantis.py'
--- lib/lp/bugs/externalbugtracker/mantis.py	2013-02-11 03:32:00 +0000
+++ lib/lp/bugs/externalbugtracker/mantis.py	2015-09-28 21:49:16 +0000
@@ -390,58 +390,6 @@
 
         return value_node.strip()
 
-    def _findValueBelowKey(self, page_soup, key):
-        """Scrape a value from a Mantis bug view page where the value
-        is displayed directly below the key.
-
-        The Mantis bug view page uses HTML tables for both layout and
-        representing tabular data, often within the same table. This
-        method assumes that the key and value are within the same
-        column on adjacent rows, with the key preceding the value:
-
-        ...
-        <tr>...<td>Key</td>...</tr>
-        <tr>...<td>Value</td>...</tr>
-        ...
-
-        This method does not compensate for colspan or rowspan.
-        """
-        key_node = page_soup.find(
-            text=lambda node: (node.strip() == key
-                               and not isinstance(node, Comment)))
-        if key_node is None:
-            raise UnparsableBugData("Key %r not found." % (key,))
-
-        key_cell = key_node.parent
-        if key_cell is None:
-            raise UnparsableBugData("Cell for key %r not found." % (key,))
-
-        key_row = key_cell.parent
-        if key_row is None:
-            raise UnparsableBugData("Row for key %r not found." % (key,))
-
-        try:
-            key_pos = key_row.findAll('td').index(key_cell)
-        except ValueError:
-            raise UnparsableBugData(
-                "Key cell in row for key %r not found." % (key,))
-
-        value_row = key_row.findNextSibling('tr')
-        if value_row is None:
-            raise UnparsableBugData(
-                "Value row for key %r not found." % (key,))
-
-        value_cell = value_row.findAll('td')[key_pos]
-        if value_cell is None:
-            raise UnparsableBugData(
-                "Value cell for key %r not found." % (key,))
-
-        value_node = value_cell.string
-        if value_node is None:
-            raise UnparsableBugData("Value for key %r not found." % (key,))
-
-        return value_node.strip()
-
     def getRemoteImportance(self, bug_id):
         """See `ExternalBugTracker`.
 

=== modified file 'lib/lp/bugs/interfaces/bug.py'
--- lib/lp/bugs/interfaces/bug.py	2015-09-25 10:23:48 +0000
+++ lib/lp/bugs/interfaces/bug.py	2015-09-28 21:49:16 +0000
@@ -1160,13 +1160,6 @@
         If it can't be found, NotFoundError will be raised.
         """
 
-    def queryByRemoteBug(bugtracker, remotebug):
-        """Find one or None bugs for the BugWatch and bug tracker.
-
-        Find one or None bugs in Launchpad that have a BugWatch matching
-        the given bug tracker and remote bug id.
-        """
-
     def createBug(bug_params, notify_event=True):
         """Create a bug and return it.
 

=== modified file 'lib/lp/bugs/interfaces/bugtarget.py'
--- lib/lp/bugs/interfaces/bugtarget.py	2015-01-30 18:24:07 +0000
+++ lib/lp/bugs/interfaces/bugtarget.py	2015-09-28 21:49:16 +0000
@@ -6,7 +6,6 @@
 __metaclass__ = type
 
 __all__ = [
-    'BugDistroSeriesTargetDetails',
     'IBugTarget',
     'IHasBugs',
     'IHasExpirableBugs',
@@ -360,28 +359,6 @@
     IBugTask, 'transitionToTarget', 'target', IBugTarget)
 
 
-class BugDistroSeriesTargetDetails:
-    """The details of a bug targeted to a specific IDistroSeries.
-
-    The following attributes are provided:
-
-    :series: The IDistroSeries.
-    :istargeted: Is there a fix targeted to this series?
-    :sourcepackage: The sourcepackage to which the fix would be targeted.
-    :assignee: An IPerson, or None if no assignee.
-    :status: A BugTaskStatus dbschema item, or None, if series is not
-        targeted.
-    """
-
-    def __init__(self, series, istargeted=False, sourcepackage=None,
-                 assignee=None, status=None):
-        self.series = series
-        self.istargeted = istargeted
-        self.sourcepackage = sourcepackage
-        self.assignee = assignee
-        self.status = status
-
-
 class IHasOfficialBugTags(Interface):
     """An entity that exposes a set of official bug tags."""
 

=== modified file 'lib/lp/bugs/model/bug.py'
--- lib/lp/bugs/model/bug.py	2015-09-25 10:23:48 +0000
+++ lib/lp/bugs/model/bug.py	2015-09-28 21:49:16 +0000
@@ -2571,18 +2571,6 @@
                     "Unable to locate bug with nickname %s." % bugid)
         return bug
 
-    def queryByRemoteBug(self, bugtracker, remotebug):
-        """See `IBugSet`."""
-        bug = Bug.selectFirst("""
-                bugwatch.bugtracker = %s AND
-                bugwatch.remotebug = %s AND
-                bugwatch.bug = bug.id
-                """ % sqlvalues(bugtracker.id, str(remotebug)),
-                distinct=True,
-                clauseTables=['BugWatch'],
-                orderBy=['datecreated'])
-        return bug
-
     def createBug(self, bug_params, notify_event=True):
         """See `IBugSet`."""
         # Make a copy of the parameter object, because we might modify some

=== modified file 'lib/lp/bugs/model/tests/test_bugtask.py'
--- lib/lp/bugs/model/tests/test_bugtask.py	2014-07-08 09:53:50 +0000
+++ lib/lp/bugs/model/tests/test_bugtask.py	2015-09-28 21:49:16 +0000
@@ -118,9 +118,6 @@
 BugData = namedtuple("BugData", ['owner', 'distro', 'distro_release',
 'source_package', 'bug', 'generic_task', 'series_task', ])
 
-ConjoinedData = namedtuple("ConjoinedData", ['alsa_utils', 'generic_task',
-    'devel_focus_task'])
-
 
 class TestBugTaskAdaptation(TestCase):
     """Verify bugtask adaptation."""
@@ -1211,95 +1208,6 @@
             self.firefox_upstream.target.bug_supervisor)
         flush_database_updates()
 
-    def assertBugTaskIsPendingBugWatchElsewhere(self, bugtask):
-        """Assert the bugtask is pending a bug watch elsewhere.
-
-        Pending a bugwatch elsewhere means that at least one of the bugtask's
-        related task's target isn't using Malone, and that
-        related_bugtask.bugwatch is None.
-        """
-        non_malone_using_bugtasks = [
-            related_task for related_task in bugtask.related_tasks
-            if not related_task.pillar.official_malone]
-        pending_bugwatch_bugtasks = [
-            related_bugtask for related_bugtask in non_malone_using_bugtasks
-            if related_bugtask.bugwatch is None]
-        self.assert_(
-            len(pending_bugwatch_bugtasks) > 0,
-            'Bugtask %s on %s has no related bug watches elsewhere.' % (
-                bugtask.id, bugtask.target.displayname))
-
-    def assertBugTaskIsResolvedUpstream(self, bugtask):
-        """Make sure at least one of the related upstream tasks is resolved.
-
-        "Resolved", for our purposes, means either that one of the related
-        tasks is an upstream task in FIXCOMMITTED or FIXRELEASED state, or
-        it is a task with a bugwatch, and in FIXCOMMITTED, FIXRELEASED, or
-        INVALID state.
-        """
-        resolved_upstream_states = [
-            BugTaskStatus.FIXCOMMITTED, BugTaskStatus.FIXRELEASED]
-        resolved_bugwatch_states = [
-            BugTaskStatus.FIXCOMMITTED, BugTaskStatus.FIXRELEASED,
-            BugTaskStatus.INVALID]
-
-        # Helper functions for the list comprehension below.
-        def _is_resolved_upstream_task(bugtask):
-            return (
-                bugtask.product is not None and
-                bugtask.status in resolved_upstream_states)
-
-        def _is_resolved_bugwatch_task(bugtask):
-            return (
-                bugtask.bugwatch and bugtask.status in
-                resolved_bugwatch_states)
-
-        resolved_related_tasks = [
-            related_task for related_task in bugtask.related_tasks
-            if (_is_resolved_upstream_task(related_task) or
-                _is_resolved_bugwatch_task(related_task))]
-
-        self.assert_(len(resolved_related_tasks) > 0)
-        self.assert_(
-            len(resolved_related_tasks) > 0,
-            'Bugtask %s on %s has no resolved related tasks.' % (
-                bugtask.id, bugtask.target.displayname))
-
-    def assertBugTaskIsOpenUpstream(self, bugtask):
-        """Make sure at least one of the related upstream tasks is open.
-
-        "Open", for our purposes, means either that one of the related
-        tasks is an upstream task or a task with a bugwatch which has
-        one of the states listed in open_states.
-        """
-        open_states = [
-            BugTaskStatus.NEW,
-            BugTaskStatus.INCOMPLETE,
-            BugTaskStatus.CONFIRMED,
-            BugTaskStatus.INPROGRESS,
-            BugTaskStatus.UNKNOWN]
-
-        # Helper functions for the list comprehension below.
-        def _is_open_upstream_task(bugtask):
-            return (
-                bugtask.product is not None and
-                bugtask.status in open_states)
-
-        def _is_open_bugwatch_task(bugtask):
-            return (
-                bugtask.bugwatch and bugtask.status in
-                open_states)
-
-        open_related_tasks = [
-            related_task for related_task in bugtask.related_tasks
-            if (_is_open_upstream_task(related_task) or
-                _is_open_bugwatch_task(related_task))]
-
-        self.assert_(
-            len(open_related_tasks) > 0,
-            'Bugtask %s on %s has no open related tasks.' % (
-                bugtask.id, bugtask.target.displayname))
-
     def _hasUpstreamTask(self, bug):
         """Does this bug have an upstream task associated with it?
 
@@ -1310,16 +1218,6 @@
                 return True
         return False
 
-    def assertShouldBeShownOnNoUpstreamTaskSearch(self, bugtask):
-        """Should the bugtask be shown in the search no upstream task search?
-
-        Returns True if yes, otherwise False.
-        """
-        self.assert_(
-            not self._hasUpstreamTask(bugtask.bug),
-            'Bugtask %s on %s has upstream tasks.' % (
-                bugtask.id, bugtask.target.displayname))
-
 
 class BugTaskSetFindExpirableBugTasksTest(unittest.TestCase):
     """Test `BugTaskSet.findExpirableBugTasks()` behaviour."""

=== modified file 'lib/lp/bugs/scripts/debbugs.py'
--- lib/lp/bugs/scripts/debbugs.py	2013-01-07 02:40:55 +0000
+++ lib/lp/bugs/scripts/debbugs.py	2015-09-28 21:49:16 +0000
@@ -30,26 +30,11 @@
             self.tags = tags
         if report:
             self.report = report
-        description = None
 
     def is_open(self):
         #return not self.done and 'fixed' not in self.tags
         return self.status != 'done' and 'fixed' not in self.tags
 
-    def affects_unstable(self):
-        return 'sid' in self.tags or ('woody' not in self.tags and
-                                 'sarge' not in self.tags and
-                                 'experimental' not in self.tags)
-
-    def affects_package(self, packageset):
-        for package in self.packagelist():
-            if package in packageset:
-                return True
-        return False
-
-    def is_release_critical(self):
-        return self.severity in ('critical', 'grave', 'serious')
-
     def __str__(self):
         return 'Bug#%d' % self.id
 
@@ -64,13 +49,6 @@
 
         return getattr(self, name)
 
-    def packagelist(self):
-        if self.package is None:
-            return []
-        if ',' in self.package:
-            return self.package.split(',')
-        return [self.package]
-
     def emails(self):
         if self._emails:
             return self._emails
@@ -80,13 +58,10 @@
         return self._emails
 
 class IndexParseError(Exception): pass
-class StatusParseError(Exception): pass
-class StatusMissing(Exception): pass
 class SummaryMissing(Exception): pass
 class SummaryParseError(Exception): pass
 class SummaryVersionError(Exception): pass
 class ReportMissing(Exception): pass
-class ReportParseError(Exception): pass
 class LogMissing(Exception): pass
 class LogParseFailed(Exception): pass
 class InternalError(Exception): pass

=== modified file 'lib/lp/bugs/tests/test_bugchanges.py'
--- lib/lp/bugs/tests/test_bugchanges.py	2015-07-21 09:04:01 +0000
+++ lib/lp/bugs/tests/test_bugchanges.py	2015-09-28 21:49:16 +0000
@@ -26,7 +26,6 @@
 from lp.bugs.model.bugnotification import BugNotification
 from lp.bugs.scripts.bugnotification import construct_email_notifications
 from lp.services.librarian.browser import ProxiedLibraryFileAlias
-from lp.services.webapp.interfaces import ILaunchBag
 from lp.services.webapp.publisher import canonical_url
 from lp.testing import (
     api_url,
@@ -44,7 +43,6 @@
 
     def setUp(self):
         super(TestBugChanges, self).setUp('foo.bar@xxxxxxxxxxxxx')
-        self.admin_user = getUtility(ILaunchBag).user
         self.user = self.factory.makePerson(
             displayname='Arthur Dent', selfgenerated_bugnotifications=True)
         self.product = self.factory.makeProduct(

=== modified file 'lib/lp/bugs/tests/test_bugtarget.py'
--- lib/lp/bugs/tests/test_bugtarget.py	2013-01-07 02:40:55 +0000
+++ lib/lp/bugs/tests/test_bugtarget.py	2015-09-28 21:49:16 +0000
@@ -17,14 +17,8 @@
 from zope.component import getUtility
 
 from lp.bugs.interfaces.bug import CreateBugParams
-from lp.bugs.interfaces.bugtask import (
-    BugTaskStatus,
-    IBugTaskSet,
-    )
-from lp.registry.interfaces.distribution import (
-    IDistribution,
-    IDistributionSet,
-    )
+from lp.bugs.interfaces.bugtask import IBugTaskSet
+from lp.registry.interfaces.distribution import IDistributionSet
 from lp.registry.interfaces.product import IProductSet
 from lp.registry.interfaces.projectgroup import IProjectGroupSet
 from lp.services.webapp.interfaces import ILaunchBag
@@ -147,27 +141,6 @@
     return bug
 
 
-def sourcepackage_filebug_for_question(source_package, summary, status=None):
-    """Setup a bug with only one BugTask that can provide a QuestionTarget."""
-    bug = sourcepackage_filebug(source_package, summary, status=status)
-    # The distribution bugtask interferes with bugtarget-questiontarget.txt.
-    for bugtask in bug.bugtasks:
-        if IDistribution.providedBy(bugtask.target):
-            bugtask.transitionToStatus(
-                BugTaskStatus.INVALID, getUtility(ILaunchBag).user)
-    return bug
-
-
-def sourcePackageSetUp(test):
-    """Setup the `ISourcePackage` test."""
-    setUp(test)
-    ubuntu = getUtility(IDistributionSet).getByName('ubuntu')
-    warty = ubuntu.getSeries('warty')
-    test.globs['bugtarget'] = warty.getSourcePackage('mozilla-firefox')
-    test.globs['filebug'] = sourcepackage_filebug
-    test.globs['question_target'] = ubuntu.getSourcePackage('mozilla-firefox')
-
-
 class BugTargetQuestionTargetTestCase(TestCaseWithFactory):
     """Converting a bug into a question."""
 

=== modified file 'lib/lp/buildmaster/interfaces/builder.py'
--- lib/lp/buildmaster/interfaces/builder.py	2015-04-20 09:48:57 +0000
+++ lib/lp/buildmaster/interfaces/builder.py	2015-09-28 21:49:16 +0000
@@ -14,7 +14,6 @@
     'CannotResumeHost',
     'IBuilder',
     'IBuilderSet',
-    'ProtocolVersionMismatch',
     ]
 
 from lazr.restful.declarations import (
@@ -85,10 +84,6 @@
         self.error_information = error_information
 
 
-class ProtocolVersionMismatch(BuildDaemonError):
-    """The build slave had a protocol version. This is a serious error."""
-
-
 class CannotResumeHost(BuildDaemonError):
     """The build slave virtual machine cannot be resumed."""
 

=== modified file 'lib/lp/buildmaster/model/builder.py'
--- lib/lp/buildmaster/model/builder.py	2015-07-08 16:05:11 +0000
+++ lib/lp/buildmaster/model/builder.py	2015-09-28 21:49:16 +0000
@@ -68,10 +68,7 @@
     ISlaveStore,
     IStore,
     )
-from lp.services.database.sqlbase import (
-    SQLBase,
-    sqlvalues,
-    )
+from lp.services.database.sqlbase import SQLBase
 from lp.services.database.stormbase import StormBase
 from lp.services.propertycache import (
     cachedproperty,
@@ -102,7 +99,6 @@
     _builderok = BoolCol(dbName='builderok', notNull=True)
     failnotes = StringCol(dbName='failnotes')
     virtualized = BoolCol(dbName='virtualized', default=True, notNull=True)
-    speedindex = IntCol(dbName='speedindex')
     manual = BoolCol(dbName='manual', default=False)
     vm_host = StringCol(dbName='vm_host')
     active = BoolCol(dbName='active', notNull=True, default=True)
@@ -242,14 +238,6 @@
 
         :return: A candidate job.
         """
-        def qualify_subquery(job_type, sub_query):
-            """Put the sub-query into a job type context."""
-            qualified_query = """
-                ((BuildFarmJob.job_type != %s) OR EXISTS(%%s))
-            """ % sqlvalues(job_type)
-            qualified_query %= sub_query
-            return qualified_query
-
         job_type_conditions = []
         job_sources = specific_build_farm_job_sources()
         for job_type, job_source in job_sources.iteritems():

=== modified file 'lib/lp/buildmaster/tests/mock_slaves.py'
--- lib/lp/buildmaster/tests/mock_slaves.py	2015-09-07 11:03:39 +0000
+++ lib/lp/buildmaster/tests/mock_slaves.py	2015-09-28 21:49:16 +0000
@@ -276,7 +276,6 @@
 
     # The URL for the XML-RPC service set up by `BuilddSlaveTestSetup`.
     BASE_URL = 'http://localhost:8221'
-    TEST_URL = '%s/rpc/' % (BASE_URL,)
 
     def getServerSlave(self):
         """Set up a test build slave server.

=== modified file 'lib/lp/code/browser/branch.py'
--- lib/lp/code/browser/branch.py	2015-09-23 15:38:13 +0000
+++ lib/lp/code/browser/branch.py	2015-09-28 21:49:16 +0000
@@ -29,10 +29,6 @@
 
 from datetime import datetime
 
-from lazr.enum import (
-    EnumeratedType,
-    Item,
-    )
 from lazr.lifecycle.event import ObjectModifiedEvent
 from lazr.lifecycle.snapshot import Snapshot
 from lazr.restful.fields import Reference
@@ -1172,27 +1168,6 @@
         return {'reviewer': self.context.code_reviewer}
 
 
-class RegisterProposalStatus(EnumeratedType):
-    """A restricted status enum for the register proposal form."""
-
-    # The text in this enum is different from the general proposal status
-    # enum as we want the help text that is shown in the form to be more
-    # relevant to the registration of the proposal.
-
-    NEEDS_REVIEW = Item("""
-        Needs review
-
-        The changes are ready for review.
-        """)
-
-    WORK_IN_PROGRESS = Item("""
-        Work in progress
-
-        The changes are still being actively worked on, and are not
-        yet ready for review.
-        """)
-
-
 class RegisterProposalSchema(Interface):
     """The schema to define the form for registering a new merge proposal."""
     target_branch = Choice(

=== modified file 'lib/lp/code/browser/branchsubscription.py'
--- lib/lp/code/browser/branchsubscription.py	2015-02-16 13:08:52 +0000
+++ lib/lp/code/browser/branchsubscription.py	2015-09-28 21:49:16 +0000
@@ -106,8 +106,6 @@
 
 class BranchSubscriptionAddView(_BranchSubscriptionView):
 
-    subscribing_self = True
-
     page_title = label = "Subscribe to branch"
 
     @action("Subscribe")
@@ -195,7 +193,6 @@
     # Since we are subscribing other people, the current user
     # is never considered subscribed.
     user_is_subscribed = False
-    subscribing_self = False
 
     page_title = label = "Subscribe to branch"
 

=== modified file 'lib/lp/code/browser/gitsubscription.py'
--- lib/lp/code/browser/gitsubscription.py	2015-04-21 09:31:58 +0000
+++ lib/lp/code/browser/gitsubscription.py	2015-09-28 21:49:16 +0000
@@ -105,8 +105,6 @@
 
 class GitSubscriptionAddView(_GitSubscriptionView):
 
-    subscribing_self = True
-
     page_title = label = "Subscribe to repository"
 
     @action("Subscribe")
@@ -194,7 +192,6 @@
     # Since we are subscribing other people, the current user
     # is never considered subscribed.
     user_is_subscribed = False
-    subscribing_self = False
 
     page_title = label = "Subscribe to repository"
 

=== modified file 'lib/lp/code/browser/tests/test_branchlisting.py'
--- lib/lp/code/browser/tests/test_branchlisting.py	2015-09-23 17:51:12 +0000
+++ lib/lp/code/browser/tests/test_branchlisting.py	2015-09-28 21:49:16 +0000
@@ -88,12 +88,6 @@
         Asc(Branch.name),
         ]
 
-    def assertColumnNotReferenced(self, column, order_by_list):
-        """Ensure that column is not referenced in any way in order_by_list.
-        """
-        self.failIf(column in order_by_list or
-                    ('-' + column) in order_by_list)
-
     def assertSortsEqual(self, sort_one, sort_two):
         """Assert that one list of sort specs is equal to another."""
 

=== modified file 'lib/lp/code/browser/tests/test_sourcepackagerecipe.py'
--- lib/lp/code/browser/tests/test_sourcepackagerecipe.py	2015-05-13 08:27:03 +0000
+++ lib/lp/code/browser/tests/test_sourcepackagerecipe.py	2015-09-28 21:49:16 +0000
@@ -195,12 +195,6 @@
             self.assertEqual(expected_branch_info, series_branches_info)
 
 
-def get_message_text(browser, index):
-    """Return the text of a message, specified by index."""
-    tags = find_tags_by_class(browser.contents, 'message')[index]
-    return extract_text(tags)
-
-
 class TestSourcePackageRecipeAddViewInitalValues(TestCaseWithFactory):
 
     layer = DatabaseFunctionalLayer

=== modified file 'lib/lp/code/enums.py'
--- lib/lp/code/enums.py	2015-03-12 15:21:27 +0000
+++ lib/lp/code/enums.py	2015-09-28 21:49:16 +0000
@@ -23,7 +23,6 @@
     'GitObjectType',
     'NON_CVS_RCS_TYPES',
     'RevisionControlSystems',
-    'UICreatableBranchType',
     ]
 
 from lazr.enum import (
@@ -111,11 +110,6 @@
         """)
 
 
-class UICreatableBranchType(EnumeratedType):
-    """The types of branches that can be created through the web UI."""
-    use_template(BranchType, exclude='IMPORTED')
-
-
 class GitObjectType(DBEnumeratedType):
     """Git Object Type
 

=== modified file 'lib/lp/code/interfaces/branchnamespace.py'
--- lib/lp/code/interfaces/branchnamespace.py	2013-01-07 02:40:55 +0000
+++ lib/lp/code/interfaces/branchnamespace.py	2015-09-28 21:49:16 +0000
@@ -95,12 +95,6 @@
 class IBranchNamespacePolicy(Interface):
     """Methods relating to branch creation and validation."""
 
-    def getPrivacySubscriber():
-        """Get the implicit privacy subscriber for a new branch.
-
-        :return: An `IPerson` or None.
-        """
-
     def canCreateBranches(user):
         """Is the user allowed to create branches for this namespace?
 

=== modified file 'lib/lp/code/interfaces/codeimport.py'
--- lib/lp/code/interfaces/codeimport.py	2013-01-07 02:40:55 +0000
+++ lib/lp/code/interfaces/codeimport.py	2015-09-28 21:49:16 +0000
@@ -75,13 +75,6 @@
     return True
 
 
-def validate_cvs_branch(branch):
-    if branch and re.match('^[a-zA-Z][a-zA-Z0-9_-]*$', branch):
-        return True
-    else:
-        raise LaunchpadValidationError('Your CVS branch name is invalid.')
-
-
 class ICodeImport(Interface):
     """A code import to a Bazaar Branch."""
 

=== modified file 'lib/lp/code/mail/codehandler.py'
--- lib/lp/code/mail/codehandler.py	2015-07-08 16:05:11 +0000
+++ lib/lp/code/mail/codehandler.py	2015-09-28 21:49:16 +0000
@@ -55,10 +55,6 @@
     """The BranchMergeProposal specified by the address does not exist."""
 
 
-class InvalidVoteString(Exception):
-    """The user-supplied vote is not an acceptable value."""
-
-
 class CodeReviewEmailCommandExecutionContext:
     """Passed as the only parameter to each code review email command.
 

=== modified file 'lib/lp/code/model/revision.py'
--- lib/lp/code/model/revision.py	2015-07-08 16:05:11 +0000
+++ lib/lp/code/model/revision.py	2015-09-28 21:49:16 +0000
@@ -410,13 +410,6 @@
         present = store.find(Revision.revision_id, clause)
         return set(present)
 
-    def checkNewVerifiedEmail(self, email):
-        """See `IRevisionSet`."""
-        # Bypass zope's security because IEmailAddress.email is not public.
-        naked_email = removeSecurityProxy(email)
-        for author in RevisionAuthor.selectBy(email=naked_email.email):
-            author.personID = email.personID
-
     def getTipRevisionsForBranches(self, branches):
         """See `IRevisionSet`."""
         # If there are no branch_ids, then return None.

=== modified file 'lib/lp/code/model/sourcepackagerecipe.py'
--- lib/lp/code/model/sourcepackagerecipe.py	2015-07-09 20:06:17 +0000
+++ lib/lp/code/model/sourcepackagerecipe.py	2015-09-28 21:49:16 +0000
@@ -132,10 +132,6 @@
 
     is_stale = Bool()
 
-    @property
-    def _sourcepackagename_text(self):
-        return self.sourcepackagename.name
-
     name = Unicode(allow_none=True)
     description = Unicode(allow_none=True)
 

=== modified file 'lib/lp/code/model/tests/test_branchjob.py'
--- lib/lp/code/model/tests/test_branchjob.py	2015-09-02 16:54:24 +0000
+++ lib/lp/code/model/tests/test_branchjob.py	2015-09-28 21:49:16 +0000
@@ -10,15 +10,8 @@
 import shutil
 
 from bzrlib import errors as bzr_errors
-from bzrlib.branch import (
-    Branch,
-    BzrBranchFormat7,
-    )
-from bzrlib.bzrdir import (
-    BzrDir,
-    BzrDirMetaFormat1,
-    )
-from bzrlib.repofmt.knitpack_repo import RepositoryFormatKnitPack6
+from bzrlib.branch import Branch
+from bzrlib.bzrdir import BzrDir
 from bzrlib.revision import NULL_REVISION
 from bzrlib.transport import get_transport
 import pytz
@@ -217,18 +210,6 @@
 
     layer = LaunchpadZopelessLayer
 
-    def make_format(self, branch_format=None, repo_format=None):
-        # Return a Bzr MetaDir format with the provided branch and repository
-        # formats.
-        if branch_format is None:
-            branch_format = BzrBranchFormat7
-        if repo_format is None:
-            repo_format = RepositoryFormatKnitPack6
-        format = BzrDirMetaFormat1()
-        format.set_branch_format(branch_format())
-        format._set_repository_format(repo_format())
-        return format
-
     def test_providesInterface(self):
         """Ensure that BranchUpgradeJob implements IBranchUpgradeJob."""
         branch = self.factory.makeAnyBranch(

=== modified file 'lib/lp/code/model/tests/test_branchmergeproposal.py'
--- lib/lp/code/model/tests/test_branchmergeproposal.py	2015-07-08 16:05:11 +0000
+++ lib/lp/code/model/tests/test_branchmergeproposal.py	2015-09-28 21:49:16 +0000
@@ -248,16 +248,6 @@
         self._attemptTransition(proposal, to_state)
         self.assertProposalState(proposal, to_state)
 
-    def assertBadTransition(self, from_state, to_state):
-        """Assert that trying to go from `from_state` to `to_state` fails."""
-        proposal = self.factory.makeBranchMergeProposal(
-            target_branch=self.target_branch,
-            set_state=from_state)
-        self.assertProposalState(proposal, from_state)
-        self.assertRaises(BadStateTransition,
-                          self._attemptTransition,
-                          proposal, to_state)
-
     def prepareDupeTransition(self, from_state):
         proposal = self.factory.makeBranchMergeProposal(
             target_branch=self.target_branch,

=== modified file 'lib/lp/code/model/tests/test_branchmergeproposaljobs.py'
--- lib/lp/code/model/tests/test_branchmergeproposaljobs.py	2015-06-01 17:10:53 +0000
+++ lib/lp/code/model/tests/test_branchmergeproposaljobs.py	2015-09-28 21:49:16 +0000
@@ -152,10 +152,6 @@
             job.getOperationDescription().startswith(
                 'notifying people about the proposal to merge'))
 
-    def checkDiff(self, diff):
-        self.assertNotIn('+bar', diff.diff.text)
-        self.assertIn('+qux', diff.diff.text)
-
     def test_run_sends_email(self):
         """MergeProposalCreationJob.run sends an email."""
         bmp = self.createProposalWithEmptyBranches()

=== modified file 'lib/lp/code/model/tests/test_sourcepackagerecipebuild.py'
--- lib/lp/code/model/tests/test_sourcepackagerecipebuild.py	2015-09-11 15:11:34 +0000
+++ lib/lp/code/model/tests/test_sourcepackagerecipebuild.py	2015-09-28 21:49:16 +0000
@@ -502,22 +502,6 @@
         build.notify()
         self.assertEquals(0, len(pop_notifications()))
 
-    def assertBuildMessageValid(self, build, message):
-        # Not currently used; can be used if we do want to check about any
-        # notifications sent in other cases.
-        requester = build.requester
-        requester_address = format_address(
-            requester.displayname, requester.preferredemail.email)
-        mailer = SourcePackageRecipeBuildMailer.forStatus(build)
-        expected = mailer.generateEmail(
-            requester.preferredemail.email, requester)
-        self.assertEqual(
-            requester_address, re.sub(r'\n\t+', ' ', message['To']))
-        self.assertEqual(expected.subject, message['Subject'].replace(
-            '\n\t', ' '))
-        self.assertEqual(
-            expected.body, message.get_payload(decode=True))
-
     def test_notify_when_recipe_deleted(self):
         """Notify does nothing if recipe has been deleted."""
         person = self.factory.makePerson(name='person')

=== modified file 'lib/lp/code/tests/helpers.py'
--- lib/lp/code/tests/helpers.py	2015-06-03 10:03:05 +0000
+++ lib/lp/code/tests/helpers.py	2015-09-28 21:49:16 +0000
@@ -188,59 +188,6 @@
     return series, branches, official
 
 
-def make_mint_distro_with_branches(factory):
-    """This method makes a distro called mint with many branches.
-
-    The mint distro has the following series and status:
-        wild - experimental
-        dev - development
-        stable - current
-        old - supported
-        very-old - supported
-        ancient - supported
-        mouldy - supported
-        dead - obsolete
-
-    The mint distro has a team: mint-team, which has Albert, Bob, and Charlie
-    as members.
-
-    There are four different source packages:
-        twisted, zope, bzr, python
-    """
-    albert, bob, charlie = [
-        factory.makePerson(name=name, email=("%s@xxxxxxxxxxxxxxxx" % name))
-        for name in ('albert', 'bob', 'charlie')]
-    mint_team = factory.makeTeam(owner=albert, name="mint-team")
-    mint_team.addMember(bob, albert)
-    mint_team.addMember(charlie, albert)
-    mint = factory.makeDistribution(
-        name='mint', displayname='Mint', owner=albert, members=mint_team)
-    series = [
-        ("wild", "5.5", SeriesStatus.EXPERIMENTAL),
-        ("dev", "4.0", SeriesStatus.DEVELOPMENT),
-        ("stable", "3.0", SeriesStatus.CURRENT),
-        ("old", "2.0", SeriesStatus.SUPPORTED),
-        ("very-old", "1.5", SeriesStatus.SUPPORTED),
-        ("ancient", "1.0", SeriesStatus.SUPPORTED),
-        ("mouldy", "0.6", SeriesStatus.SUPPORTED),
-        ("dead", "0.1", SeriesStatus.OBSOLETE),
-        ]
-    for name, version, status in series:
-        factory.makeDistroSeries(
-            distribution=mint, version=version, status=status, name=name)
-
-    for pkg_index, name in enumerate(['twisted', 'zope', 'bzr', 'python']):
-        for series_index, series in enumerate(mint.series):
-            # Over the series and source packages, we want to have different
-            # combinations of official and branch counts.
-            # Make the more recent series have most official branches.
-            official_count = 6 - series_index
-            branch_count = official_count + pkg_index
-            make_package_branches(
-                factory, series, name, branch_count, official_count,
-                owner=mint_team, registrant=albert)
-
-
 def make_official_package_branch(factory, owner=None):
     """Make a branch linked to the pocket of a source package."""
     branch = factory.makePackageBranch(owner=owner)

=== modified file 'lib/lp/code/xmlrpc/branch.py'
--- lib/lp/code/xmlrpc/branch.py	2015-07-08 16:05:11 +0000
+++ lib/lp/code/xmlrpc/branch.py	2015-09-28 21:49:16 +0000
@@ -188,14 +188,6 @@
         """
 
 
-class _NonexistentBranch:
-    """Used to represent a branch that was requested but doesn't exist."""
-
-    def __init__(self, unique_name):
-        self.unique_name = unique_name
-        self.branch_type = None
-
-
 @implementer(IPublicCodehostingAPI)
 class PublicCodehostingAPI(LaunchpadXMLRPCView):
     """See `IPublicCodehostingAPI`."""

=== modified file 'lib/lp/code/xmlrpc/tests/test_codehosting.py'
--- lib/lp/code/xmlrpc/tests/test_codehosting.py	2015-07-10 05:57:13 +0000
+++ lib/lp/code/xmlrpc/tests/test_codehosting.py	2015-09-28 21:49:16 +0000
@@ -190,15 +190,6 @@
         self.assertEqual(num_failures, branch.mirror_failures)
         self.assertEqual(failure_message, branch.mirror_status_message)
 
-    def assertMirrorSucceeded(self, branch, revision_id):
-        """Assert that `branch` mirrored to `revision_id`."""
-        self.assertSqlAttributeEqualsDate(
-            branch, 'last_mirror_attempt', UTC_NOW)
-        self.assertSqlAttributeEqualsDate(
-            branch, 'last_mirrored', UTC_NOW)
-        self.assertEqual(0, branch.mirror_failures)
-        self.assertEqual(revision_id, branch.last_mirrored_id)
-
     def assertUnmirrored(self, branch):
         """Assert that `branch` has not yet been mirrored.
 

=== modified file 'lib/lp/codehosting/puller/tests/test_worker_formats.py'
--- lib/lp/codehosting/puller/tests/test_worker_formats.py	2011-09-26 07:33:00 +0000
+++ lib/lp/codehosting/puller/tests/test_worker_formats.py	2015-09-28 21:49:16 +0000
@@ -73,14 +73,6 @@
         dest_branch = Branch.open(self.worker.dest)
         self.assertMirrored(src_branch, dest_branch)
 
-    def _makeStackedBranch(self, relpath, base_branch):
-        """Make and return a stacked branch."""
-        revision_id = base_branch.last_revision()
-        stacked_branch_url = self.get_transport(relpath).base
-        stacked_bzrdir = base_branch.bzrdir.sprout(
-            stacked_branch_url, revision_id, stacked=True)
-        return stacked_bzrdir.open_branch()
-
     def test_loomBranch(self):
         # When we mirror a loom branch for the first time, the mirrored loom
         # branch matches the original.

=== modified file 'lib/lp/codehosting/tests/helpers.py'
--- lib/lp/codehosting/tests/helpers.py	2012-08-22 18:54:06 +0000
+++ lib/lp/codehosting/tests/helpers.py	2015-09-28 21:49:16 +0000
@@ -58,16 +58,6 @@
             'initialBranches': [(1, [])]
         }
 
-        # An slightly more complex user dict for a user, 'bob', who is also a
-        # member of a team.
-        self.bobUserDict = {
-            'id': 2,
-            'name': 'bob',
-            'teams': [{'id': 2, 'name': 'bob'},
-                      {'id': 3, 'name': 'test-team'}],
-            'initialBranches': [(2, []), (3, [])]
-        }
-
 
 class LoomTestMixin:
     """Mixin to provide Bazaar test classes with limited loom support."""

=== modified file 'lib/lp/codehosting/tests/test_acceptance.py'
--- lib/lp/codehosting/tests/test_acceptance.py	2012-10-09 00:09:15 +0000
+++ lib/lp/codehosting/tests/test_acceptance.py	2015-09-28 21:49:16 +0000
@@ -228,14 +228,6 @@
         remote_revision = self.getLastRevision(remote_url)
         self.assertEqual(local_revision, remote_revision)
 
-    def runInChdir(self, directory, func, *args, **kwargs):
-        old_dir = os.getcwdu()
-        os.chdir(directory)
-        try:
-            return func(*args, **kwargs)
-        finally:
-            os.chdir(old_dir)
-
     def _run_bzr(self, args, retcode=0):
         """Call run_bzr_subprocess with some common options.
 

=== modified file 'lib/lp/hardwaredb/interfaces/hwdb.py'
--- lib/lp/hardwaredb/interfaces/hwdb.py	2015-01-30 18:24:07 +0000
+++ lib/lp/hardwaredb/interfaces/hwdb.py	2015-09-28 21:49:16 +0000
@@ -9,7 +9,6 @@
     'HWBus',
     'HWSubmissionFormat',
     'HWSubmissionKeyNotUnique',
-    'HWSubmissionMissingFields',
     'HWSubmissionProcessingStatus',
     'IHWDBApplication',
     'IHWDevice',
@@ -126,10 +125,6 @@
     """Prevent two or more submission with identical submission_key."""
 
 
-class HWSubmissionMissingFields(Exception):
-    """Indicate that the HWDB client sent incomplete data."""
-
-
 class HWSubmissionProcessingStatus(DBEnumeratedType):
     """The status of a submission to the hardware database."""
 

=== modified file 'lib/lp/hardwaredb/scripts/hwdbsubmissions.py'
--- lib/lp/hardwaredb/scripts/hwdbsubmissions.py	2015-07-08 16:05:11 +0000
+++ lib/lp/hardwaredb/scripts/hwdbsubmissions.py	2015-09-28 21:49:16 +0000
@@ -104,9 +104,6 @@
 PCI_CLASS_SERIALBUS_CONTROLLER = 12
 PCI_SUBCLASS_SERIALBUS_USB = 3
 
-WARNING_NO_HAL_KERNEL_VERSION = 1
-WARNING_NO_KERNEL_PACKAGE_DATA = 2
-
 DB_FORMAT_FOR_VENDOR_ID = {
     'pci': '0x%04x',
     'usb_device': '0x%04x',
@@ -233,7 +230,6 @@
                 'invalid submission format version: %s' % repr(version),
                 submission_key)
             return None
-        self.submission_format_version = version
 
         validator = self.validator[version]
         if not validator.validate(submission):

=== modified file 'lib/lp/registry/browser/product.py'
--- lib/lp/registry/browser/product.py	2015-09-16 13:30:33 +0000
+++ lib/lp/registry/browser/product.py	2015-09-28 21:49:16 +0000
@@ -8,7 +8,6 @@
 __all__ = [
     'ProductAddSeriesView',
     'ProductAddView',
-    'ProductAddViewBase',
     'ProductAdminView',
     'ProductBrandingView',
     'ProductBugsMenu',
@@ -26,7 +25,6 @@
     'ProductOverviewMenu',
     'ProductPackagesView',
     'ProductPackagesPortletView',
-    'ProductPurchaseSubscriptionView',
     'ProductRdfView',
     'ProductReviewLicenseView',
     'ProductSeriesSetView',
@@ -145,14 +143,8 @@
 from lp.code.browser.codeimport import validate_import_url
 from lp.code.browser.sourcepackagerecipelisting import HasRecipesMenuMixin
 from lp.code.browser.vcslisting import TargetDefaultVCSNavigationMixin
-from lp.code.enums import (
-    BranchType,
-    RevisionControlSystems,
-    )
-from lp.code.errors import (
-    BranchCreationForbidden,
-    BranchExists,
-    )
+from lp.code.enums import RevisionControlSystems
+from lp.code.errors import BranchExists
 from lp.code.interfaces.branch import IBranch
 from lp.code.interfaces.branchjob import IRosettaUploadJobSource
 from lp.code.interfaces.branchtarget import IBranchTarget
@@ -201,7 +193,6 @@
     PublicPersonChoice,
     URIField,
     )
-from lp.services.librarian.interfaces import ILibraryFileAliasSet
 from lp.services.propertycache import cachedproperty
 from lp.services.webapp import (
     ApplicationMenu,
@@ -1139,11 +1130,6 @@
             header='Does the licence qualifiy the project for free hosting?')
 
 
-class ProductPurchaseSubscriptionView(ProductView):
-    """View the instructions to purchase a commercial subscription."""
-    page_title = 'Purchase subscription'
-
-
 class ProductPackagesView(LaunchpadView):
     """View for displaying product packaging"""
 
@@ -2000,30 +1986,6 @@
             else:
                 raise UnexpectedFormData(branch_type)
 
-    def _createBzrBranch(self, branch_name, branch_owner, repo_url=None):
-        """Create a new hosted Bazaar branch.
-
-        Return the branch on success or None.
-        """
-        branch = None
-        try:
-            namespace = self.target.getNamespace(branch_owner)
-            branch = namespace.createBranch(
-                branch_type=BranchType.HOSTED, name=branch_name,
-                registrant=self.user, url=repo_url)
-        except BranchCreationForbidden:
-            self.addError(
-                "You are not allowed to create branches in %s." %
-                self.context.displayname)
-        except BranchExists as e:
-            self._setBranchExists(e.existing_branch, 'branch_name')
-        if branch is None:
-            self.errors_in_action = True
-            # Abort transaction. This is normally handled by
-            # LaunchpadFormView, but we are already in the success handler.
-            self._abort()
-        return branch
-
 
 class ProductRdfView(BaseRdfView):
     """A view that sets its mime-type to application/rdf+xml"""
@@ -2036,16 +1998,6 @@
         return '%s.rdf' % self.context.name
 
 
-class Icon:
-    """An icon for use with image:icon."""
-
-    def __init__(self, library_id):
-        self.library_alias = getUtility(ILibraryFileAliasSet)[library_id]
-
-    def getURL(self):
-        return self.library_alias.getURL()
-
-
 class ProductSetNavigationMenu(RegistryCollectionActionMenuBase):
     """Action menu for products index."""
     usedfor = IProductSet
@@ -2185,34 +2137,6 @@
         return BatchNavigator(result, self.request, size=50)
 
 
-class ProductAddViewBase(ProductLicenseMixin, LaunchpadFormView):
-    """Abstract class for adding a new product.
-
-    ProductLicenseMixin requires the "product" attribute be set in the
-    child classes' action handler.
-    """
-
-    schema = IProduct
-    product = None
-    field_names = ['name', 'displayname', 'summary',
-                   'description', 'homepageurl', 'sourceforgeproject',
-                   'wikiurl', 'screenshotsurl',
-                   'downloadurl', 'programminglang',
-                   'licenses', 'license_info']
-    custom_widget(
-        'licenses', LicenseWidget, column_count=3, orientation='vertical')
-    custom_widget('homepageurl', TextWidget, displayWidth=30)
-    custom_widget('screenshotsurl', TextWidget, displayWidth=30)
-    custom_widget('wikiurl', TextWidget, displayWidth=30)
-    custom_widget('downloadurl', TextWidget, displayWidth=30)
-
-    @property
-    def next_url(self):
-        """See `LaunchpadFormView`."""
-        assert self.product is not None, 'No product has been created'
-        return canonical_url(self.product)
-
-
 def create_source_package_fields():
     return form.Fields(
         Choice(__name__='source_package_name',

=== modified file 'lib/lp/registry/configure.zcml'
--- lib/lp/registry/configure.zcml	2015-09-02 02:46:18 +0000
+++ lib/lp/registry/configure.zcml	2015-09-28 21:49:16 +0000
@@ -1999,7 +1999,6 @@
                 arch_series
                 last_probe_record
                 all_probe_records
-                has_ftp_or_rsync_base_url
                 base_url
                 date_created
                 country_dns_mirror

=== modified file 'lib/lp/registry/doc/distribution-mirror.txt'
--- lib/lp/registry/doc/distribution-mirror.txt	2013-02-06 09:21:20 +0000
+++ lib/lp/registry/doc/distribution-mirror.txt	2015-09-28 21:49:16 +0000
@@ -172,16 +172,12 @@
     None
 
     >>> ftp_mirror = mirrorset.getByFtpUrl('ftp://localhost/example-ftp')
-    >>> ftp_mirror.has_ftp_or_rsync_base_url
-    True
 
     >>> print mirrorset.getByFtpUrl('ftp://non-existent-url')
     None
 
     >>> rsync_mirror = mirrorset.getByRsyncUrl(
     ...     'rsync://localhost/example-rsync')
-    >>> rsync_mirror.has_ftp_or_rsync_base_url
-    True
 
     >>> print mirrorset.getByRsyncUrl('rsync://non-existent-url')
     None

=== modified file 'lib/lp/registry/interfaces/distributionmirror.py'
--- lib/lp/registry/interfaces/distributionmirror.py	2013-01-07 02:40:55 +0000
+++ lib/lp/registry/interfaces/distributionmirror.py	2015-09-28 21:49:16 +0000
@@ -380,8 +380,6 @@
     last_probe_record = Attribute(
         'The last MirrorProbeRecord for this mirror.')
     all_probe_records = Attribute('All MirrorProbeRecords for this mirror.')
-    has_ftp_or_rsync_base_url = Bool(
-        title=_('Does this mirror have a FTP or Rsync base URL?'))
     arch_mirror_freshness = Attribute(
         'The freshness of this mirror\'s archive mirrors')
     source_mirror_freshness = Attribute(

=== modified file 'lib/lp/registry/interfaces/mailinglist.py'
--- lib/lp/registry/interfaces/mailinglist.py	2015-03-09 11:38:14 +0000
+++ lib/lp/registry/interfaces/mailinglist.py	2015-09-28 21:49:16 +0000
@@ -16,7 +16,6 @@
     'IMailingListSubscription',
     'IMessageApproval',
     'IMessageApprovalSet',
-    'IMessageHeldEvent',
     'MailingListStatus',
     'PURGE_STATES',
     'PostedMessageStatus',
@@ -28,11 +27,7 @@
     DBEnumeratedType,
     DBItem,
     )
-from lazr.lifecycle.interfaces import IObjectCreatedEvent
-from zope.interface import (
-    Attribute,
-    Interface,
-    )
+from zope.interface import Interface
 from zope.schema import (
     Bool,
     Choice,
@@ -915,10 +910,3 @@
     def __str__(self):
         return 'Cannot purge mailing list in %s state: %s' % (
             self._mailing_list.status.name, self._mailing_list.team.name)
-
-
-class IMessageHeldEvent(IObjectCreatedEvent):
-    """A mailing list message has been held for moderator approval."""
-
-    mailing_list = Attribute('The mailing list the message is held for.')
-    message_id = Attribute('The Message-ID of the held message.')

=== modified file 'lib/lp/registry/interfaces/sourcepackage.py'
--- lib/lp/registry/interfaces/sourcepackage.py	2014-11-10 00:45:56 +0000
+++ lib/lp/registry/interfaces/sourcepackage.py	2015-09-28 21:49:16 +0000
@@ -12,7 +12,6 @@
     'ISourcePackageFactory',
     'SourcePackageFileType',
     'SourcePackageType',
-    'SourcePackageRelationships',
     'SourcePackageUrgency',
     ]
 
@@ -438,51 +437,6 @@
         """)
 
 
-class SourcePackageRelationships(DBEnumeratedType):
-    """Source Package Relationships
-
-    Launchpad tracks many source packages. Some of these are related to one
-    another. For example, a source package in Ubuntu called "apache2" might
-    be related to a source package in Mandrake called "httpd". This schema
-    defines the relationships that Launchpad understands.
-    """
-
-    REPLACES = DBItem(1, """
-        Replaces
-
-        The subject source package was designed to replace the object source
-        package.  """)
-
-    REIMPLEMENTS = DBItem(2, """
-        Reimplements
-
-        The subject source package is a completely new packaging of the same
-        underlying products as the object package.  """)
-
-    SIMILARTO = DBItem(3, """
-        Similar To
-
-        The subject source package is similar, in that it packages software
-        that has similar functionality to the object package.  For example,
-        postfix and exim4 would be "similarto" one another.  """)
-
-    DERIVESFROM = DBItem(4, """
-        Derives From
-
-        The subject source package derives from and tracks the object source
-        package. This means that new uploads of the object package should
-        trigger a notification to the maintainer of the subject source
-        package.  """)
-
-    CORRESPONDSTO = DBItem(5, """
-        Corresponds To
-
-        The subject source package includes the same products as the object
-        source package, but for a different distribution. For example, the
-        "apache2" Ubuntu package "correspondsto" the "httpd2" package in Red
-        Hat.  """)
-
-
 class SourcePackageUrgency(DBEnumeratedType):
     """Source Package Urgency
 

=== modified file 'lib/lp/registry/model/distributionmirror.py'
--- lib/lp/registry/model/distributionmirror.py	2015-07-08 16:05:11 +0000
+++ lib/lp/registry/model/distributionmirror.py	2015-09-28 21:49:16 +0000
@@ -180,12 +180,6 @@
         else:
             return self.name.capitalize()
 
-    @property
-    def has_ftp_or_rsync_base_url(self):
-        """See IDistributionMirror"""
-        return (self.ftp_base_url is not None
-                or self.rsync_base_url is not None)
-
     @cachedproperty
     def arch_mirror_freshness(self):
         """See IDistributionMirror"""

=== modified file 'lib/lp/registry/model/product.py'
--- lib/lp/registry/model/product.py	2015-09-17 08:52:02 +0000
+++ lib/lp/registry/model/product.py	2015-09-28 21:49:16 +0000
@@ -1158,10 +1158,6 @@
 
     owner = property(_getOwner, _setOwner)
 
-    def _getBugTaskContextWhereClause(self):
-        """See BugTargetBase."""
-        return "BugTask.product = %d" % self.id
-
     def getExternalBugTracker(self):
         """See `IHasExternalBugTracker`."""
         if self.official_malone:

=== modified file 'lib/lp/registry/scripts/productreleasefinder/walker.py'
--- lib/lp/registry/scripts/productreleasefinder/walker.py	2012-06-29 08:40:05 +0000
+++ lib/lp/registry/scripts/productreleasefinder/walker.py	2015-09-28 21:49:16 +0000
@@ -41,11 +41,6 @@
     pass
 
 
-class FTPWalkerError(WalkerError):
-    """An error in the ftp walker."""
-    pass
-
-
 class HTTPWalkerError(WalkerError):
     """An error in the http walker."""
     pass

=== modified file 'lib/lp/registry/tests/mailinglists_helper.py'
--- lib/lp/registry/tests/mailinglists_helper.py	2015-03-09 15:04:54 +0000
+++ lib/lp/registry/tests/mailinglists_helper.py	2015-09-28 21:49:16 +0000
@@ -6,7 +6,6 @@
 __metaclass__ = type
 __all__ = [
     'fault_catcher',
-    'get_alternative_email',
     'mailman',
     'new_list_for_team',
     'new_team',
@@ -88,18 +87,6 @@
     return team_list
 
 
-def get_alternative_email(person):
-    """Return a non-preferred IEmailAddress for a person.
-
-    This assumes and asserts that there is exactly one non-preferred email
-    address for the person.
-    """
-    alternatives = list(person.validatedemails)
-    assert len(alternatives) == 1, (
-        'Unexpected email count: %d' % len(alternatives))
-    return alternatives[0]
-
-
 class MailmanStub:
     """A stand-in for Mailman's XMLRPC client for page tests."""
 

=== modified file 'lib/lp/registry/tests/test_personmerge.py'
--- lib/lp/registry/tests/test_personmerge.py	2015-09-16 13:30:33 +0000
+++ lib/lp/registry/tests/test_personmerge.py	2015-09-28 21:49:16 +0000
@@ -83,13 +83,6 @@
             merge_people(from_person, to_person, reviewer=reviewer)
         return from_person, to_person
 
-    def _get_testable_account(self, person, date_created, openid_identifier):
-        # Return a naked account with predictable attributes.
-        account = removeSecurityProxy(person.account)
-        account.date_created = date_created
-        account.openid_identifier = openid_identifier
-        return account
-
     def test_delete_no_notifications(self):
         team = self.factory.makeTeam()
         owner = team.teamowner

=== modified file 'lib/lp/registry/tests/test_productseries.py'
--- lib/lp/registry/tests/test_productseries.py	2015-06-26 09:59:30 +0000
+++ lib/lp/registry/tests/test_productseries.py	2015-09-28 21:49:16 +0000
@@ -628,8 +628,7 @@
             'getFirstEntryToImport', 'getLatestRelease', 'getPOTemplate',
             'getPackage', 'getPackagingInDistribution', 'getRelease',
             'getSharingPartner', 'getSpecification', 'getSubscription',
-            'getSubscriptions', 'getTemplatesAndLanguageCounts',
-            'getTemplatesCollection', 'getTimeline',
+            'getSubscriptions', 'getTemplatesCollection', 'getTimeline',
             'getTranslationImportQueueEntries',
             'getTranslationTemplateByName', 'getTranslationTemplateFormats',
             'getTranslationTemplates', 'getUbuntuTranslationFocusPackage',

=== modified file 'lib/lp/services/fields/__init__.py'
--- lib/lp/services/fields/__init__.py	2015-07-08 16:05:11 +0000
+++ lib/lp/services/fields/__init__.py	2015-09-28 21:49:16 +0000
@@ -17,19 +17,16 @@
     'IBaseImageUpload',
     'IBugField',
     'IDescription',
-    'ILocationField',
     'INoneableTextLine',
     'IPersonChoice',
     'IStrippedTextLine',
     'ISummary',
     'ITag',
-    'ITimeInterval',
     'ITitle',
     'IURIField',
     'IWhiteboard',
     'IconImageUpload',
     'KEEP_SAME_IMAGE',
-    'LocationField',
     'LogoImageUpload',
     'MugshotImageUpload',
     'NoneableDescription',
@@ -37,7 +34,6 @@
     'PersonChoice',
     'PillarAliases',
     'PillarNameField',
-    'PrivateMembershipTeamNotAllowed',
     'PrivateTeamNotAllowed',
     'ProductBugTracker',
     'ProductNameField',
@@ -46,7 +42,6 @@
     'StrippedTextLine',
     'Summary',
     'Tag',
-    'TimeInterval',
     'Title',
     'URIField',
     'UniqueField',
@@ -75,8 +70,6 @@
     Choice,
     Date,
     Datetime,
-    Field,
-    Float,
     Int,
     Text,
     TextLine,
@@ -87,7 +80,6 @@
     IBytes,
     IDate,
     IDatetime,
-    IField,
     Interface,
     IObject,
     IText,
@@ -149,10 +141,6 @@
     """A Field that implements a Whiteboard"""
 
 
-class ITimeInterval(ITextLine):
-    """A field that captures a time interval in days, hours, minutes."""
-
-
 class IBugField(IObject):
     """A field that allows entry of a Bug number or nickname"""
 
@@ -167,14 +155,6 @@
     """
 
 
-class ILocationField(IField):
-    """A location, consisting of geographic coordinates and a time zone."""
-
-    latitude = Float(title=_('Latitude'))
-    longitude = Float(title=_('Longitude'))
-    time_zone = Choice(title=_('Time zone'), vocabulary='TimezoneName')
-
-
 class ITag(ITextLine):
     """A tag.
 
@@ -338,19 +318,6 @@
     pass
 
 
-# TimeInterval
-# A field to capture an interval in time, such as X days, Y hours, Z
-# minutes.
-
-@implementer(ITimeInterval)
-class TimeInterval(TextLine):
-
-    def _validate(self, value):
-        if 'mon' in value:
-            return 0
-        return 1
-
-
 @implementer(IBugField)
 class BugField(Reference):
 
@@ -781,23 +748,6 @@
     max_size = 100 * 1024
 
 
-@implementer(ILocationField)
-class LocationField(Field):
-    """A Location field."""
-
-    @property
-    def latitude(self):
-        return self.value.latitude
-
-    @property
-    def longitude(self):
-        return self.value.longitude
-
-    @property
-    def time_zone(self):
-        return self.value.time_zone
-
-
 class PillarNameField(BlacklistableContentNameField):
     """Base field used for names of distros/project groups/products."""
 
@@ -839,10 +789,6 @@
     __doc__ = _("A private team is not allowed.")
 
 
-class PrivateMembershipTeamNotAllowed(ConstraintNotSatisfied):
-    __doc__ = _("A private-membership team is not allowed.")
-
-
 class IPersonChoice(IReferenceChoice):
     """A marker for a choice among people."""
 

=== modified file 'lib/lp/services/twistedsupport/__init__.py'
--- lib/lp/services/twistedsupport/__init__.py	2012-06-29 08:40:05 +0000
+++ lib/lp/services/twistedsupport/__init__.py	2015-09-28 21:49:16 +0000
@@ -6,7 +6,6 @@
 __metaclass__ = type
 __all__ = [
     'cancel_on_timeout',
-    'defer_to_thread',
     'extract_result',
     'gatherResults',
     'no_traceback_failures',
@@ -27,21 +26,10 @@
 from twisted.internet import (
     defer,
     reactor as default_reactor,
-    threads,
     )
 from twisted.python.failure import Failure
 
 
-def defer_to_thread(function):
-    """Run in a thread and return a Deferred that fires when done."""
-
-    @functools.wraps(function)
-    def decorated(*args, **kwargs):
-        return threads.deferToThread(function, *args, **kwargs)
-
-    return decorated
-
-
 def gatherResults(deferredList):
     """Returns list with result of given Deferreds.
 

=== modified file 'lib/lp/services/utils.py'
--- lib/lp/services/utils.py	2014-08-29 01:34:04 +0000
+++ lib/lp/services/utils.py	2015-09-28 21:49:16 +0000
@@ -24,7 +24,6 @@
     're_email_address',
     'run_capturing_output',
     'save_bz2_pickle',
-    'synchronize',
     'text_delta',
     'traceback_info',
     'utc_now',
@@ -148,21 +147,6 @@
         yield a_list[i:i + size]
 
 
-def synchronize(source, target, add, remove):
-    """Update 'source' to match 'target' using 'add' and 'remove'.
-
-    Changes the container 'source' so that it equals 'target', calling 'add'
-    with any object in 'target' not in 'source' and 'remove' with any object
-    not in 'target' but in 'source'.
-    """
-    need_to_add = [obj for obj in target if obj not in source]
-    need_to_remove = [obj for obj in source if obj not in target]
-    for obj in need_to_add:
-        add(obj)
-    for obj in need_to_remove:
-        remove(obj)
-
-
 def value_string(item):
     """Return a unicode string representing value.
 

=== modified file 'lib/lp/services/verification/browser/logintoken.py'
--- lib/lp/services/verification/browser/logintoken.py	2015-07-21 09:04:01 +0000
+++ lib/lp/services/verification/browser/logintoken.py	2015-09-28 21:49:16 +0000
@@ -47,7 +47,6 @@
     GPGVerificationError,
     IGPGHandler,
     )
-from lp.services.identity.interfaces.account import AccountStatus
 from lp.services.identity.interfaces.emailaddress import (
     EmailAddressStatus,
     IEmailAddressSet,
@@ -63,11 +62,7 @@
     LaunchpadView,
     )
 from lp.services.webapp.escaping import structured
-from lp.services.webapp.interfaces import (
-    IAlwaysSubmittedWidget,
-    IPlacelessLoginSource,
-    )
-from lp.services.webapp.login import logInPrincipal
+from lp.services.webapp.interfaces import IAlwaysSubmittedWidget
 from lp.services.webapp.vhosts import allvhosts
 
 
@@ -163,12 +158,6 @@
         self.successfullyProcessed = True
         self.request.response.addInfoNotification(message)
 
-    def logInPrincipalByEmail(self, email):
-        """Login the principal with the given email address."""
-        loginsource = getUtility(IPlacelessLoginSource)
-        principal = loginsource.getPrincipalByLogin(email)
-        logInPrincipal(self.request, principal, email)
-
     def _cancel(self):
         """Consume the LoginToken and set self._next_url_for_cancel.
 
@@ -178,27 +167,6 @@
         self._next_url_for_cancel = canonical_url(self.context.requester)
         self.context.consume()
 
-    def accountWasSuspended(self, account, reason):
-        """Return True if the person's account was SUSPENDED, otherwise False.
-
-        When the account was SUSPENDED, the Warning Notification with the
-        reason is added to the request's response. The LoginToken is consumed.
-
-        :param account: The IAccount.
-        :param reason: A sentence that explains why the SUSPENDED account
-            cannot be used.
-        """
-        if account.status != AccountStatus.SUSPENDED:
-            return False
-        suspended_account_mailto = (
-            'mailto:feedback@xxxxxxxxxxxxx?subject=SUSPENDED%20account')
-        message = structured(
-              '%s Contact a <a href="%s">Launchpad admin</a> '
-              'about this issue.' % (reason, suspended_account_mailto))
-        self.request.response.addWarningNotification(message)
-        self.context.consume()
-        return True
-
 
 class ClaimTeamView(
     BaseTokenView, HasRenewalPolicyMixin, LaunchpadEditFormView):

=== removed file 'lib/lp/services/verification/emailtemplates/claim-profile.txt'
--- lib/lp/services/verification/emailtemplates/claim-profile.txt	2011-12-20 11:55:18 +0000
+++ lib/lp/services/verification/emailtemplates/claim-profile.txt	1970-01-01 00:00:00 +0000
@@ -1,11 +0,0 @@
-Hi,
-
-You, or someone posing as you, tried to claim the Launchpad profile
-named %(profile_name)s, to which the email address
-%(email)s belongs.
-
-To finish claiming that profile, just follow the link below.
-
-    %(token_url)s
-
-The Launchpad Team

=== removed file 'lib/lp/services/verification/emailtemplates/profile-created.txt'
--- lib/lp/services/verification/emailtemplates/profile-created.txt	2011-12-20 11:55:18 +0000
+++ lib/lp/services/verification/emailtemplates/profile-created.txt	1970-01-01 00:00:00 +0000
@@ -1,28 +0,0 @@
-Hello!
-
-%(requester)s has created a new Launchpad profile [1] for
-you, and left the following comment as the reason for its creation:
-
-    %(comment)s
-
-If you wish to use this profile, please follow the instructions here:
-
-   %(token_url)s
-
-You can do it any time you want, either by following the instructions
-above or by visiting your Launchpad profile [1]. Note that we won't
-send you any other emails unless you follow the above instructions
-to finish the registration process.
-
-To get in touch with %(requester)s you can simply reply
-to this message.
-
-Launchpad is a suite of applications for open source developers,
-including easy Web-based translation and bug management. To learn
-more about Launchpad, check out https://launchpad.net/.
-
-[1] %(profile_url)s
-
-Thanks
-The Launchpad team
-

=== modified file 'lib/lp/services/verification/interfaces/logintoken.py'
--- lib/lp/services/verification/interfaces/logintoken.py	2015-07-21 09:04:01 +0000
+++ lib/lp/services/verification/interfaces/logintoken.py	2015-09-28 21:49:16 +0000
@@ -51,14 +51,6 @@
         If fingerprint is set, send the message encrypted.
         """
 
-    def sendProfileCreatedEmail(profile, comment):
-        """Notify the profile's email owner that a new profile was created.
-
-        Send an email message to this token's email address explaining that
-        another user has created a launchpad profile for him and providing
-        a link where he can finish the registration process.
-        """
-
     def sendMergeRequestEmail():
         """Send an email to self.email (the dupe account's email address)
         with the URL of a page to finish the merge of Launchpad accounts.
@@ -72,11 +64,6 @@
         request on behalf of the team.
         """
 
-    def sendClaimProfileEmail():
-        """Send an email to self.email with instructions on how to finish
-        claiming the profile that owns self.email.
-        """
-
     def sendClaimTeamEmail():
         """Email instructions for claiming a team to self.email."""
 

=== modified file 'lib/lp/services/verification/model/logintoken.py'
--- lib/lp/services/verification/model/logintoken.py	2015-07-21 09:04:01 +0000
+++ lib/lp/services/verification/model/logintoken.py	2015-09-28 21:49:16 +0000
@@ -181,20 +181,6 @@
         subject = 'Launchpad: Confirm your OpenPGP Key'
         self._send_email(from_name, subject, text)
 
-    def sendProfileCreatedEmail(self, profile, comment):
-        """See ILoginToken."""
-        template = get_email_template('profile-created.txt', app=MAIL_APP)
-        replacements = {'token_url': canonical_url(self),
-                        'requester': self.requester.displayname,
-                        'comment': comment,
-                        'profile_url': canonical_url(profile)}
-        message = template % replacements
-
-        headers = {'Reply-To': self.requester.preferredemail.email}
-        from_name = "Launchpad"
-        subject = "Launchpad profile"
-        self._send_email(from_name, subject, message, headers=headers)
-
     def sendMergeRequestEmail(self):
         """See ILoginToken."""
         template = get_email_template('request-merge.txt', app=MAIL_APP)
@@ -227,20 +213,6 @@
         message = template % replacements
         self._send_email(from_name, subject, message)
 
-    def sendClaimProfileEmail(self):
-        """See ILoginToken."""
-        template = get_email_template('claim-profile.txt', app=MAIL_APP)
-        from_name = "Launchpad"
-        profile = getUtility(IPersonSet).getByEmail(self.email)
-        replacements = {'profile_name': (
-                            "%s (%s)" % (profile.displayname, profile.name)),
-                        'email': self.email,
-                        'token_url': canonical_url(self)}
-        message = template % replacements
-
-        subject = "Launchpad: Claim Profile"
-        self._send_email(from_name, subject, message)
-
     def sendClaimTeamEmail(self):
         """See `ILoginToken`."""
         template = get_email_template('claim-team.txt', app=MAIL_APP)

=== modified file 'lib/lp/services/webapp/error.py'
--- lib/lp/services/webapp/error.py	2015-07-08 16:05:11 +0000
+++ lib/lp/services/webapp/error.py	2015-09-28 21:49:16 +0000
@@ -6,7 +6,6 @@
     'InvalidBatchSizeView',
     'NotFoundView',
     'ProtocolErrorView',
-    'ReadOnlyErrorView',
     'RequestExpiredView',
     'SystemErrorView',
     'TranslationUnavailableView',
@@ -262,21 +261,6 @@
         return self.index()
 
 
-class ReadOnlyErrorView(SystemErrorView):
-    """View rendered when an InvalidBatchSizeError is raised."""
-
-    page_title = "Error: you can't do this right now"
-
-    response_code = httplib.SERVICE_UNAVAILABLE
-
-    def isSystemError(self):
-        """We don't need to log these errors in the SiteLog."""
-        return False
-
-    def __call__(self):
-        return self.index()
-
-
 class NoReferrerErrorView(SystemErrorView):
     """View rendered when a POST request does not include a REFERER header."""
 

=== modified file 'lib/lp/services/webapp/publication.py'
--- lib/lp/services/webapp/publication.py	2015-07-08 16:05:11 +0000
+++ lib/lp/services/webapp/publication.py	2015-09-28 21:49:16 +0000
@@ -741,10 +741,6 @@
                 store.reset()
 
 
-class InvalidThreadsConfiguration(Exception):
-    """Exception thrown when the number of threads isn't set correctly."""
-
-
 _browser_re = re.compile(r"""(?x)^(
     Mozilla |
     Opera |

=== modified file 'lib/lp/services/webapp/tests/test_dbpolicy.py'
--- lib/lp/services/webapp/tests/test_dbpolicy.py	2013-06-20 05:50:00 +0000
+++ lib/lp/services/webapp/tests/test_dbpolicy.py	2015-09-28 21:49:16 +0000
@@ -399,21 +399,6 @@
     def store_is_master(self, store):
         return not self.store_is_slave(store)
 
-    def wait_until_connectable(self, dbname):
-        timeout = 80
-        start = time.time()
-        while time.time() < start + timeout:
-            try:
-                con = psycopg2.connect(
-                    'dbname=%s host=localhost user=launchpad_main' % dbname)
-                con.cursor().execute('SELECT TRUE')
-                con.close()
-                return
-            except psycopg2.Error:
-                pass
-            time.sleep(0.2)
-        self.fail("Unable to resume database %s" % dbname)
-
     def test_slave_only_fast_downtime_rollout(self):
         '''You can always access a working slave store during fast downtime.
         '''

=== modified file 'lib/lp/soyuz/browser/distroarchseriesbinarypackage.py'
--- lib/lp/soyuz/browser/distroarchseriesbinarypackage.py	2011-12-24 17:49:30 +0000
+++ lib/lp/soyuz/browser/distroarchseriesbinarypackage.py	2015-09-28 21:49:16 +0000
@@ -11,7 +11,6 @@
 from lazr.restful.utils import smartquote
 
 from lp.services.webapp import (
-    ApplicationMenu,
     GetitemNavigation,
     LaunchpadView,
     )
@@ -20,13 +19,6 @@
     )
 
 
-class DistroArchSeriesBinaryPackageOverviewMenu(ApplicationMenu):
-
-    usedfor = IDistroArchSeriesBinaryPackage
-    facet = 'overview'
-    links = []
-
-
 class DistroArchSeriesBinaryPackageNavigation(GetitemNavigation):
 
     usedfor = IDistroArchSeriesBinaryPackage

=== modified file 'lib/lp/soyuz/browser/distroarchseriesbinarypackagerelease.py'
--- lib/lp/soyuz/browser/distroarchseriesbinarypackagerelease.py	2013-02-13 14:16:37 +0000
+++ lib/lp/soyuz/browser/distroarchseriesbinarypackagerelease.py	2015-09-28 21:49:16 +0000
@@ -12,7 +12,6 @@
 from lazr.restful.utils import smartquote
 
 from lp.services.webapp import (
-    ApplicationMenu,
     LaunchpadView,
     Navigation,
     )
@@ -30,13 +29,6 @@
         return self.context.version
 
 
-class DistroArchSeriesBinaryPackageReleaseOverviewMenu(ApplicationMenu):
-
-    usedfor = IDistroArchSeriesBinaryPackageRelease
-    facet = 'overview'
-    links = []
-
-
 class DistroArchSeriesBinaryPackageReleaseNavigation(Navigation):
     usedfor = IDistroArchSeriesBinaryPackageRelease
 

=== modified file 'lib/lp/soyuz/browser/distroseriesbinarypackage.py'
--- lib/lp/soyuz/browser/distroseriesbinarypackage.py	2014-02-26 03:05:44 +0000
+++ lib/lp/soyuz/browser/distroseriesbinarypackage.py	2015-09-28 21:49:16 +0000
@@ -12,7 +12,6 @@
 from lazr.restful.utils import smartquote
 
 from lp.services.webapp import (
-    ApplicationMenu,
     LaunchpadView,
     Navigation,
     )
@@ -22,13 +21,6 @@
     )
 
 
-class DistroSeriesBinaryPackageOverviewMenu(ApplicationMenu):
-
-    usedfor = IDistroSeriesBinaryPackage
-    facet = 'overview'
-    links = []
-
-
 class DistroSeriesBinaryPackageNavigation(Navigation):
 
     usedfor = IDistroSeriesBinaryPackage

=== modified file 'lib/lp/soyuz/interfaces/sourcepackagerelease.py'
--- lib/lp/soyuz/interfaces/sourcepackagerelease.py	2015-02-11 10:42:46 +0000
+++ lib/lp/soyuz/interfaces/sourcepackagerelease.py	2015-09-28 21:49:16 +0000
@@ -7,7 +7,6 @@
 
 __all__ = [
     'ISourcePackageRelease',
-    'PackageDiffAlreadyRequestedError',
     ]
 
 
@@ -220,7 +219,3 @@
             versions, with a blank line between each.  If there is no
             changelog, or there is an error parsing it, None is returned.
         """
-
-
-class PackageDiffAlreadyRequestedError(Exception):
-    """Raised when an `IPackageDiff` request already exists."""

=== modified file 'lib/lp/soyuz/scripts/gina/packages.py'
--- lib/lp/soyuz/scripts/gina/packages.py	2015-05-20 11:31:11 +0000
+++ lib/lp/soyuz/scripts/gina/packages.py	2015-09-28 21:49:16 +0000
@@ -39,7 +39,6 @@
     )
 from lp.services import encoding
 from lp.services.database.constants import UTC_NOW
-from lp.services.gpg.interfaces import GPGKeyAlgorithm
 from lp.services.scripts import log
 from lp.soyuz.enums import PackagePublishingPriority
 from lp.soyuz.scripts.gina import (
@@ -63,8 +62,6 @@
     "source": PackagePublishingPriority.EXTRA,
 }
 
-GPGALGOS = dict((item.value, item.name) for item in GPGKeyAlgorithm.items)
-
 
 #
 # Helper functions

=== modified file 'lib/lp/soyuz/tests/soyuz.py'
--- lib/lp/soyuz/tests/soyuz.py	2013-07-31 00:37:32 +0000
+++ lib/lp/soyuz/tests/soyuz.py	2015-09-28 21:49:16 +0000
@@ -15,10 +15,7 @@
 from lp.registry.interfaces.person import IPersonSet
 from lp.registry.interfaces.pocket import PackagePublishingPocket
 from lp.soyuz.enums import PackagePublishingStatus
-from lp.soyuz.model.publishing import (
-    BinaryPackagePublishingHistory,
-    SourcePackagePublishingHistory,
-    )
+from lp.soyuz.model.publishing import SourcePackagePublishingHistory
 from lp.testing.sampledata import (
     BUILDD_ADMIN_USERNAME,
     UBUNTU_DISTRIBUTION_NAME,
@@ -91,31 +88,6 @@
             sample_pub.append(pub)
         return sample_pub
 
-    def createPublishingForDistroArchSeries(self, binarypackagerelease,
-                                            distroarchseries):
-        """Return a list of `BinaryPackagePublishingHistory`.
-
-        The publishing records are created according to the given
-        `BinaryPackageRelease` and `DistroArchSeries` for all
-        (status, archive, pocket) returned from `sample_publishing_data`.
-        """
-        sample_pub = []
-        for status, archive, pocket in self.sample_publishing_data:
-            pub = BinaryPackagePublishingHistory(
-                binarypackagerelease=binarypackagerelease,
-                binarypackagename=binarypackagerelease.binarypackagename,
-                distroarchseries=distroarchseries,
-                component=binarypackagerelease.component,
-                section=binarypackagerelease.section,
-                priority=binarypackagerelease.priority,
-                status=status,
-                archive=archive,
-                pocket=pocket)
-            # Flush the object changes into DB do guarantee stable database
-            # ID order as expected in the callsites.
-            sample_pub.append(pub)
-        return sample_pub
-
     def checkPubList(self, expected, given):
         """Check if the given publication list matches the expected one.
 

=== modified file 'lib/lp/soyuz/tests/test_build_set.py'
--- lib/lp/soyuz/tests/test_build_set.py	2015-09-23 12:03:06 +0000
+++ lib/lp/soyuz/tests/test_build_set.py	2015-09-28 21:49:16 +0000
@@ -62,10 +62,8 @@
             self.publisher.prepareBreezyAutotest()
             self.distroseries.nominatedarchindep = self.das_one
             self.publisher.addFakeChroots(distroseries=self.distroseries)
-            self.builder_one = self.factory.makeBuilder(
-                processors=[self.processor_one])
-            self.builder_two = self.factory.makeBuilder(
-                processors=[self.processor_two])
+            self.factory.makeBuilder(processors=[self.processor_one])
+            self.factory.makeBuilder(processors=[self.processor_two])
         self.builds = []
         self.spphs = []
 

=== modified file 'lib/lp/soyuz/tests/test_hasbuildrecords.py'
--- lib/lp/soyuz/tests/test_hasbuildrecords.py	2015-05-13 09:37:43 +0000
+++ lib/lp/soyuz/tests/test_hasbuildrecords.py	2015-09-28 21:49:16 +0000
@@ -92,16 +92,13 @@
         self.archive = self.factory.makeArchive(
             distribution=self.distroseries.distribution,
             purpose=ArchivePurpose.PRIMARY)
-        self.arch_ids = [arch.id for arch in self.distroseries.architectures]
         with person_logged_in(self.admin):
             self.publisher = SoyuzTestPublisher()
             self.publisher.prepareBreezyAutotest()
             self.distroseries.nominatedarchindep = self.das_one
             self.publisher.addFakeChroots(distroseries=self.distroseries)
-            self.builder_one = self.factory.makeBuilder(
-                processors=[self.processor_one])
-            self.builder_two = self.factory.makeBuilder(
-                processors=[self.processor_two])
+            self.factory.makeBuilder(processors=[self.processor_one])
+            self.factory.makeBuilder(processors=[self.processor_two])
         self.builds = []
         self.createBuilds()
 

=== modified file 'lib/lp/testing/__init__.py'
--- lib/lp/testing/__init__.py	2015-09-10 16:18:19 +0000
+++ lib/lp/testing/__init__.py	2015-09-28 21:49:16 +0000
@@ -113,10 +113,7 @@
     )
 import zope.event
 from zope.interface import Interface
-from zope.interface.verify import (
-    verifyClass,
-    verifyObject as zope_verifyObject,
-    )
+from zope.interface.verify import verifyObject as zope_verifyObject
 from zope.publisher.interfaces.browser import IBrowserRequest
 from zope.security.management import queryInteraction
 from zope.security.proxy import (
@@ -481,12 +478,6 @@
         from lp.testing.matchers import Provides
         self.assertThat(obj, Provides(interface))
 
-    def assertClassImplements(self, cls, interface):
-        """Assert 'cls' may correctly implement 'interface'."""
-        self.assertTrue(
-            verifyClass(interface, cls),
-            "%r does not correctly implement %r." % (cls, interface))
-
     def assertNotifies(self, event_types, callable_obj, *args, **kwargs):
         """Assert that a callable performs a given notification.
 

=== modified file 'lib/lp/translations/browser/translations.py'
--- lib/lp/translations/browser/translations.py	2014-11-24 01:30:25 +0000
+++ lib/lp/translations/browser/translations.py	2015-09-28 21:49:16 +0000
@@ -17,7 +17,6 @@
 from lp.app.interfaces.launchpad import ILaunchpadCelebrities
 from lp.registry.interfaces.person import IPersonSet
 from lp.registry.interfaces.product import IProductSet
-from lp.services.config import config
 from lp.services.geoip.interfaces import IRequestPreferredLanguages
 from lp.services.propertycache import cachedproperty
 from lp.services.webapp import (
@@ -90,9 +89,6 @@
         return BatchNavigator(products.getTranslatables(),
                               self.request)
 
-    def rosettaAdminEmail(self):
-        return config.rosettaadmin.email
-
     @property
     def launchpad_users_team(self):
         """The url of the launchpad-users team."""

=== modified file 'lib/lp/translations/interfaces/hastranslationtemplates.py'
--- lib/lp/translations/interfaces/hastranslationtemplates.py	2011-12-24 16:54:44 +0000
+++ lib/lp/translations/interfaces/hastranslationtemplates.py	2015-09-28 21:49:16 +0000
@@ -101,10 +101,3 @@
     def getTranslationTemplateFormats():
         """A list of native formats for all current translation templates.
         """
-
-    def getTemplatesAndLanguageCounts():
-        """List tuples of `POTemplate` and its language count.
-
-        A template's language count is the number of `POFile`s that
-        exist for it.
-        """

=== modified file 'lib/lp/translations/interfaces/potemplate.py'
--- lib/lp/translations/interfaces/potemplate.py	2014-07-01 16:01:39 +0000
+++ lib/lp/translations/interfaces/potemplate.py	2015-09-28 21:49:16 +0000
@@ -1,10 +1,6 @@
 # Copyright 2009-2011 Canonical Ltd.  This software is licensed under the
 # GNU Affero General Public License version 3 (see the file LICENSE).
 
-from lazr.enum import (
-    DBEnumeratedType,
-    DBItem,
-    )
 from lazr.restful.declarations import (
     export_as_webservice_entry,
     exported,
@@ -49,9 +45,7 @@
     'IPOTemplateSet',
     'IPOTemplateSharingSubset',
     'IPOTemplateSubset',
-    'IPOTemplateWithContent',
     'LanguageNotFound',
-    'TranslationPriority',
     ]
 
 
@@ -59,40 +53,6 @@
     """Raised when a a language does not exist in the database."""
 
 
-class TranslationPriority(DBEnumeratedType):
-    """Translation Priority
-
-    Translations in Rosetta can be assigned a priority. This is used in a
-    number of places. The priority stored on the translation itself is set
-    by the upstream project maintainers, and used to identify the
-    translations they care most about. For example, if Apache were nearing a
-    big release milestone they would set the priority on those POTemplates
-    to 'high'. The priority is also used by TranslationEfforts to indicate
-    how important that POTemplate is to the effort. And lastly, an
-    individual translator can set the priority on his personal subscription
-    to a project, to determine where it shows up on his list.  """
-
-    HIGH = DBItem(1, """
-        High
-
-        This translation should be shown on any summary list of translations
-        in the relevant context. For example, 'high' priority projects show
-        up on the home page of a TranslationEffort or Project in Rosetta.
-        """)
-
-    MEDIUM = DBItem(2, """
-        Medium
-
-        A medium priority POTemplate should be shown on longer lists and
-        dropdowns lists of POTemplates in the relevant context.  """)
-
-    LOW = DBItem(3, """
-        Low
-
-        A low priority POTemplate should only show up if a comprehensive
-        search or complete listing is requested by the user.  """)
-
-
 class IPOTemplate(IRosettaStats):
     """A translation template."""
 
@@ -793,15 +753,6 @@
         """
 
 
-class IPOTemplateWithContent(IPOTemplate):
-    """Interface for an `IPOTemplate` used to create the new POTemplate form.
-    """
-
-    content = Bytes(
-        title=_("PO Template File to Import"),
-        required=True)
-
-
 class ITranslationTemplatesCollection(Interface):
     """A `Collection` of `POTemplate`s."""
 

=== modified file 'lib/lp/translations/interfaces/translationsoverview.py'
--- lib/lp/translations/interfaces/translationsoverview.py	2013-01-07 02:40:55 +0000
+++ lib/lp/translations/interfaces/translationsoverview.py	2015-09-28 21:49:16 +0000
@@ -19,6 +19,7 @@
 class MalformedKarmaCacheData(Exception):
     """KarmaCache values are missing product or distribution identifier."""
 
+
 class ITranslationsOverview(Interface):
     """Overview of Launchpad Translations component."""
 
@@ -39,7 +40,3 @@
         either a product or a distribution, and size is the relative
         amount of contribution a pillar has received.
         """
-
-
-class IProjectGroupTranslationsOverview(Interface):
-    """Overview of translations for a project."""

=== modified file 'lib/lp/translations/model/hastranslationtemplates.py'
--- lib/lp/translations/model/hastranslationtemplates.py	2015-07-08 16:05:11 +0000
+++ lib/lp/translations/model/hastranslationtemplates.py	2015-09-28 21:49:16 +0000
@@ -8,10 +8,7 @@
     'HasTranslationTemplatesMixin',
     ]
 
-from storm.expr import (
-    Count,
-    Desc,
-    )
+from storm.expr import Desc
 from zope.interface import implementer
 
 from lp.services import helpers
@@ -118,9 +115,3 @@
             'source_file_format').config(distinct=True)
         return helpers.shortlist(
             formats_query.values(POTemplate.source_file_format), 10)
-
-    def getTemplatesAndLanguageCounts(self):
-        """See `IHasTranslationTemplates`."""
-        join = self.getTemplatesCollection().joinOuterPOFile()
-        result = join.select(POTemplate, Count(POFile.id))
-        return result.group_by(POTemplate)

=== modified file 'lib/lp/translations/model/pofile.py'
--- lib/lp/translations/model/pofile.py	2015-07-08 16:05:11 +0000
+++ lib/lp/translations/model/pofile.py	2015-09-28 21:49:16 +0000
@@ -98,10 +98,7 @@
     POTMsgSet,
     )
 from lp.translations.model.translationimportqueue import collect_import_info
-from lp.translations.model.translationmessage import (
-    make_plurals_sql_fragment,
-    TranslationMessage,
-    )
+from lp.translations.model.translationmessage import TranslationMessage
 from lp.translations.model.translationtemplateitem import (
     TranslationTemplateItem,
     )
@@ -112,17 +109,6 @@
     )
 
 
-def compose_sql_translationmessage_has_translations(tm_sql_identifier):
-    """Compose SQL for "`TranslationMessage` is nonempty.".
-
-    :param tm_sql_identifier: The SQL identifier for the
-        `TranslationMessage` in the query that's to be tested.
-    """
-    return "COALESCE(%s) IS NOT NULL" % ", ".join([
-        "%s.msgstr%d" % (tm_sql_identifier, form)
-        for form in xrange(TranslationConstants.MAX_PLURAL_FORMS)])
-
-
 class POFileMixIn(RosettaStats):
     """Base class for `POFile` and `DummyPOFile`.
 
@@ -529,25 +515,6 @@
                 "Calling prepareTranslationCredits on a message with "
                 "unknown credits type '%s'." % credits_type.title)
 
-    def _getClausesForPOFileMessages(self, current=True):
-        """Get TranslationMessages for the POFile via TranslationTemplateItem.
-
-        Call-site will have to have appropriate clauseTables.
-        """
-        # When all the code that uses this method is moved to Storm,
-        # we can replace it with _getStormClausesForPOFileMessages
-        # and then remove it.
-        clauses = [
-            'TranslationTemplateItem.potemplate = %s' % sqlvalues(
-                self.potemplate),
-            ('TranslationTemplateItem.potmsgset'
-             ' = TranslationMessage.potmsgset'),
-            'TranslationMessage.language = %s' % sqlvalues(self.language)]
-        if current:
-            clauses.append('TranslationTemplateItem.sequence > 0')
-
-        return clauses
-
     def _getStormClausesForPOFileMessages(self, current=True):
         """Get TranslationMessages for the POFile via TranslationTemplateItem.
         """
@@ -1415,10 +1382,6 @@
         """See `IPOFile`."""
         raise NotImplementedError
 
-    def createMessageSetFromMessageSet(self, potmsgset):
-        """See `IPOFile`."""
-        raise NotImplementedError
-
     def getStatistics(self):
         """See `IPOFile`."""
         return (0, 0, 0, )
@@ -1440,10 +1403,6 @@
         # Any path will do for a DummyPOFile.
         self.path = path
 
-    def getNextToImport(self):
-        """See `IPOFile`."""
-        raise NotImplementedError
-
     def importFromQueue(self, entry_to_import, logger=None, txn=None):
         """See `IPOFile`."""
         raise NotImplementedError

=== modified file 'lib/lp/translations/tests/test_distroseries_translations_copy.py'
--- lib/lp/translations/tests/test_distroseries_translations_copy.py	2015-08-06 09:36:37 +0000
+++ lib/lp/translations/tests/test_distroseries_translations_copy.py	2015-09-28 21:49:16 +0000
@@ -29,11 +29,6 @@
         self.kwargs = kwargs
 
 
-def force_exit(*args, **kwargs):
-    """Raise `EarlyExit`."""
-    raise EarlyExit(*args, **kwargs)
-
-
 class TestDistroSeriesTranslationsCopying(TestCaseWithFactory):
 
     layer = ZopelessDatabaseLayer

=== modified file 'lib/lp/translations/tests/test_potmsgset.py'
--- lib/lp/translations/tests/test_potmsgset.py	2014-01-30 15:04:06 +0000
+++ lib/lp/translations/tests/test_potmsgset.py	2015-09-28 21:49:16 +0000
@@ -638,9 +638,6 @@
             naked_tm.reviewer = self.factory.makePerson()
         naked_tm.date_reviewed = self.now()
 
-    def _setDateUpdated(self, tm):
-        removeSecurityProxy(tm).date_updated = self.now()
-
     def gen_now(self):
         now = datetime.now(pytz.UTC)
         while True:

=== modified file 'lib/lp/translations/tests/test_setcurrenttranslation.py'
--- lib/lp/translations/tests/test_setcurrenttranslation.py	2013-01-07 02:40:55 +0000
+++ lib/lp/translations/tests/test_setcurrenttranslation.py	2015-09-28 21:49:16 +0000
@@ -11,7 +11,6 @@
 from lp.translations.interfaces.translationmessage import (
     RosettaTranslationOrigin,
     )
-from lp.translations.model.translationmessage import TranslationMessage
 from lp.translations.tests.helpers import (
     make_translationmessage_for_context,
     summarize_current_translations,
@@ -102,19 +101,6 @@
 
         self.assertContentEqual(new_divergences, divergences_elsewhere)
 
-    def assertTranslationMessageDeleted(self, translationmessage_id):
-        """Assert that a translation message doesn't exist.
-
-        Until deletion of TMs is implemented, it just checks that
-        translation message is not current in any context.
-        """
-        # XXX DaniloSegan 20100528: we should assert that tm_other
-        # doesn't exist in the DB anymore instead.
-        tm = TranslationMessage.get(translationmessage_id)
-        self.assertFalse(tm.is_current_ubuntu)
-        self.assertFalse(tm.is_current_upstream)
-        self.assertIs(None, tm.potemplate)
-
     # These tests follow a naming pattern to reflect exhaustive
     # coverage.  We had to abbreviate them.  In the names,
     #  'c' means the current message translating self.potmsgset in

=== modified file 'lib/lp/translations/utilities/gettext_po_exporter.py'
--- lib/lp/translations/utilities/gettext_po_exporter.py	2015-07-08 16:05:11 +0000
+++ lib/lp/translations/utilities/gettext_po_exporter.py	2015-09-28 21:49:16 +0000
@@ -379,23 +379,6 @@
         storage.addFile(
             file_path, file_extension, encoded_file_content, mime_type)
 
-    def acceptSingularClash(self, previous_message, current_message):
-        """Handle clash of (singular) msgid and context with other message.
-
-        Define in derived class how it should behave when this happens.
-
-        Obsolete messages are guaranteed to be processed after
-        non-obsolete ones.
-
-        :param previous_message: already processed message in this
-            export.
-        :param current_message: another message with the same (singular)
-            msgid and context as `previous_message`.
-        :return: boolean: True to accept `current_message`, or False to
-            leave it out of the export.
-        """
-        raise NotImplementedError()
-
 
 class GettextPOExporter(GettextPOExporterBase):
     """Support class to export Gettext .po files."""
@@ -450,7 +433,3 @@
         :return: The header as a unicode string.
         """
         return self.exported_header
-
-    def acceptSingularClash(self, previous_message, current_message):
-        """See `GettextPOExporterBase`."""
-        return True

=== modified file 'lib/lp/translations/utilities/translation_import.py'
--- lib/lp/translations/utilities/translation_import.py	2015-07-08 16:05:11 +0000
+++ lib/lp/translations/utilities/translation_import.py	2015-09-28 21:49:16 +0000
@@ -245,12 +245,6 @@
         """Marks a message as seen in the import, to avoid expiring it."""
         self.seen.add(self._getMessageKey(message))
 
-    def getUnseenMessages(self):
-        """Return a set of messages present in the database but not seen
-        in the file being imported.
-        """
-        return self.current_messages - self.seen
-
     def _getMessageKey(self, message):
         """Return tuple identifying `message`.
 


Follow ups