← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~jtv/launchpad/bug-668194-fix-api into lp:launchpad/devel

 

Jeroen T. Vermeulen has proposed merging lp:~jtv/launchpad/bug-668194-fix-api into lp:launchpad/devel with lp:~jtv/launchpad/bug-668194-split-interfaces as a prerequisite.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers): code
Related bugs:
  #668194 IHasTranslationImports.getTranslationImportQueueEntries exported wrongly
  https://bugs.launchpad.net/bugs/668194


= Bug 668194: IHasTranslationImports in the API =

You may find this bug easier to review one commit at a time.  I went through three stages:
 1. Add IHasTranslationTemplates to persons, products etc. through interface inheritance instead of implements().
 2. Move HasTranslationTemplatesMixin to its own module, since I just did the same for the matching interface.
 3. Clean up pre-existing lint, insofar as it affected Translations.  Not particularly interesting.

The first step is the crux of this branch.  Previously, various classes that have translation import queues associated with them implement IHasTranslationTemplates: Distribution, DistroSeries, Person, Product, ProductSeries, SourcePackage.  IHasTranslationTemplates was already exported on the API, but now we're actually exporting one of its methods.

Unfortunately, setting things up this way created a useless new class on the API, corresponding to IHasTranslationImports, with the method in question.  It didn't help any of the classes that implement IHasTranslationTemplates.  Instead I had to derive their main interfaces from IHasTranslationImports.  (In order to avoid circular imports I first had to split off bits of the translations import queue interface module in a separate branch).

The second step is really just there to finish a forgotten piece of the preparatory work.  The lint fixes I limited to Translations files because otherwise the diff would get out of hand just like that of the preparatory branch.

Besides the 20th-century-school inheritance setup, two other things are not really to my liking in this branch.

First: I can't test the fix.  The current test uses the webservice object to test the presence of the new method, but the webservice object doesn't care about interfaces as specified in the WADL.  So it was perfectly happy to call the method and thus prove that it worked, even though launchpadlib won't see it at all.  I filed that as bug 668190.

I tried complementing and even re-writing the test to use launchpadlib instead of the webservice object.  But the cost was entirely unacceptable—25 seconds or so.  The proper place to test this is in the webservice object, not in the tests for each element of the web service API and especially not at such an enormous cost per.

That said, of course I did verify the fix manually and will do so again in Q/A.

Second thing I don't like: IHasTranslationImports ends up being in the API as a totally useless class.  I tried not exporting the interface, but that produced an error I did not understand.  If anyone ever cares, we can try to remove that later.

To run the test, such as it is (though I actually ran all Translations tests apart from the windmill ones):
{{{
./bin/test -vvc lp.translations.tests -t webservice.xx-translationimportqueue
}}}


Jeroen
-- 
https://code.launchpad.net/~jtv/launchpad/bug-668194-fix-api/+merge/39615
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~jtv/launchpad/bug-668194-fix-api into lp:launchpad/devel.
=== modified file 'lib/lp/registry/configure.zcml'
--- lib/lp/registry/configure.zcml	2010-10-29 10:43:52 +0000
+++ lib/lp/registry/configure.zcml	2010-10-29 10:43:53 +0000
@@ -156,8 +156,6 @@
         <allow
             interface="lp.soyuz.interfaces.queue.IHasQueueItems"/>
         <allow
-            interface="lp.translations.interfaces.hastranslationimports.IHasTranslationImports"/>
-        <allow
             interface="lp.soyuz.interfaces.publishing.ICanPublishPackages"/>
         <require
             permission="launchpad.Edit"
@@ -849,8 +847,6 @@
             <allow
                 interface="lp.registry.interfaces.person.ITeamPublic"/>
             <allow
-                interface="lp.translations.interfaces.hastranslationimports.IHasTranslationImports"/>
-            <allow
                 interface="lp.registry.interfaces.person.IHasStanding"/>
             <allow
                 interface="lp.registry.interfaces.person.IPersonCommAdminWriteRestricted"/>
