[Checkins] SVN: z3c.recipe.i18n/trunk/ - Feature: Added new 'extraPahts` option that is included in the PYTHONPATH.
Christian Zagrodnick
cz at gocept.com
Wed Dec 2 03:58:32 EST 2009
Log message for revision 106160:
- Feature: Added new 'extraPahts` option that is included in the PYTHONPATH.
This allows for instance the use with Zope 2.11.
Changed:
U z3c.recipe.i18n/trunk/CHANGES.txt
U z3c.recipe.i18n/trunk/src/z3c/recipe/i18n/README.txt
U z3c.recipe.i18n/trunk/src/z3c/recipe/i18n/i18n.py
-=-
Modified: z3c.recipe.i18n/trunk/CHANGES.txt
===================================================================
--- z3c.recipe.i18n/trunk/CHANGES.txt 2009-12-02 08:57:18 UTC (rev 106159)
+++ z3c.recipe.i18n/trunk/CHANGES.txt 2009-12-02 08:58:32 UTC (rev 106160)
@@ -8,6 +8,9 @@
- Feature: Added new 'headerTemplate' option that allows to specify the path
of a customized pot header template.
+- Feature: Added new 'extraPahts` option that is included in the PYTHONPATH.
+ This allows for instance the use with Zope 2.11.
+
- Makers are now called with additional keyword arguments.
- Fixed dependencies: The 'extract' extra of zope.app.locales is required.
Modified: z3c.recipe.i18n/trunk/src/z3c/recipe/i18n/README.txt
===================================================================
--- z3c.recipe.i18n/trunk/src/z3c/recipe/i18n/README.txt 2009-12-02 08:57:18 UTC (rev 106159)
+++ z3c.recipe.i18n/trunk/src/z3c/recipe/i18n/README.txt 2009-12-02 08:58:32 UTC (rev 106160)
@@ -75,7 +75,10 @@
exported before starting the tests. Can be used for set product
configuration enviroment.
+extraPaths
+ A new line separated list of directories which are added to the PYTHONPATH.
+
Test
****
@@ -243,6 +246,8 @@
... bar
... headerTemplate = pot_header.txt
... environment = testenv
+ ... extraPaths = extra/path/1
+ ... extra/path/2
... ''' % globals())
Now, Let's run the buildout and see what we get:
@@ -274,7 +279,9 @@
<BLANKLINE>
import sys
sys.path[0:0] = [
- ...
+ ...
+ '/sample-buildout/extra/path/1',
+ '/sample-buildout/extra/path/2',
]
<BLANKLINE>
import os
@@ -298,7 +305,9 @@
<BLANKLINE>
import sys
sys.path[0:0] = [
- ...
+ ...
+ '/sample-buildout/extra/path/1',
+ '/sample-buildout/extra/path/2',
]
<BLANKLINE>
import z3c.recipe.i18n.i18nmergeall
@@ -316,7 +325,9 @@
<BLANKLINE>
import sys
sys.path[0:0] = [
- ...
+ ...
+ '/sample-buildout/extra/path/1',
+ '/sample-buildout/extra/path/2',
]
<BLANKLINE>
import z3c.recipe.i18n.i18nstats
Modified: z3c.recipe.i18n/trunk/src/z3c/recipe/i18n/i18n.py
===================================================================
--- z3c.recipe.i18n/trunk/src/z3c/recipe/i18n/i18n.py 2009-12-02 08:57:18 UTC (rev 106159)
+++ z3c.recipe.i18n/trunk/src/z3c/recipe/i18n/i18n.py 2009-12-02 08:58:32 UTC (rev 106160)
@@ -137,13 +137,16 @@
env = self.buildout[env_section]
for key, value in env.items():
initialization += env_template % (key, value)
+ extra_paths = (
+ [this_loc] + self.options.get('extraPaths', '').split('\n'))
+ extra_paths = [p for p in extra_paths if p]
# Generate i18nextract
generated = zc.buildout.easy_install.scripts(
[('%sextract'% self.name, 'z3c.recipe.i18n.i18nextract', 'main')],
ws, self.options['executable'],
self.buildout['buildout']['bin-directory'],
- extra_paths = [this_loc],
+ extra_paths = extra_paths,
arguments = arguments,
initialization = initialization,
)
@@ -157,7 +160,7 @@
'main')],
ws, self.options['executable'],
self.buildout['buildout']['bin-directory'],
- extra_paths = [this_loc],
+ extra_paths = extra_paths,
arguments = arguments,
))
@@ -170,7 +173,7 @@
'main')],
ws, self.options['executable'],
self.buildout['buildout']['bin-directory'],
- extra_paths = [this_loc],
+ extra_paths = extra_paths,
arguments = arguments,
))
@@ -183,7 +186,7 @@
'main')],
ws, self.options['executable'],
self.buildout['buildout']['bin-directory'],
- extra_paths = [this_loc],
+ extra_paths = extra_paths,
arguments = arguments,
))
More information about the checkins
mailing list