← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~henninge/launchpad/devel-705176-sharing-info-on-page into lp:launchpad

 

Henning Eggers has proposed merging lp:~henninge/launchpad/devel-705176-sharing-info-on-page into lp:launchpad.

Requested reviews:
  Launchpad UI Reviewers (launchpad-ui-reviewers): ui
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  #705176 Improve sharing information on translation pages
  https://bugs.launchpad.net/bugs/705176

For more details, see:
https://code.launchpad.net/~henninge/launchpad/devel-705176-sharing-info-on-page/+merge/51283

= Summary =

First step: display sharing information on translation pages. This
makes it easy for translators to go to the "other side" of a
translation link (i.e. a packaging link).

The next step will be to add a link to a page where more detail about
translation sharing can be found and which also allows to setup
sharing.

For the UI review, here are some screenshots of how the information appears in the UI:
http://people.canonical.com/~henninge/screenshots/sharing-information-productseries.png
http://people.canonical.com/~henninge/screenshots/sharing-information-template.png
http://people.canonical.com/~henninge/screenshots/sharing-information-pofile.png

== Proposed fix ==

Use the functions provided in translationsharinginfo to display the
correct text and link on the pages.

== Pre-implementation notes ==

I discussed this with Maris at the Thunderdome. We agreed that the "Templates with the same name elsewhere" section had to go away since that information would now be provided through the sharing information.

I chatted with Deryck about this. We weren't entirely sure, where
exactly to place the information on the pages. At least I was, so this
is still up to UI discussion.

== Implementation details ==

Pretty straight forward implementation of test, view class attributes
and templates.

I changed the get_ubuntu_sharing_info to return a list instead of a
generator. This was easier to handle and is also symmetric to
get_upstream_translation_info.

The new UI elements are hidden behind a feature flag. Actually, the elements from this branch could go live immediately but subsequent branches will need to be hidden until the feature is complete.

== Tests ==

bin/test -vvcm lp.translations.browser.test.test_sharing_information

== Demo and Q/A ==

You will have to enable the feature:
translations.sharing_information.enabled

View sharing information for a product series here:
http://translations.launchpad.dev/evolution/trunk

View sharing information for a template here:
http://translations.launchpad.dev/evolution/trunk/+pots/evolution-2.2

View sharing information for a pofile here:
http://translations.launchpad.dev/evolution/trunk/+pots/evolution-2.2/es

Once on the other side, you'll see the equivalent links there.

= Launchpad lint =

Checking for conflicts and issues in changed files.

Linting changed files:
  lib/lp/services/features/flags.py
  lib/lp/translations/browser/pofile.py
  lib/lp/translations/browser/potemplate.py
  lib/lp/translations/browser/productseries.py
  lib/lp/translations/browser/sourcepackage.py
  lib/lp/translations/browser/tests/test_sharing_information.py
  lib/lp/translations/templates/pofile-translate.pt
  lib/lp/translations/templates/potemplate-index.pt
  lib/lp/translations/templates/productseries-translations.pt
  lib/lp/translations/templates/sourcepackage-translations.pt
  lib/lp/translations/utilities/translationsharinginfo.py

./lib/lp/translations/browser/pofile.py
     794: E301 expected 1 blank line, found 2
     910: E301 expected 1 blank line, found 2
-- 
https://code.launchpad.net/~henninge/launchpad/devel-705176-sharing-info-on-page/+merge/51283
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~henninge/launchpad/devel-705176-sharing-info-on-page into lp:launchpad.
=== modified file 'lib/lp/services/features/flags.py'
--- lib/lp/services/features/flags.py	2011-02-24 19:59:45 +0000
+++ lib/lp/services/features/flags.py	2011-02-25 16:16:52 +0000
@@ -73,6 +73,10 @@
      'boolean',
      'Enables derivative distributions pages.',
      ''),
+    ('translations.sharing_information.enabled',
+     'boolean',
+     'Enables display of sharing information on translation pages.',
+     ''),
     ('visible_render_time',
      'boolean',
      'Shows the server-side page render time in the login widget.',

=== modified file 'lib/lp/translations/browser/pofile.py'
--- lib/lp/translations/browser/pofile.py	2011-01-24 15:51:18 +0000
+++ lib/lp/translations/browser/pofile.py	2011-02-25 16:16:52 +0000
@@ -59,6 +59,12 @@
     ITranslationImportQueue,
     )
 from lp.translations.interfaces.translationsperson import ITranslationsPerson
