[Zope-dev] Re: [Checkins] SVN: zope.app.locales/trunk/ added filePattern parameter for tal_strings to be able to not only parse

Benji York benji at zope.com
Wed Jul 16 11:46:26 EDT 2008


On Wed, Jul 16, 2008 at 10:41 AM, Juergen Kartnaller
<juergen at kartnaller.at> wrote:
> Log message for revision 88402:
>  added filePattern parameter for tal_strings to be able to not only parse
>  "*.pt" files.

This looks like a new feature, and as such warrants a version bump to 3.5.0.

> Changed:
>  U   zope.app.locales/trunk/CHANGES.txt
>  U   zope.app.locales/trunk/setup.py
>  U   zope.app.locales/trunk/src/zope/app/locales/extract.py
>
> -=-
> Modified: zope.app.locales/trunk/CHANGES.txt
> ===================================================================
> --- zope.app.locales/trunk/CHANGES.txt  2008-07-16 13:35:48 UTC (rev 88401)
> +++ zope.app.locales/trunk/CHANGES.txt  2008-07-16 14:40:57 UTC (rev 88402)
> @@ -2,9 +2,11 @@
>  CHANGES
>  =======
>
> -3.4.5 (unreleased)
> +3.4.5 (2008-07-16)
>  ------------------
>
> +* added filePattern parameter for tal_strings to be able to not only parse
> +  "*.pt" files.
>  * Updated Dutch translation
>
>  3.4.4 (2008-03-05)
>
> Modified: zope.app.locales/trunk/setup.py
> ===================================================================
> --- zope.app.locales/trunk/setup.py     2008-07-16 13:35:48 UTC (rev 88401)
> +++ zope.app.locales/trunk/setup.py     2008-07-16 14:40:57 UTC (rev 88402)
> @@ -22,7 +22,7 @@
>     return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
>
>  setup(name='zope.app.locales',
> -      version = '3.4.5dev',
> +      version = '3.4.5',
>       author='Zope Corporation and Contributors',
>       author_email='zope3-dev at zope.org',
>       description='Zope locale extraction and management utilities',
>
> Modified: zope.app.locales/trunk/src/zope/app/locales/extract.py
> ===================================================================
> --- zope.app.locales/trunk/src/zope/app/locales/extract.py      2008-07-16 13:35:48 UTC (rev 88401)
> +++ zope.app.locales/trunk/src/zope/app/locales/extract.py      2008-07-16 14:40:57 UTC (rev 88402)
> @@ -441,7 +441,11 @@
>     context = config(site_zcml, features=("devmode",), execute=False)
>     return context.i18n_strings.get(domain, {})
>
> -def tal_strings(dir, domain="zope", include_default_domain=False, exclude=()):
> +def tal_strings(dir,
> +                domain="zope",
> +                include_default_domain=False,
> +                exclude=(),
> +                filePattern='*.pt'):
>     """Retrieve all TAL messages from `dir` that are in the `domain`.
>
>       >>> from zope.app.locales import extract
> @@ -480,6 +484,16 @@
>       >>> extract.tal_strings(dir, domain='xml')
>       {u'Link Content': [('...xml.pt', 8)]}
>
> +    We also provide a file with a different file ending:
> +
> +      >>> testpt = open(os.path.join(dir, 'test.html'), 'w')
> +      >>> testpt.write('<tal:block i18n:domain="html" i18n:translate="">html</tal:block>')
> +      >>> testpt.close()
> +
> +      >>> extract.tal_strings(dir, domain='html', include_default_domain=True,
> +      ...                     filePattern='*.html')
> +      {'html': [('...test.html', 1)]}
> +
>     Cleanup
>
>       >>> import shutil
> @@ -497,7 +511,7 @@
>         def write(self, s):
>             pass
>
> -    for filename in find_files(dir, '*.pt', exclude=tuple(exclude)):
> +    for filename in find_files(dir, filePattern, exclude=tuple(exclude)):
>         f = file(filename,'rb')
>         start = f.read(6)
>         f.close()
>
> _______________________________________________
> Checkins mailing list
> Checkins at zope.org
> http://mail.zope.org/mailman/listinfo/checkins
>


More information about the Zope-Dev mailing list