@@ -1113,8 +1109,6 @@
         <allow
             interface="lp.bugs.interfaces.bugtarget.IHasBugHeat"/>
         <allow
-            interface="lp.translations.interfaces.hastranslationimports.IHasTranslationImports"/>
-        <allow
             interface="lp.translations.interfaces.customlanguagecode.IHasCustomLanguageCodes"/>
         <require
             permission="launchpad.View"
@@ -1382,8 +1376,6 @@
             interface="lp.registry.interfaces.productseries.IProductSeriesEditRestricted"/>
         <allow
             interface="lp.bugs.interfaces.bugtarget.IHasBugHeat"/>
-        <allow
-            interface="lp.translations.interfaces.hastranslationimports.IHasTranslationImports"/>
         <require
             permission="launchpad.Edit"
             set_schema="lp.app.interfaces.launchpad.IServiceUsage"/>
@@ -1447,8 +1439,6 @@
             interface="lp.registry.interfaces.distribution.IDistributionPublic"/>
         <allow
             interface="lp.bugs.interfaces.bugtarget.IHasBugHeat"/>
-        <allow
-            interface="lp.translations.interfaces.hastranslationimports.IHasTranslationImports"/>
         <require
             permission="launchpad.Edit"
             interface="lp.registry.interfaces.distribution.IDistributionEditRestricted"/>
@@ -1595,8 +1585,6 @@
             interface="lp.bugs.interfaces.bugtarget.IHasBugHeat"/>
         <allow
             interface="lp.soyuz.interfaces.buildrecords.IHasBuildRecords"/>
-        <allow
-            interface="lp.translations.interfaces.hastranslationimports.IHasTranslationImports"/>
 
         <!-- IQuestionTarget -->
 

=== modified file 'lib/lp/registry/interfaces/distribution.py'
--- lib/lp/registry/interfaces/distribution.py	2010-10-14 17:30:10 +0000
+++ lib/lp/registry/interfaces/distribution.py	2010-10-29 10:43:53 +0000
@@ -97,6 +97,9 @@
     Title,
     )
 from lp.soyuz.interfaces.buildrecords import IHasBuildRecords
+from lp.translations.interfaces.hastranslationimports import (
+    IHasTranslationImports,
+    )
 from lp.translations.interfaces.translationgroup import ITranslationPolicy
 
 
@@ -128,8 +131,8 @@
 class IDistributionPublic(
     IBugTarget, ICanGetMilestonesDirectly, IHasAppointedDriver,
     IHasBuildRecords, IHasDrivers, IHasMentoringOffers, IHasMilestones,
-    IHasOwner, IHasSecurityContact, IHasSprints, ITranslationPolicy,
-    IKarmaContext, ILaunchpadUsage, IMakesAnnouncements,
+    IHasOwner, IHasSecurityContact, IHasSprints, IHasTranslationImports,
+    ITranslationPolicy, IKarmaContext, ILaunchpadUsage, IMakesAnnouncements,
     IOfficialBugTagTargetPublic, IPillar, IServiceUsage,
     ISpecificationTarget):
     """Public IDistribution properties."""

=== modified file 'lib/lp/registry/interfaces/distroseries.py'
--- lib/lp/registry/interfaces/distroseries.py	2010-10-18 04:19:10 +0000
+++ lib/lp/registry/interfaces/distroseries.py	2010-10-29 10:43:53 +0000
@@ -86,6 +86,9 @@
     UniqueField,
     )
 from lp.soyuz.interfaces.buildrecords import IHasBuildRecords
+from lp.translations.interfaces.hastranslationimports import (
+    IHasTranslationImports,
+    )
 from lp.translations.interfaces.languagepack import ILanguagePack
 from lp.translations.interfaces.potemplate import IHasTranslationTemplates
 
@@ -179,7 +182,8 @@
 class IDistroSeriesPublic(
     ISeriesMixin, IHasAppointedDriver, IHasOwner, IBugTarget,
     ISpecificationGoal, IHasMilestones, IHasOfficialBugTags,
-    IHasBuildRecords, IHasTranslationTemplates, IServiceUsage):
+    IHasBuildRecords, IHasTranslationImports, IHasTranslationTemplates,
+    IServiceUsage):
     """Public IDistroSeries properties."""
 
     id = Attribute("The distroseries's unique number.")