+from lp.translations.utilities.translationsharinginfo import (
+    has_ubuntu_template,
+    has_upstream_template,
+    get_ubuntu_sharing_info,
+    get_upstream_sharing_info,
+    )
 
 
 class POFileNavigation(Navigation):
@@ -986,6 +992,36 @@
     def translations_order(self):
         return ' '.join(self._messages_html_id())
 
+    @property
+    def is_upstream_pofile(self):
+        potemplate = self.context.potemplate
+        return potemplate.translation_side == TranslationSide.UPSTREAM
+
+    def is_sharing(self):
+        if self.is_upstream_pofile:
+            return has_ubuntu_template(
+                productseries=self.context.potemplate.productseries,
+                templatename=self.context.potemplate.name)
+        else:
+            return has_upstream_template(
+                sourcepackage=self.context.potemplate.sourcepackage,
+                templatename=self.context.potemplate.name)
+
+    @property
+    def sharing_pofile(self):
+        if self.is_upstream_pofile:
+            infos = get_ubuntu_sharing_info(
+                productseries=self.context.potemplate.productseries,
+                templatename=self.context.potemplate.name)
+        else:
+            infos = get_upstream_sharing_info(
+                sourcepackage=self.context.potemplate.sourcepackage,
+                templatename=self.context.potemplate.name)
+        if len(infos) == 0:
+            return None
+        obj, potemplate = infos[0]
+        return potemplate.getPOFileByLang(self.context.language.code)
+
 
 class POExportView(BaseExportView):
 

=== modified file 'lib/lp/translations/browser/potemplate.py'
--- lib/lp/translations/browser/potemplate.py	2010-12-02 16:13:51 +0000
+++ lib/lp/translations/browser/potemplate.py	2011-02-25 16:16:52 +0000
@@ -77,12 +77,19 @@
     IPOTemplateSet,
     IPOTemplateSubset,
     )
+from lp.translations.interfaces.side import TranslationSide
 from lp.translations.interfaces.translationimporter import (
     ITranslationImporter,
     )
 from lp.translations.interfaces.translationimportqueue import (
     ITranslationImportQueue,
     )
+from lp.translations.utilities.translationsharinginfo import (
+    has_ubuntu_template,
+    get_ubuntu_sharing_info,
+    has_upstream_template,
+    get_upstream_sharing_info,
+    )
 
 
 class POTemplateNavigation(Navigation):
@@ -354,6 +361,35 @@
             pofile = pofileset.getDummy(self.context, language)
         return pofile
 
+    @property
+    def is_upstream_template(self):
+        return self.context.translation_side == TranslationSide.UPSTREAM
+
+    def is_sharing(self):
+        if self.is_upstream_template:
+            return has_ubuntu_template(
+                productseries=self.context.productseries,
+                templatename=self.context.name)
+        else:
+            return has_upstream_template(
+                sourcepackage=self.context.sourcepackage,
+                templatename=self.context.name)
+
+    @property
+    def sharing_template(self):
+        if self.is_upstream_template:
+            infos = get_ubuntu_sharing_info(
+                productseries=self.context.productseries,
+                templatename=self.context.name)
+        else:
+            infos = get_upstream_sharing_info(
+                sourcepackage=self.context.sourcepackage,
+                templatename=self.context.name)
+        if len(infos) == 0:
+            return None
+        obj, template = infos[0]
+        return template
+
 
 class POTemplateUploadView(LaunchpadView, TranslationsMixin):
     """Upload translations and updated template."""

=== modified file 'lib/lp/translations/browser/productseries.py'
--- lib/lp/translations/browser/productseries.py	2011-02-02 15:43:31 +0000
+++ lib/lp/translations/browser/productseries.py	2011-02-25 16:16:52 +0000
@@ -61,6 +61,10 @@
 from lp.translations.interfaces.translations import (
     TranslationsBranchImportMode,
     )
+from lp.translations.utilities.translationsharinginfo import (
+    has_ubuntu_template,
+    get_ubuntu_sharing_info,
+    )
 
 
 class ProductSeriesTranslationsMenuMixIn:
@@ -447,6 +451,17 @@
         """Whether or not the user is a translations admin."""
         return check_permission("launchpad.TranslationsAdmin", self.context)
 
