← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~jtv/launchpad/recife-translationpolicy into lp:~launchpad/launchpad/recife

 

Jeroen T. Vermeulen has proposed merging lp:~jtv/launchpad/recife-translationpolicy into lp:~launchpad/launchpad/recife.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers): code


= Independence for ITranslationPolicy! =

The ITranslationPolicy interface in the Recife feature branch is about to grow.  It's also going to get a supporting mixin class.  But a prototype for that work introduced lots of circular imports, so first I'm moving the interface into a file of its own.  A follow-up branch will create a matching "model" file as well, containing the mix-in class.

I'll also move the TranslationPermission (and possibly other enumerations) into enum.py, but that again is best done separately and I'd want to discuss it with the team first.


Jeroen
-- 
https://code.launchpad.net/~jtv/launchpad/recife-translationpolicy/+merge/40165
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~jtv/launchpad/recife-translationpolicy into lp:~launchpad/launchpad/recife.
=== modified file 'lib/lp/registry/configure.zcml'
--- lib/lp/registry/configure.zcml	2010-10-21 03:22:06 +0000
+++ lib/lp/registry/configure.zcml	2010-11-05 08:46:48 +0000
@@ -318,13 +318,13 @@
         <allow
             interface="lp.answers.interfaces.questioncollection.IQuestionCollection"/>
         <allow
-            interface="lp.translations.interfaces.translationgroup.ITranslationPolicy"/>
+            interface="lp.translations.interfaces.translationpolicy.ITranslationPolicy"/>
         <require
             permission="launchpad.Edit"
             set_schema="lp.registry.interfaces.projectgroup.IProjectGroupPublic"/>
         <require
             permission="launchpad.TranslationsAdmin"
-            set_schema="lp.translations.interfaces.translationgroup.ITranslationPolicy"/>
+            set_schema="lp.translations.interfaces.translationpolicy.ITranslationPolicy"/>
 
         <!-- IStructuralSubscriptionTarget -->
 

=== 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-11-05 08:46:48 +0000
@@ -97,7 +97,7 @@
     Title,
     )
 from lp.soyuz.interfaces.buildrecords import IHasBuildRecords
-from lp.translations.interfaces.translationgroup import ITranslationPolicy
+from lp.translations.interfaces.translationpolicy import ITranslationPolicy
 
 
 class IDistributionMirrorMenuMarker(Interface):

=== modified file 'lib/lp/registry/interfaces/product.py'
--- lib/lp/registry/interfaces/product.py	2010-10-26 19:06:30 +0000
+++ lib/lp/registry/interfaces/product.py	2010-11-05 08:46:48 +0000
@@ -134,7 +134,7 @@
     Title,
     URIField,
     )
-from lp.translations.interfaces.translationgroup import ITranslationPolicy
+from lp.translations.interfaces.translationpolicy import ITranslationPolicy
 
 # This is based on the definition of <label> in RFC 1035, section
 # 2.3.1, which is what SourceForge project names are based on.

=== modified file 'lib/lp/registry/interfaces/projectgroup.py'
--- lib/lp/registry/interfaces/projectgroup.py	2010-10-20 14:05:26 +0000
+++ lib/lp/registry/interfaces/projectgroup.py	2010-11-05 08:46:48 +0000
@@ -88,7 +88,7 @@
     Title,
     URIField,
     )
-from lp.translations.interfaces.translationgroup import ITranslationPolicy
+from lp.translations.interfaces.translationpolicy import ITranslationPolicy
 
 
 class ProjectNameField(PillarNameField):

=== modified file 'lib/lp/translations/browser/configure.zcml'
--- lib/lp/translations/browser/configure.zcml	2010-10-06 18:53:53 +0000
+++ lib/lp/translations/browser/configure.zcml	2010-11-05 08:46:48 +0000
@@ -75,7 +75,7 @@
         template="../templates/translations-macros.pt"
         layer="lp.translations.publisher.TranslationsLayer"/>
     <browser:page
-        for="lp.translations.interfaces.translationgroup.ITranslationPolicy"
+        for="lp.translations.interfaces.translationpolicy.ITranslationPolicy"
         facet="translations"
         permission="zope.Public"
         name="+portlet-translation-groups-and-permission"
@@ -941,7 +941,7 @@
         for="lp.registry.interfaces.distribution.IDistribution"
         permission="zope.Public"
         template="../templates/translations-portlet-not-using-launchpad-extra.pt"
-        layer="lp.translations.publisher.TranslationsLayer"/> 
+        layer="lp.translations.publisher.TranslationsLayer"/>
     <browser:page
         name="+portlet-configuration"
         for="lp.registry.interfaces.distribution.IDistribution"

=== modified file 'lib/lp/translations/interfaces/translationgroup.py'
--- lib/lp/translations/interfaces/translationgroup.py	2010-09-03 06:37:26 +0000
+++ lib/lp/translations/interfaces/translationgroup.py	2010-11-05 08:46:48 +0000
@@ -8,7 +8,6 @@
 __metaclass__ = type
 
 __all__ = [
-    'ITranslationPolicy',
     'ITranslationGroup',
     'ITranslationGroupSet',
     'TranslationPermission',
@@ -23,7 +22,6 @@
     Interface,
     )
 from zope.schema import (
-    Choice,
     Datetime,
     Int,
     TextLine,
@@ -89,23 +87,6 @@
         to add suggestions.""")
 
 
-class ITranslationPolicy(Interface):
-    translationgroup = Choice(
-        title = _("Translation group"),
-        description = _("The translation group that helps review "
-            " translations for this project or distribution. The group's "
-            " role depends on the permissions policy selected below."),
-        required=False,
-        vocabulary='TranslationGroup')
-
-    translationpermission = Choice(
-        title=_("Translation permissions policy"),
-        description=_("The policy this project or distribution uses to "
-            " balance openness and control for their translations."),
-        required=True,
-        vocabulary=TranslationPermission)
-
-
 class ITranslationGroup(IHasOwner):
     """A TranslationGroup."""
 

=== added file 'lib/lp/translations/interfaces/translationpolicy.py'
--- lib/lp/translations/interfaces/translationpolicy.py	1970-01-01 00:00:00 +0000
+++ lib/lp/translations/interfaces/translationpolicy.py	2010-11-05 08:46:48 +0000
@@ -0,0 +1,32 @@
+# Copyright 2010 Canonical Ltd.  This software is licensed under the
+# GNU Affero General Public License version 3 (see the file LICENSE).
+
+"""Translation permissions policy."""
+
+__metaclass__ = type
+__all__ = [
+    'ITranslationPolicy',
+    ]
+
+from zope.interface import Interface
+from zope.schema import Choice
+
+from canonical.launchpad import _
+from lp.translations.interfaces.translationgroup import TranslationPermission
+
+
+class ITranslationPolicy(Interface):
+    translationgroup = Choice(
+        title = _("Translation group"),
+        description = _("The translation group that helps review "
+            " translations for this project or distribution. The group's "
+            " role depends on the permissions policy selected below."),
+        required=False,
+        vocabulary='TranslationGroup')
+
+    translationpermission = Choice(
+        title=_("Translation permissions policy"),
+        description=_("The policy this project or distribution uses to "
+            " balance openness and control for their translations."),
+        required=True,
+        vocabulary=TranslationPermission)