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

Proposed by Jeroen T. Vermeulen
Status: Merged
Approved by: Jeroen T. Vermeulen
Approved revision: no longer in the source branch.
Merged at revision: 9178
Proposed branch: lp:~jtv/launchpad/recife-translationpolicy
Merge into: lp:~launchpad/launchpad/recife
Diff against target: 161 lines (+39/-26)
7 files modified
lib/lp/registry/configure.zcml (+2/-2)
lib/lp/registry/interfaces/distribution.py (+1/-1)
lib/lp/registry/interfaces/product.py (+1/-1)
lib/lp/registry/interfaces/projectgroup.py (+1/-1)
lib/lp/translations/browser/configure.zcml (+2/-2)
lib/lp/translations/interfaces/translationgroup.py (+0/-19)
lib/lp/translations/interfaces/translationpolicy.py (+32/-0)
To merge this branch: bzr merge lp:~jtv/launchpad/recife-translationpolicy
Reviewer Review Type Date Requested Status
Brad Crittenden (community) code Approve
Review via email: mp+40165@code.launchpad.net

Commit message

Independence for ITranslationPolicy.

Description of the change

= 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

To post a comment you must log in.
Revision history for this message
Brad Crittenden (bac) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/registry/configure.zcml'
2--- lib/lp/registry/configure.zcml 2010-10-21 03:22:06 +0000
3+++ lib/lp/registry/configure.zcml 2010-11-05 08:46:48 +0000
4@@ -318,13 +318,13 @@
5 <allow
6 interface="lp.answers.interfaces.questioncollection.IQuestionCollection"/>
7 <allow
8- interface="lp.translations.interfaces.translationgroup.ITranslationPolicy"/>
9+ interface="lp.translations.interfaces.translationpolicy.ITranslationPolicy"/>
10 <require
11 permission="launchpad.Edit"
12 set_schema="lp.registry.interfaces.projectgroup.IProjectGroupPublic"/>
13 <require
14 permission="launchpad.TranslationsAdmin"
15- set_schema="lp.translations.interfaces.translationgroup.ITranslationPolicy"/>
16+ set_schema="lp.translations.interfaces.translationpolicy.ITranslationPolicy"/>
17
18 <!-- IStructuralSubscriptionTarget -->
19
20
21=== modified file 'lib/lp/registry/interfaces/distribution.py'
22--- lib/lp/registry/interfaces/distribution.py 2010-10-14 17:30:10 +0000
23+++ lib/lp/registry/interfaces/distribution.py 2010-11-05 08:46:48 +0000
24@@ -97,7 +97,7 @@
25 Title,
26 )
27 from lp.soyuz.interfaces.buildrecords import IHasBuildRecords
28-from lp.translations.interfaces.translationgroup import ITranslationPolicy
29+from lp.translations.interfaces.translationpolicy import ITranslationPolicy
30
31
32 class IDistributionMirrorMenuMarker(Interface):
33
34=== modified file 'lib/lp/registry/interfaces/product.py'
35--- lib/lp/registry/interfaces/product.py 2010-10-26 19:06:30 +0000
36+++ lib/lp/registry/interfaces/product.py 2010-11-05 08:46:48 +0000
37@@ -134,7 +134,7 @@
38 Title,
39 URIField,
40 )
41-from lp.translations.interfaces.translationgroup import ITranslationPolicy
42+from lp.translations.interfaces.translationpolicy import ITranslationPolicy
43
44 # This is based on the definition of <label> in RFC 1035, section
45 # 2.3.1, which is what SourceForge project names are based on.
46
47=== modified file 'lib/lp/registry/interfaces/projectgroup.py'
48--- lib/lp/registry/interfaces/projectgroup.py 2010-10-20 14:05:26 +0000
49+++ lib/lp/registry/interfaces/projectgroup.py 2010-11-05 08:46:48 +0000
50@@ -88,7 +88,7 @@
51 Title,
52 URIField,
53 )
54-from lp.translations.interfaces.translationgroup import ITranslationPolicy
55+from lp.translations.interfaces.translationpolicy import ITranslationPolicy
56
57
58 class ProjectNameField(PillarNameField):
59
60=== modified file 'lib/lp/translations/browser/configure.zcml'
61--- lib/lp/translations/browser/configure.zcml 2010-10-06 18:53:53 +0000
62+++ lib/lp/translations/browser/configure.zcml 2010-11-05 08:46:48 +0000
63@@ -75,7 +75,7 @@
64 template="../templates/translations-macros.pt"
65 layer="lp.translations.publisher.TranslationsLayer"/>
66 <browser:page
67- for="lp.translations.interfaces.translationgroup.ITranslationPolicy"
68+ for="lp.translations.interfaces.translationpolicy.ITranslationPolicy"
69 facet="translations"
70 permission="zope.Public"
71 name="+portlet-translation-groups-and-permission"
72@@ -941,7 +941,7 @@
73 for="lp.registry.interfaces.distribution.IDistribution"
74 permission="zope.Public"
75 template="../templates/translations-portlet-not-using-launchpad-extra.pt"
76- layer="lp.translations.publisher.TranslationsLayer"/>
77+ layer="lp.translations.publisher.TranslationsLayer"/>
78 <browser:page
79 name="+portlet-configuration"
80 for="lp.registry.interfaces.distribution.IDistribution"
81
82=== modified file 'lib/lp/translations/interfaces/translationgroup.py'
83--- lib/lp/translations/interfaces/translationgroup.py 2010-09-03 06:37:26 +0000
84+++ lib/lp/translations/interfaces/translationgroup.py 2010-11-05 08:46:48 +0000
85@@ -8,7 +8,6 @@
86 __metaclass__ = type
87
88 __all__ = [
89- 'ITranslationPolicy',
90 'ITranslationGroup',
91 'ITranslationGroupSet',
92 'TranslationPermission',
93@@ -23,7 +22,6 @@
94 Interface,
95 )
96 from zope.schema import (
97- Choice,
98 Datetime,
99 Int,
100 TextLine,
101@@ -89,23 +87,6 @@
102 to add suggestions.""")
103
104
105-class ITranslationPolicy(Interface):
106- translationgroup = Choice(
107- title = _("Translation group"),
108- description = _("The translation group that helps review "
109- " translations for this project or distribution. The group's "
110- " role depends on the permissions policy selected below."),
111- required=False,
112- vocabulary='TranslationGroup')
113-
114- translationpermission = Choice(
115- title=_("Translation permissions policy"),
116- description=_("The policy this project or distribution uses to "
117- " balance openness and control for their translations."),
118- required=True,
119- vocabulary=TranslationPermission)
120-
121-
122 class ITranslationGroup(IHasOwner):
123 """A TranslationGroup."""
124
125
126=== added file 'lib/lp/translations/interfaces/translationpolicy.py'
127--- lib/lp/translations/interfaces/translationpolicy.py 1970-01-01 00:00:00 +0000
128+++ lib/lp/translations/interfaces/translationpolicy.py 2010-11-05 08:46:48 +0000
129@@ -0,0 +1,32 @@
130+# Copyright 2010 Canonical Ltd. This software is licensed under the
131+# GNU Affero General Public License version 3 (see the file LICENSE).
132+
133+"""Translation permissions policy."""
134+
135+__metaclass__ = type
136+__all__ = [
137+ 'ITranslationPolicy',
138+ ]
139+
140+from zope.interface import Interface
141+from zope.schema import Choice
142+
143+from canonical.launchpad import _
144+from lp.translations.interfaces.translationgroup import TranslationPermission
145+
146+
147+class ITranslationPolicy(Interface):
148+ translationgroup = Choice(
149+ title = _("Translation group"),
150+ description = _("The translation group that helps review "
151+ " translations for this project or distribution. The group's "
152+ " role depends on the permissions policy selected below."),
153+ required=False,
154+ vocabulary='TranslationGroup')
155+
156+ translationpermission = Choice(
157+ title=_("Translation permissions policy"),
158+ description=_("The policy this project or distribution uses to "
159+ " balance openness and control for their translations."),
160+ required=True,
161+ vocabulary=TranslationPermission)

Subscribers

People subscribed via source and target branches