+    def is_sharing(self):
+        return has_ubuntu_template(productseries=self.context)
+
+    @property
+    def sharing_sourcepackage(self):
+        infos = get_ubuntu_sharing_info(productseries=self.context)
+        if len(infos) == 0:
+            return None
+        sourcepackage, template = infos[0]
+        return sourcepackage
+
 
 class SettingsRadioWidget(LaunchpadRadioWidgetWithDescription):
     """Remove the confusing hint under the widget."""

=== modified file 'lib/lp/translations/browser/sourcepackage.py'
--- lib/lp/translations/browser/sourcepackage.py	2010-08-20 20:31:18 +0000
+++ lib/lp/translations/browser/sourcepackage.py	2011-02-25 16:16:52 +0000
@@ -19,9 +19,14 @@
 from lp.registry.interfaces.sourcepackage import ISourcePackage
 from lp.translations.browser.poexportrequest import BaseExportView
 from lp.translations.browser.translations import TranslationsMixin
+from lp.translations.utilities.translationsharinginfo import (
+    has_upstream_template,
+    get_upstream_sharing_info,
+    )
 
 
 class SourcePackageTranslationsView(TranslationsMixin):
+
     @property
     def potemplates(self):
         return list(self.context.getCurrentTranslationTemplates())
@@ -30,6 +35,18 @@
     def label(self):
         return "Translations for %s" % self.context.displayname
 
+    def is_sharing(self):
+        return has_upstream_template(self.context)
+
+    @property
+    def sharing_productseries(self):
+        infos = get_upstream_sharing_info(self.context)
+        if len(infos) == 0:
+            return None
+
+        productseries, template = infos[0]
+        return productseries
+
 
 class SourcePackageTranslationsMenu(NavigationMenu):
     usedfor = ISourcePackage

