[Checkins] SVN: lovely.recipe/trunk/ - added option extract-html to
i18n recipe, i18nextract will then also parse
Juergen Kartnaller
juergen at kartnaller.at
Wed Jul 16 11:37:45 EDT 2008
Log message for revision 88404:
- added option extract-html to i18n recipe, i18nextract will then also parse
"*.html" files.
Changed:
U lovely.recipe/trunk/CHANGES.txt
U lovely.recipe/trunk/setup.py
U lovely.recipe/trunk/src/lovely/recipe/fs/README.txt
U lovely.recipe/trunk/src/lovely/recipe/i18n/i18n.py
U lovely.recipe/trunk/src/lovely/recipe/i18n/i18nextract.py
-=-
Modified: lovely.recipe/trunk/CHANGES.txt
===================================================================
--- lovely.recipe/trunk/CHANGES.txt 2008-07-16 14:42:47 UTC (rev 88403)
+++ lovely.recipe/trunk/CHANGES.txt 2008-07-16 15:37:44 UTC (rev 88404)
@@ -8,6 +8,12 @@
BIG TODO: add tests for lovely.recipe.zeo and lovely.recipe.zope to test and
to show what this all is for.
+- added option extract-html to i18n recipe, i18nextract will then also parse
+ "*.html" files.
+
+2008/06/02 0.3.1b5
+===================
+
- Re-arranged the fs recipe code to not check for directory existence during
initialisation phase.
Modified: lovely.recipe/trunk/setup.py
===================================================================
--- lovely.recipe/trunk/setup.py 2008-07-16 14:42:47 UTC (rev 88403)
+++ lovely.recipe/trunk/setup.py 2008-07-16 15:37:44 UTC (rev 88404)
@@ -29,7 +29,8 @@
'zope.app.locales',
'zc.zope3recipes',
'zc.zodbrecipes',
- 'ZConfig'
+ 'zope.app.locales>=3.4.5',
+ 'ZConfig',
],
entry_points = entry_points,
zip_safe = True,
Modified: lovely.recipe/trunk/src/lovely/recipe/fs/README.txt
===================================================================
--- lovely.recipe/trunk/src/lovely/recipe/fs/README.txt 2008-07-16 14:42:47 UTC (rev 88403)
+++ lovely.recipe/trunk/src/lovely/recipe/fs/README.txt 2008-07-16 15:37:44 UTC (rev 88404)
@@ -16,8 +16,6 @@
... path = mystuff
... """)
>>> print system(buildout),
- Getting distribution for 'ZODB3'.
- Got ZODB3 3...
Installing data-dir.
data-dir: Creating directory mystuff
Modified: lovely.recipe/trunk/src/lovely/recipe/i18n/i18n.py
===================================================================
--- lovely.recipe/trunk/src/lovely/recipe/i18n/i18n.py 2008-07-16 14:42:47 UTC (rev 88403)
+++ lovely.recipe/trunk/src/lovely/recipe/i18n/i18n.py 2008-07-16 15:37:44 UTC (rev 88404)
@@ -69,6 +69,8 @@
'-p', self.options['location'],
'-o', self.options.get('output', 'locales'),
]
+ if self.options.get('extract-html', False):
+ arguments.append('--html')
makers = [m for m in self.options.get('maker', '').split() if m!='']
for m in makers:
arguments.extend(['-m', m])
Modified: lovely.recipe/trunk/src/lovely/recipe/i18n/i18nextract.py
===================================================================
--- lovely.recipe/trunk/src/lovely/recipe/i18n/i18nextract.py 2008-07-16 14:42:47 UTC (rev 88403)
+++ lovely.recipe/trunk/src/lovely/recipe/i18n/i18nextract.py 2008-07-16 15:37:44 UTC (rev 88404)
@@ -97,7 +97,7 @@
opts, args = getopt.getopt(
argv[1:],
'hed:s:i:m:p:o:x:',
- ['help', 'domain=', 'site_zcml=', 'path=', 'python-only'])
+ ['help', 'domain=', 'site_zcml=', 'path=', 'python-only', 'html'])
except getopt.error, msg:
usage(1, msg)
@@ -107,6 +107,7 @@
output_dir = None
exclude_dirs = []
python_only = False
+ extract_html = False
site_zcml = None
makers = []
for opt, arg in opts:
@@ -126,6 +127,8 @@
exclude_dirs.append(arg)
elif opt in ('--python-only',):
python_only = True
+ elif opt in ('--html',):
+ extract_html = True
elif opt in ('-p', '--path'):
if not os.path.exists(arg):
usage(1, 'The specified path does not exist.')
@@ -158,8 +161,9 @@
"include default domain: %r\n" \
"output file: %r\n" \
"Python only: %r" \
+ "parse html files: %r" \
% (base_dir, path, site_zcml, exclude_dirs, domain,
- include_default_domain, output_file, python_only)
+ include_default_domain, output_file, python_only, extract_html)
from zope.app.locales.extract import POTMaker, \
py_strings, tal_strings, zcml_strings
@@ -170,6 +174,10 @@
maker.add(zcml_strings(path, domain, site_zcml), base_dir)
maker.add(tal_strings(path, domain, include_default_domain,
exclude=exclude_dirs), base_dir)
+ if extract_html:
+ maker.add(tal_strings(path, domain, include_default_domain,
+ exclude=exclude_dirs, filePattern='*.html'),
+ base_dir)
for m in makers:
poMaker = resolve(m)
maker.add(poMaker(path, base_dir, exclude_dirs))
More information about the Checkins
mailing list