=== modified file 'lib/lp/registry/interfaces/person.py'
--- lib/lp/registry/interfaces/person.py	2010-10-19 20:54:44 +0000
+++ lib/lp/registry/interfaces/person.py	2010-10-29 10:43:53 +0000
@@ -147,6 +147,9 @@
     StrippedTextLine,
     )
 from lp.services.worlddata.interfaces.language import ILanguage
+from lp.translations.interfaces.hastranslationimports import (
+    IHasTranslationImports,
+    )
 
 
 PRIVATE_TEAM_PREFIX = 'private-'
@@ -507,7 +510,7 @@
 class IPersonPublic(IHasBranches, IHasSpecifications, IHasMentoringOffers,
                     IHasMergeProposals, IHasLogo, IHasMugshot, IHasIcon,
                     IHasLocation, IHasRequestedReviews, IObjectWithLocation,
-                    IPrivacy, IHasBugs, IHasRecipes):
+                    IPrivacy, IHasBugs, IHasRecipes, IHasTranslationImports):
     """Public attributes for a Person."""
 
     id = Int(title=_('ID'), required=True, readonly=True)

=== modified file 'lib/lp/registry/interfaces/product.py'
--- lib/lp/registry/interfaces/product.py	2010-09-21 09:37:06 +0000
+++ lib/lp/registry/interfaces/product.py	2010-10-29 10:43:53 +0000
@@ -134,6 +134,9 @@
     Title,
     URIField,
     )
+from lp.translations.interfaces.hastranslationimports import (
+    IHasTranslationImports,
+    )
 from lp.translations.interfaces.translationgroup import ITranslationPolicy
 
 # This is based on the definition of <label> in RFC 1035, section
@@ -407,9 +410,10 @@
     IHasBranchVisibilityPolicy, IHasDrivers, IHasExternalBugTracker, IHasIcon,
     IHasLogo, IHasMentoringOffers, IHasMergeProposals, IHasMilestones,
     IHasMugshot, IHasOwner, IHasSecurityContact, IHasSprints,
-    ITranslationPolicy, IKarmaContext, ILaunchpadUsage, IMakesAnnouncements,
-    IOfficialBugTagTargetPublic, IPillar, ISpecificationTarget, IHasRecipes,
-    IHasCodeImports, IServiceUsage):
+    IHasTranslationImports, ITranslationPolicy, IKarmaContext,
+    ILaunchpadUsage, IMakesAnnouncements, IOfficialBugTagTargetPublic,
+    IPillar, ISpecificationTarget, IHasRecipes, IHasCodeImports,
+    IServiceUsage):
     """Public IProduct properties."""
 
     id = Int(title=_('The Project ID'))

=== modified file 'lib/lp/registry/interfaces/productseries.py'
--- lib/lp/registry/interfaces/productseries.py	2010-10-18 17:05:42 +0000
+++ lib/lp/registry/interfaces/productseries.py	2010-10-29 10:43:53 +0000
@@ -73,6 +73,9 @@
     PersonChoice,
     Title,
     )
+from lp.translations.interfaces.hastranslationimports import (
+    IHasTranslationImports,
+    )
 from lp.translations.interfaces.potemplate import IHasTranslationTemplates
 from lp.translations.interfaces.translations import (
     TranslationsBranchImportMode,
@@ -121,7 +124,7 @@
 class IProductSeriesPublic(
     ISeriesMixin, IHasAppointedDriver, IHasOwner, IBugTarget,
     ISpecificationGoal, IHasMilestones, IHasOfficialBugTags,
-    IHasTranslationTemplates, IServiceUsage):
+    IHasTranslationImports, IHasTranslationTemplates, IServiceUsage):
     """Public IProductSeries properties."""
     # XXX Mark Shuttleworth 2004-10-14: Would like to get rid of id in
     # interfaces, as soon as SQLobject allows using the object directly