=== added file 'lib/lp/translations/browser/tests/test_sharing_information.py'
--- lib/lp/translations/browser/tests/test_sharing_information.py	1970-01-01 00:00:00 +0000
+++ lib/lp/translations/browser/tests/test_sharing_information.py	2011-02-25 16:16:52 +0000
@@ -0,0 +1,208 @@
+# Copyright 2010 Canonical Ltd.  This software is licensed under the
+# GNU Affero General Public License version 3 (see the file LICENSE).
+
+"""Tests for the POTemplate recipe view classes and templates."""
+
+__metaclass__ = type
+
+from canonical.testing.layers import DatabaseFunctionalLayer
+from canonical.launchpad.testing.pages import (
+    extract_text,
+    find_tag_by_id,
+    )
+from lp.app.enums import ServiceUsage
+from lp.services.features.testing import FeatureFixture
+from lp.testing import (
+    BrowserTestCase,
+    celebrity_logged_in,
+    )
+from lp.translations.interfaces.side import TranslationSide
+
+
+def set_translations_usage(obj):
+    """Set the translations_usage to LAUNCHPAD."""
+    with celebrity_logged_in('admin'):
+        obj.translations_usage = ServiceUsage.LAUNCHPAD
+
+
+def enable_translations_on_distroseries(distroseries):
+    with celebrity_logged_in('admin'):
+        distroseries.hide_all_translations = False
+
+
+class TestSharingInfoMixin:
+    """Test display of sharing info."""
+
+    def makeNotSharingObject(self):
+        """Create an object that is not sharing."""
+        raise NotImplementedError
+
+    NOT_SHARING_TEXT = None
+
+    def makeSharingObject(self):
+        """Create an object that is sharing."""
+        raise NotImplementedError
+
+    SHARING_TEXT = None
+
+    def _test_sharing_information(self, obj, expected_text):
+        self.useFixture(FeatureFixture(
+            {'translations.sharing_information.enabled': 'on'}))
+        browser = self.getViewBrowser(
+            obj, no_login=True, rootsite="translations")
+        sharing_info = find_tag_by_id(browser.contents, 'sharing-information')
+        if expected_text is None:
+            self.assertIs(None, sharing_info)
+        else:
+            self.assertIsNot(None, sharing_info)
+            self.assertTextMatchesExpressionIgnoreWhitespace(
+                expected_text, extract_text(sharing_info))
+
+    def test_not_sharing(self):
+        self._test_sharing_information(
+            self.makeNotSharingObject(), self.NOT_SHARING_TEXT)
+
+    def test_sharing(self):
+        self._test_sharing_information(
+            self.makeSharingObject(), self.SHARING_TEXT)
+
+
+class TestUpstreamPOTemplateSharingInfo(BrowserTestCase,
+                                        TestSharingInfoMixin):
+    """Test display of template sharing info."""
+
+    layer = DatabaseFunctionalLayer
+
+    def makeNotSharingObject(self):
+        return self.factory.makePOTemplate()
+
+    NOT_SHARING_TEXT = """
+        This template is not sharing translations with a template in an
+        Ubuntu source package."""
+
+    def makeSharingObject(self):
+        template = self.factory.makePOTemplate()
+        packaging = self.factory.makePackagingLink(
+            productseries=template.productseries, in_ubuntu=True)
+        self.factory.makePOTemplate(
+            distroseries=packaging.distroseries,
+            sourcepackagename=packaging.sourcepackagename,
+            name=template.name)
+        return template
+
+    SHARING_TEXT = """
+        This template is sharing translations with .*"""
+
+
+class TestPOFileSharingInfo(BrowserTestCase,
+                                        TestSharingInfoMixin):
+    """Test display of POFile sharing info."""
+
+    layer = DatabaseFunctionalLayer
+
+    def makeNotSharingObject(self):
+        return self.factory.makePOFile()
+
+    NOT_SHARING_TEXT = None
+
+    def makeSharingObject(self):
+        pofile = self.factory.makePOFile()
+        packaging = self.factory.makePackagingLink(
+            productseries=pofile.potemplate.productseries,
+            in_ubuntu=True)
+        # This will also create a copy of pofile.
+        self.factory.makePOTemplate(
+            distroseries=packaging.distroseries,
+            sourcepackagename=packaging.sourcepackagename,
+            name=pofile.potemplate.name)
+        return pofile
+
+    SHARING_TEXT = """
+        These translations are shared with .*"""
+
+
+class TestUpstreamSharingInfo(BrowserTestCase, TestSharingInfoMixin):
+    """Test display of product series sharing info."""
+
+    layer = DatabaseFunctionalLayer
+
+    def makeNotSharingObject(self):
+        productseries = self.factory.makeProductSeries()
+        set_translations_usage(productseries.product)
+        return productseries
+
+    NOT_SHARING_TEXT = """
+        This project series is not sharing translations with an Ubuntu source
+        package."""
+
+    def makeSharingObject(self):
+        template = self.factory.makePOTemplate()
+        packaging = self.factory.makePackagingLink(
+            productseries=template.productseries, in_ubuntu=True)
+        self.factory.makePOTemplate(
+            distroseries=packaging.distroseries,
+            sourcepackagename=packaging.sourcepackagename,
+            name=template.name)
+        return template.productseries
+
+    SHARING_TEXT = """
+        This project series is sharing translations with .*"""
+
+
+class TestUbuntuPOTemplateSharingInfo(BrowserTestCase, TestSharingInfoMixin):
+    """Test display of template sharing info in an Ubuntu source package."""
+
+    layer = DatabaseFunctionalLayer
+
+    def makeNotSharingObject(self):
+        template = self.factory.makePOTemplate(side=TranslationSide.UBUNTU)
+        enable_translations_on_distroseries(template.distroseries)
+        return template
+
+    NOT_SHARING_TEXT = """
+        This template is not sharing translations with a template in an
+        upstream project."""
+
+    def makeSharingObject(self):
+        upstream_template = self.factory.makePOTemplate()
+        packaging = self.factory.makePackagingLink(
+            productseries=upstream_template.productseries, in_ubuntu=True)
+        template = self.factory.makePOTemplate(
+            distroseries=packaging.distroseries,
+            sourcepackagename=packaging.sourcepackagename,
+            name=upstream_template.name)
+        enable_translations_on_distroseries(packaging.distroseries)
+        return template
+
+    SHARING_TEXT = """
+        This template is sharing translations with .*"""
+
+
+class TestUbuntuSharingInfo(BrowserTestCase, TestSharingInfoMixin):
+    """Test display of source package sharing info."""
+
+    layer = DatabaseFunctionalLayer
+
+    def makeNotSharingObject(self):
+        sourcepackage = self.factory.makeSourcePackage(
+            distroseries=self.factory.makeUbuntuDistroSeries())
+        enable_translations_on_distroseries(sourcepackage.distroseries)
+        return sourcepackage
+
+    NOT_SHARING_TEXT = """
+        This source package is not sharing translations with an upstream
+        project."""
+
+    def makeSharingObject(self):
+        upstream_template = self.factory.makePOTemplate()
+        packaging = self.factory.makePackagingLink(
+            productseries=upstream_template.productseries, in_ubuntu=True)
+        self.factory.makePOTemplate(
+            distroseries=packaging.distroseries,
+            sourcepackagename=packaging.sourcepackagename,
+            name=upstream_template.name)
+        enable_translations_on_distroseries(packaging.distroseries)
+        return packaging.sourcepackage
+
+    SHARING_TEXT = """
+        This source package is sharing translations with .*"""

=== modified file 'lib/lp/translations/templates/pofile-translate.pt'
--- lib/lp/translations/templates/pofile-translate.pt	2010-12-02 16:13:51 +0000
+++ lib/lp/translations/templates/pofile-translate.pt	2011-02-25 16:16:52 +0000
@@ -60,6 +60,20 @@
       <metal:nav-pofile-subpages
         use-macro="context/@@+translations-macros/nav-pofile-subpages" />
 
+      <!-- Sharing information -->
+      <div tal:condition="features/translations.sharing_information.enabled">
+        <div id="sharing-information"
+             tal:condition="view/is_sharing"
+             tal:define="sharing_pofile view/sharing_pofile">
+          <p>
+            These translations are shared with
+            <a tal:content="sharing_pofile/title"
+               tal:attributes="href sharing_pofile/fmt:url"
+               >pofile</a>.
+          </p>
+        </div>
+      </div>
+
         <!-- View filter and suggestions from alternative language. -->
         <form method="get" style="text-align: left;" action="+translate">
           <!-- the hidden elements -->

=== modified file 'lib/lp/translations/templates/potemplate-index.pt'
--- lib/lp/translations/templates/potemplate-index.pt	2010-10-10 21:54:16 +0000
+++ lib/lp/translations/templates/potemplate-index.pt	2011-02-25 16:16:52 +0000
@@ -35,54 +35,6 @@
   </div>
 
   <div class="yui-g">
-    <div class="yui-b portlet">
-      <h3>Related templates</h3>
-    </div>
-    <div class="yui-u first">
-      <p tal:condition="context/relatives_by_source" id="potemplate-relatives">
-        <span>Other templates here:</span>
-        <tal:relatives_by_source repeat="pot view/related_templates_by_source">
-          <a href=""
-             tal:attributes="href pot/fmt:url"
-             tal:content="pot/name">A POTemplate
-          </a><tal:comma condition="not: repeat/pot/end">, 
-        </tal:comma></tal:relatives_by_source><!--
-          --><tal:more-templates replace="structure view/more_templates_by_source_link">
-          and <a href="#">17 other templates</a>
-          </tal:more-templates>.
-      </p>
-    </div>
-
-    <div class="yui-u">
-      <p tal:condition="context/relatives_by_name"
-         id="potemplate-rel-by-name">
-        <span>Templates with the same name elsewhere:</span>
-        <tal:relatives_by_name repeat="pot view/related_templates_by_name">
-          <tal:product condition="pot/productseries">
-            <a href=""
-               tal:attributes="href pot/fmt:url"
-               tal:content="string:${pot/productseries/product/displayname}
-                            ${pot/productseries/displayname}">
-              A Product and ProductSeries
-            </a>
-          </tal:product><!--
-          --><tal:distro condition="pot/distroseries">
-            <a href=""
-               tal:attributes="href pot/fmt:url">
-              <tal:distro_name content="pot/distroseries/distribution/displayname">
-                A Distribution
-              </tal:distro_name>
-              <tal:distroseries_name content="pot/distroseries/displayname">
-                and DistroSeries</tal:distroseries_name></a><!--
-          --></tal:distro><tal:comma condition="not: repeat/pot/end">, 
-          </tal:comma></tal:relatives_by_name><!--
-          --><tal:more condition="view/has_more_templates_by_name"
-                       >...</tal:more>
-      </p>
-    </div>
-  </div>
-
-  <div class="yui-g">
     <div class="yui-u first">
       <div class="portlet">
         <h3>Permissions</h3>
@@ -99,11 +51,46 @@
               ">translation instructions</a>.
         </p>
       </div>