=== modified file 'lib/lp/registry/interfaces/sourcepackage.py'
--- lib/lp/registry/interfaces/sourcepackage.py	2010-08-20 20:31:18 +0000
+++ lib/lp/registry/interfaces/sourcepackage.py	2010-10-29 10:43:53 +0000
@@ -55,12 +55,15 @@
     IHasMergeProposals,
     )
 from lp.soyuz.interfaces.component import IComponent
+from lp.translations.interfaces.hastranslationimports import (
+    IHasTranslationImports,
+    )
 from lp.translations.interfaces.potemplate import IHasTranslationTemplates
 
 
 class ISourcePackage(IBugTarget, IHasBranches, IHasMergeProposals,
                      IHasOfficialBugTags, IHasCodeImports,
-                     IHasTranslationTemplates):
+                     IHasTranslationImports, IHasTranslationTemplates):
     """A SourcePackage. See the MagicSourcePackage specification. This
     interface preserves as much as possible of the old SourcePackage
     interface from the SourcePackage table, with the new table-less

=== modified file 'lib/lp/registry/model/distribution.py'
--- lib/lp/registry/model/distribution.py	2010-10-24 12:46:23 +0000
+++ lib/lp/registry/model/distribution.py	2010-10-29 10:43:53 +0000
@@ -190,7 +190,7 @@
     )
 from lp.soyuz.model.sourcepackagerelease import SourcePackageRelease
 from lp.translations.interfaces.translationgroup import TranslationPermission
-from lp.translations.model.translationimportqueue import (
+from lp.translations.model.hastranslationimports import (
     HasTranslationImportsMixin,
     )
 

=== modified file 'lib/lp/registry/model/distroseries.py'
--- lib/lp/registry/model/distroseries.py	2010-10-18 04:19:10 +0000
+++ lib/lp/registry/model/distroseries.py	2010-10-29 10:43:53 +0000
@@ -179,6 +179,9 @@
     DistroSeriesLanguage,
     DummyDistroSeriesLanguage,
     )
+from lp.translations.model.hastranslationimports import (
+    HasTranslationImportsMixin,
+    )
 from lp.translations.model.languagepack import LanguagePack
 from lp.translations.model.pofile import POFile
 from lp.translations.model.pofiletranslator import POFileTranslator
@@ -187,9 +190,6 @@
     POTemplate,
     TranslationTemplatesCollection,
     )
-from lp.translations.model.translationimportqueue import (
-    HasTranslationImportsMixin,
-    )
 
 
 class DistroSeries(SQLBase, BugTargetBase, HasSpecificationsMixin,

=== modified file 'lib/lp/registry/model/person.py'
--- lib/lp/registry/model/person.py	2010-10-28 09:35:57 +0000
+++ lib/lp/registry/model/person.py	2010-10-29 10:43:53 +0000
@@ -276,7 +276,7 @@
 from lp.soyuz.interfaces.archivesubscriber import IArchiveSubscriberSet
 from lp.soyuz.model.archive import Archive
 from lp.soyuz.model.sourcepackagerelease import SourcePackageRelease
-from lp.translations.model.translationimportqueue import (
+from lp.translations.model.hastranslationimports import (
     HasTranslationImportsMixin,
     )
 

=== modified file 'lib/lp/registry/model/product.py'
--- lib/lp/registry/model/product.py	2010-10-24 13:02:07 +0000
+++ lib/lp/registry/model/product.py	2010-10-29 10:43:53 +0000
@@ -170,10 +170,10 @@
     CustomLanguageCode,
     HasCustomLanguageCodesMixin,
     )
+from lp.translations.model.hastranslationimports import (
+    HasTranslationImportsMixin,
+    )
 from lp.translations.model.potemplate import POTemplate
-from lp.translations.model.translationimportqueue import (
-    HasTranslationImportsMixin,
-    )
 
 
 def get_license_status(license_approved, license_reviewed, licenses):

=== modified file 'lib/lp/registry/model/productseries.py'
--- lib/lp/registry/model/productseries.py	2010-10-18 20:40:05 +0000
+++ lib/lp/registry/model/productseries.py	2010-10-29 10:43:53 +0000
@@ -89,6 +89,9 @@
 from lp.translations.interfaces.translations import (
     TranslationsBranchImportMode,
     )
+from lp.translations.model.hastranslationimports import (
+    HasTranslationImportsMixin,
+    )
 from lp.translations.model.pofile import POFile
 from lp.translations.model.potemplate import (
     HasTranslationTemplatesMixin,
@@ -96,9 +99,6 @@
     TranslationTemplatesCollection,
     )
 from lp.translations.model.productserieslanguage import ProductSeriesLanguage
-from lp.translations.model.translationimportqueue import (
-    HasTranslationImportsMixin,
-    )
 
 
 MAX_TIMELINE_MILESTONES = 20

=== modified file 'lib/lp/registry/model/sourcepackage.py'
--- lib/lp/registry/model/sourcepackage.py	2010-10-03 15:30:06 +0000
+++ lib/lp/registry/model/sourcepackage.py	2010-10-29 10:43:53 +0000
@@ -91,13 +91,13 @@
     )
 from lp.soyuz.model.publishing import SourcePackagePublishingHistory
 from lp.soyuz.model.sourcepackagerelease import SourcePackageRelease
+from lp.translations.model.hastranslationimports import (
+    HasTranslationImportsMixin,
+    )
 from lp.translations.model.potemplate import (
     HasTranslationTemplatesMixin,
     TranslationTemplatesCollection,
     )
-from lp.translations.model.translationimportqueue import (
-    HasTranslationImportsMixin,
-    )
 
 
 class SourcePackageQuestionTargetMixin(QuestionTargetMixin):

=== modified file 'lib/lp/translations/browser/hastranslationimports.py'
--- lib/lp/translations/browser/hastranslationimports.py	2010-10-29 10:43:52 +0000
+++ lib/lp/translations/browser/hastranslationimports.py	2010-10-29 10:43:53 +0000
@@ -241,7 +241,7 @@
                     new_status = status
                     break
             if new_status is None:
-                # We are trying to set a bogus status. 
+                # We are trying to set a bogus status.
                 # That means that it's a broken request.
                 raise UnexpectedFormData(
                     'Ignored the request to change the status from %s to %s.'
@@ -361,6 +361,7 @@
             'value': entry.status.title,
             'items': items}
 
+
 class EntryImportStatusVocabularyFactory:
     """Factory for a vocabulary containing a list of statuses for import."""
 
@@ -378,7 +379,7 @@
     def __call__(self, context):
         terms = []
         for status in RosettaImportStatus.items:
-            if (status == self.entry.status or 
+            if (status == self.entry.status or
                 self.entry.canSetStatus(status, self.user)):
                 terms.append(
                     SimpleTerm(status.name, status.name, status.title))

=== modified file 'lib/lp/translations/interfaces/hastranslationimports.py'
--- lib/lp/translations/interfaces/hastranslationimports.py	2010-10-29 10:43:52 +0000
+++ lib/lp/translations/interfaces/hastranslationimports.py	2010-10-29 10:43:53 +0000
@@ -25,7 +25,7 @@
 
 
 class IHasTranslationImports(Interface):
-    """An entity on which a translation import queue entry is attached.
+    """An entity that has a translation import queue.
 
     Examples include `ProductSeries`, `SourcePackage`, `DistroSeries`,
     and `Person`.

=== modified file 'lib/lp/translations/interfaces/webservice.py'
--- lib/lp/translations/interfaces/webservice.py	2010-10-29 10:43:52 +0000
+++ lib/lp/translations/interfaces/webservice.py	2010-10-29 10:43:53 +0000
@@ -22,5 +22,3 @@
     ITranslationImportQueue,
     ITranslationImportQueueEntry,
     )
-
-

=== modified file 'lib/lp/translations/model/approver.py'
--- lib/lp/translations/model/approver.py	2010-10-29 10:43:52 +0000
+++ lib/lp/translations/model/approver.py	2010-10-29 10:43:53 +0000
@@ -114,7 +114,7 @@
             return entry
         potemplate = None
         # Path must be a template path.
-        if not self._potemplates.has_key(entry.path):
+        if entry.path not in self._potemplates:
             return entry
 
         domain = make_domain(entry.path)
@@ -235,8 +235,9 @@
         assert (
             entry.productseries == self._potemplateset.productseries and
             entry.distroseries == self._potemplateset.distroseries and
-            entry.sourcepackagename == self._potemplateset.sourcepackagename
-            ), ("Entry must be for same target as approver.")
+            entry.sourcepackagename ==
+                self._potemplateset.sourcepackagename), (
+            "Entry must be for same target as approver.")
 
         # This method is intended to be used to wrap
         # TranslationImportQueue.addOrUpdateEntry which may return None.
@@ -254,4 +255,3 @@
                     RosettaImportStatus.APPROVED,
                     getUtility(ILaunchpadCelebrities).rosetta_experts)
         return entry
-

=== added file 'lib/lp/translations/model/hastranslationimports.py'
--- lib/lp/translations/model/hastranslationimports.py	1970-01-01 00:00:00 +0000
+++ lib/lp/translations/model/hastranslationimports.py	2010-10-29 10:43:53 +0000
@@ -0,0 +1,36 @@
+# Copyright 2010 Canonical Ltd.  This software is licensed under the
+# GNU Affero General Public License version 3 (see the file LICENSE).
+
+"""Model code for `IHasTranslationImports."""
+
+__metaclass__ = type
+__all__ = [
+    'HasTranslationImportsMixin',
+    ]
+
+from zope.component import getUtility
+
+from lp.translations.interfaces.translationimportqueue import (
+    ITranslationImportQueue,
+    )
+
+
+class HasTranslationImportsMixin:
+    """Helper class for implementing `IHasTranslationImports`."""
+
+    def getFirstEntryToImport(self):
+        """See `IHasTranslationImports`."""
+        translation_import_queue = getUtility(ITranslationImportQueue)
+        return translation_import_queue.getFirstEntryToImport(target=self)
+
+    def getTranslationImportQueueEntries(self, import_status=None,
+                                         file_extension=None):
+        """See `IHasTranslationImports`."""
+        if file_extension is None:
+            extensions = None
+        else:
+            extensions = [file_extension]
+        translation_import_queue = getUtility(ITranslationImportQueue)
+        return translation_import_queue.getAllEntries(
+            target=self, import_status=import_status,
+            file_extensions=extensions)

=== modified file 'lib/lp/translations/model/pofile.py'
--- lib/lp/translations/model/pofile.py	2010-10-29 10:43:52 +0000
+++ lib/lp/translations/model/pofile.py	2010-10-29 10:43:53 +0000
@@ -534,7 +534,8 @@
         applicable_template = Coalesce(
             TranslationMessage.potemplateID, self.potemplate.id)
         clauses = [
-            TranslationTemplateItem.potmsgsetID == TranslationMessage.potmsgsetID,
+            TranslationTemplateItem.potmsgsetID ==
+                TranslationMessage.potmsgsetID,
             TranslationTemplateItem.potemplate == self.potemplate,
             TranslationMessage.language == self.language,
             applicable_template == self.potemplate.id,
@@ -1103,8 +1104,7 @@
 
         # Prepare the mail notification.
         msgsets_imported = self.getTranslationMessages(
-            TranslationMessage.was_obsolete_in_last_import == False
-            ).count()
+            TranslationMessage.was_obsolete_in_last_import == False).count()
 
         replacements = collect_import_info(entry_to_import, self, warnings)
         replacements.update({

=== modified file 'lib/lp/translations/model/translationimportqueue.py'
--- lib/lp/translations/model/translationimportqueue.py	2010-10-29 10:43:52 +0000
+++ lib/lp/translations/model/translationimportqueue.py	2010-10-29 10:43:53 +0000
@@ -6,7 +6,6 @@
 __metaclass__ = type
 __all__ = [
     'collect_import_info',
-    'HasTranslationImportsMixin',
     'TranslationImportQueueEntry',
     'TranslationImportQueue',
     ]
@@ -75,9 +74,6 @@
 from lp.registry.interfaces.sourcepackage import ISourcePackage
 from lp.services.worlddata.interfaces.language import ILanguageSet
 from lp.translations.enums import RosettaImportStatus
-from lp.translations.interfaces.hastranslationimports import (
-    IHasTranslationImports,
-    )
 from lp.translations.interfaces.pofile import IPOFileSet
 from lp.translations.interfaces.potemplate import (
     IPOTemplate,
@@ -1428,25 +1424,3 @@
     def remove(self, entry):
         """See ITranslationImportQueue."""
         TranslationImportQueueEntry.delete(entry.id)
-
-
-class HasTranslationImportsMixin:
-    """Information related with translation import queue."""
-    implements(IHasTranslationImports)
-
-    def getFirstEntryToImport(self):
-        """See `IHasTranslationImports`."""
-        translation_import_queue = TranslationImportQueue()
-        return translation_import_queue.getFirstEntryToImport(target=self)
-
-    def getTranslationImportQueueEntries(self, import_status=None,
-                                         file_extension=None):
-        """See `IHasTranslationImports`."""
-        if file_extension is None:
-            extensions = None
-        else:
-            extensions = [file_extension]
-        translation_import_queue = getUtility(ITranslationImportQueue)
-        return translation_import_queue.getAllEntries(
-            target=self, import_status=import_status,
-            file_extensions=extensions)

=== modified file 'lib/lp/translations/tests/test_translationtemplatesbuildbehavior.py'
--- lib/lp/translations/tests/test_translationtemplatesbuildbehavior.py	2010-10-29 10:43:52 +0000
+++ lib/lp/translations/tests/test_translationtemplatesbuildbehavior.py	2010-10-29 10:43:53 +0000
@@ -145,7 +145,7 @@
             branch_url = build_params[-1]['branch_url']
             # The slave receives the public http URL for the branch.
             self.assertEqual(
-                branch_url, 
+                branch_url,
                 behavior.buildfarmjob.branch.composePublicURL())
         return d.addCallback(got_dispatch)
 
@@ -301,7 +301,7 @@
 
         def got_dispatch((status, info)):
             dummy_tar = os.path.join(
-                os.path.dirname(__file__),'dummy_templates.tar.gz')
+                os.path.dirname(__file__), 'dummy_templates.tar.gz')
             # XXX 2010-10-18 bug=662631
             # Change this to do non-blocking IO.
             builder.slave.getFile = lambda sum: open(dummy_tar)
@@ -313,7 +313,7 @@
             slave_status = {
                 'builder_status': status[0],
                 'build_status': status[1],
-                'build_id': status[2]
+                'build_id': status[2],
                 }
             behavior.updateSlaveStatus(status, slave_status)
             return behavior.updateBuild_WAITING(
@@ -325,7 +325,7 @@
             expected_templates = [
                 'po/domain.pot',
                 'po-other/other.pot',
-                'po-thethird/templ3.pot'
+                'po-thethird/templ3.pot',
                 ]
             list1 = sorted(expected_templates)
             list2 = sorted([entry.path for entry in entries])

=== modified file 'lib/lp/translations/utilities/tests/test_xpi_search.py'
--- lib/lp/translations/utilities/tests/test_xpi_search.py	2010-10-29 10:43:52 +0000
+++ lib/lp/translations/utilities/tests/test_xpi_search.py	2010-10-29 10:43:53 +0000
@@ -70,7 +70,6 @@
                            u'FooZilla Zilla Thingy'],
                           message_list)
 
-
     def test_templateSearchingForMsgIDs(self):
         """Searching returns no results for internal msg IDs."""
         entry = self.setUpTranslationImportQueueForTemplate('en-US')


Follow ups