+      <div class="portlet" id="sharing-information"
+           tal:condition="features/translations.sharing_information.enabled">
+        <h3>Sharing Information</h3>
+        <p tal:condition="not:view/is_sharing">
+          This template is not sharing translations with
+          a template in an
+          <span tal:condition="view/is_upstream_template">
+              Ubuntu source package</span>
+          <span tal:condition="not:view/is_upstream_template">
+              upstream project</span>.
+        </p>
+        <p tal:condition="view/is_sharing"
+           tal:define="template view/sharing_template">
+          This template is sharing translations with
+          <a tal:content="template/title"
+             tal:attributes="href template/fmt:url"
+             >template</a>.
+        </p>
+      </div>
     </div>
 
-    <div class="yui-u"
+    <div class="yui-u">
+      <div class="portlet">
+        <h3>Related templates</h3>
+        <p tal:condition="context/relatives_by_source" id="potemplate-relatives">
+          <span>Other templates here:</span>
+          <tal:relatives_by_source repeat="pot view/related_templates_by_source">
+            <a href=""
+               tal:attributes="href pot/fmt:url"
+               tal:content="pot/name">A POTemplate
+            </a><tal:comma condition="not: repeat/pot/end">, </tal:comma
+              ></tal:relatives_by_source><tal:more-templates
+                replace="structure view/more_templates_by_source_link">
+            and <a href="#">17 other templates</a>
+            </tal:more-templates>.
+        </p>
+      </div>
+
+      <div class="portlet"
          tal:condition="context/required:launchpad.AnyPerson">
-      <div class="portlet">
         <h3>Administration</h3>
         <p>If you want to synchronize these translations manually, you
           can

=== modified file 'lib/lp/translations/templates/productseries-translations.pt'
--- lib/lp/translations/templates/productseries-translations.pt	2010-11-03 13:04:59 +0000
+++ lib/lp/translations/templates/productseries-translations.pt	2011-02-25 16:16:52 +0000
@@ -76,6 +76,20 @@
                   ">translation instructions</a> first.
             </p>
           </div>
+          <div class="portlet" id="sharing-information"
+            tal:condition="features/translations.sharing_information.enabled">
+            <h3>Sharing Information</h3>
+            <p tal:condition="not:view/is_sharing">
+              This project series is not sharing translations with
+              an Ubuntu source package.
+            </p>
+            <p tal:condition="view/is_sharing">
+              This project series is sharing translations with
+              <a tal:replace="structure view/sharing_sourcepackage/fmt:link">
+                package name
+              </a>.
+            </p>
+          </div>
         </div>
 
         <div class="yui-u">

=== modified file 'lib/lp/translations/templates/sourcepackage-translations.pt'
--- lib/lp/translations/templates/sourcepackage-translations.pt	2010-12-21 15:13:17 +0000
+++ lib/lp/translations/templates/sourcepackage-translations.pt	2011-02-25 16:16:52 +0000
@@ -24,8 +24,23 @@
                  context/distroseries/distribution/@@+portlet-translation-groups-and-permission"/>
             </p>
           </div>
+          <div class="portlet" id="sharing-information"
+               tal:condition="features/translations.sharing_information.enabled">
+            <h3>Sharing Information</h3>
+            <p tal:condition="not:view/is_sharing">
+              This source package is not sharing translations with
+              an upstream project.
+            </p>
+            <p tal:condition="view/is_sharing">
+              This source package is sharing translations with
+              <a tal:replace="structure view/sharing_productseries/fmt:link">
+                project series name
+              </a>.
+            </p>
+          </div>
         </div>
         <div class="yui-u">
+
           <div class="portlet">
             <h3>Administration</h3>
             <p>Translation files that are waiting to be imported are shown in

=== modified file 'lib/lp/translations/utilities/translationsharinginfo.py'
--- lib/lp/translations/utilities/translationsharinginfo.py	2011-02-23 11:53:06 +0000
+++ lib/lp/translations/utilities/translationsharinginfo.py	2011-02-25 16:16:52 +0000
@@ -152,9 +152,10 @@
 
 def get_ubuntu_sharing_info(productseries, templatename=None):
     """Return a list of sharing information for the given target."""
-    for result in find_ubuntu_sharing_info(productseries, templatename):
-        distroseries, sourcepackagename, templatename = result
-        yield (SourcePackage(sourcepackagename, distroseries), templatename)
+    return [
+        (SourcePackage(packagename, series), name)
+        for series, packagename, name in find_ubuntu_sharing_info(
+            productseries, templatename)]
 
 
 def get_upstream_sharing_info(sourcepackage, templatename=None):


Follow ups