[Checkins] SVN: cc.gettext/tags/cc.gettext-0.6.1/ Tagging 0.6.1.
Nathan Yergler
nathan at yergler.net
Tue Oct 2 14:15:53 EDT 2007
Log message for revision 80515:
Tagging 0.6.1.
Changed:
A cc.gettext/tags/cc.gettext-0.6.1/
D cc.gettext/tags/cc.gettext-0.6.1/CHANGES.txt
A cc.gettext/tags/cc.gettext-0.6.1/CHANGES.txt
D cc.gettext/tags/cc.gettext-0.6.1/cc/gettext/__init__.py
A cc.gettext/tags/cc.gettext-0.6.1/cc/gettext/__init__.py
D cc.gettext/tags/cc.gettext-0.6.1/setup.py
A cc.gettext/tags/cc.gettext-0.6.1/setup.py
-=-
Copied: cc.gettext/tags/cc.gettext-0.6.1 (from rev 79135, cc.gettext/trunk)
Deleted: cc.gettext/tags/cc.gettext-0.6.1/CHANGES.txt
===================================================================
--- cc.gettext/trunk/CHANGES.txt 2007-08-22 17:41:00 UTC (rev 79135)
+++ cc.gettext/tags/cc.gettext-0.6.1/CHANGES.txt 2007-10-02 18:15:52 UTC (rev 80515)
@@ -1,14 +0,0 @@
-0.6
-===
-
-Use python-gettext instead of forking a process to run msgfmt.
-
-0.5.1
-=====
-
-Attempt to create the mo_path if it does not exist.
-
-0.5
-===
-
-Initial public release.
Copied: cc.gettext/tags/cc.gettext-0.6.1/CHANGES.txt (from rev 80514, cc.gettext/trunk/CHANGES.txt)
===================================================================
--- cc.gettext/tags/cc.gettext-0.6.1/CHANGES.txt (rev 0)
+++ cc.gettext/tags/cc.gettext-0.6.1/CHANGES.txt 2007-10-02 18:15:52 UTC (rev 80515)
@@ -0,0 +1,20 @@
+0.6.1
+===========
+
+* Fixed bug lying in wait (mis-named multiple assignment)
+* Fixed handling of PO files with leading whitespace.
+
+0.6
+===
+
+* Use python-gettext instead of forking a process to run msgfmt.
+
+0.5.1
+=====
+
+* Attempt to create the mo_path if it does not exist.
+
+0.5
+===
+
+* Initial public release.
Deleted: cc.gettext/tags/cc.gettext-0.6.1/cc/gettext/__init__.py
===================================================================
--- cc.gettext/trunk/cc/gettext/__init__.py 2007-08-22 17:41:00 UTC (rev 79135)
+++ cc.gettext/tags/cc.gettext-0.6.1/cc/gettext/__init__.py 2007-10-02 18:15:52 UTC (rev 80515)
@@ -1,123 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2006 Zope Corporation and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-##############################################################################
-"""Compile gettext catalogs from .po files.
-"""
-
-import os
-import logging
-import zc.buildout
-from pythongettext.msgfmt import Msgfmt
-
-class PoFile(object):
- """Helper class to extract metadata from a PO File."""
-
- def __init__(self, filename):
-
- self.filename = filename
- self.header = {}
-
- # read the header lines
- for line in file(self.filename,'r'):
- line = line.strip()
-
- if not(line.strip()):
- # bail when we hit the first blank
- break
-
- if line[0] == line[-1] == '"':
- # this is a metadata line
- key, value = line[1:-1].split(':', 1)
-
- self.header[key.strip().replace(r'\n', '')] = \
- value.strip().replace(r'\n','')
-
- @property
- def domain(self):
- return self.header['Domain']
-
- @property
- def language(self):
- return self.header['Language-code']
-
-class MsgFmtRecipe:
-
- def __init__(self, buildout, name, options):
-
- self.name, self.buildout, self.options = buildout, name, options
-
- # perform sanity checking on parameters
- if 'po_path' not in options:
- # no po_path provided; use our default
- options['po_path'] = os.path.join(
- buildout['buildout']['directory'], 'i18n')
- logging.getLogger(name).info(
- "No source path for .po files specified; using %s",
- options['po_path'])
- else:
- # make sure the path is absolute
- options['po_path'] = os.path.abspath(options['po_path'])
-
- if 'mo_path' not in options:
- # no mo_path provided; use our default
- options['mo_path'] = os.path.join(
- buildout['buildout']['directory'], 'locales')
- logging.getLogger(name).info(
- "No target path for .mo files specified; using %s",
- options['mo_path'])
- else:
- # make sure the path is absolute
- options['mo_path'] = os.path.abspath(options['mo_path'])
-
-
- # make sure mo_path and po_path exist
- if not(os.path.exists(options['po_path'])):
- logging.getLogger(name).error(
- "Specified po_path %s does not exist.",
- options['po_path'])
-
- raise zc.buildout.UserError("Invalid path.")
-
- if not(os.path.exists(options['mo_path'])):
- logging.getLogger(name).warn(
- "Specified mo_path %s does not exist; attempting to create.",
- options['mo_path'])
- os.makedirs(options['mo_path'])
-
- def install(self):
- """Scan the po_path for .po files and compile them using msgfmt."""
-
- paths = []
-
- for dirpath, dirname, filenames in os.walk(self.options['po_path']):
-
- for po_fn in filenames:
- if po_fn[-3:] != '.po': continue
-
- po_file = PoFile(os.path.join(dirpath, po_fn))
-
- mo_fn = os.path.join(self.options['mo_path'], po_file.language,
- 'LC_MESSAGES', '%s.mo' % po_file.domain)
- if not(os.path.exists(os.path.dirname(mo_fn))):
- os.makedirs(os.path.dirname(mo_fn))
-
- # run msgfmt for each .po file
- file(mo_fn, 'wb').write(Msgfmt(po_file.filename).get())
- paths.append(mo_fn)
-
- return paths
-
- # XXX: Update should really check timestamps or something smart like that
- update = install
-
-
Copied: cc.gettext/tags/cc.gettext-0.6.1/cc/gettext/__init__.py (from rev 80513, cc.gettext/trunk/cc/gettext/__init__.py)
===================================================================
--- cc.gettext/tags/cc.gettext-0.6.1/cc/gettext/__init__.py (rev 0)
+++ cc.gettext/tags/cc.gettext-0.6.1/cc/gettext/__init__.py 2007-10-02 18:15:52 UTC (rev 80515)
@@ -0,0 +1,132 @@
+##############################################################################
+#
+# Copyright (c) 2006 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Compile gettext catalogs from .po files.
+"""
+
+import os
+import logging
+import zc.buildout
+from pythongettext.msgfmt import Msgfmt
+
+class PoFile(object):
+ """Helper class to extract metadata from a PO File."""
+
+ def __init__(self, filename):
+
+ self.filename = filename
+ self.header = {}
+
+ # read the header lines
+ for line in file(self.filename,'r'):
+ line = line.strip()
+
+ if not(line):
+
+ if self.header != {}:
+ # bail when we hit the first blank after parsing the header
+ break
+
+ else:
+ # pass over blank lines that occur before header metadata
+ continue
+
+ if line[0] == line[-1] == '"':
+ # this is a metadata line
+ try:
+ key, value = line[1:-1].split(':', 1)
+ except ValueError:
+ continue
+
+ self.header[key.strip().replace(r'\n', '')] = \
+ value.strip().replace(r'\n','')
+
+ @property
+ def domain(self):
+ return self.header['Domain']
+
+ @property
+ def language(self):
+ return self.header['Language-code']
+
+class MsgFmtRecipe:
+
+ def __init__(self, buildout, name, options):
+
+ self.name, self.buildout, self.options = buildout, name, options
+
+ # perform sanity checking on parameters
+ if 'po_path' not in options:
+ # no po_path provided; use our default
+ options['po_path'] = os.path.join(
+ buildout['buildout']['directory'], 'i18n')
+ logging.getLogger(name).info(
+ "No source path for .po files specified; using %s",
+ options['po_path'])
+ else:
+ # make sure the path is absolute
+ options['po_path'] = os.path.abspath(options['po_path'])
+
+ if 'mo_path' not in options:
+ # no mo_path provided; use our default
+ options['mo_path'] = os.path.join(
+ buildout['buildout']['directory'], 'locales')
+ logging.getLogger(name).info(
+ "No target path for .mo files specified; using %s",
+ options['mo_path'])
+ else:
+ # make sure the path is absolute
+ options['mo_path'] = os.path.abspath(options['mo_path'])
+
+
+ # make sure mo_path and po_path exist
+ if not(os.path.exists(options['po_path'])):
+ logging.getLogger(name).error(
+ "Specified po_path %s does not exist.",
+ options['po_path'])
+
+ raise zc.buildout.UserError("Invalid path.")
+
+ if not(os.path.exists(options['mo_path'])):
+ logging.getLogger(name).warn(
+ "Specified mo_path %s does not exist; attempting to create.",
+ options['mo_path'])
+ os.makedirs(options['mo_path'])
+
+ def install(self):
+ """Scan the po_path for .po files and compile them using msgfmt."""
+
+ paths = []
+
+ for dirpath, dirname, filenames in os.walk(self.options['po_path']):
+
+ for po_fn in filenames:
+ if po_fn[-3:] != '.po': continue
+
+ po_file = PoFile(os.path.join(dirpath, po_fn))
+
+ mo_fn = os.path.join(self.options['mo_path'], po_file.language,
+ 'LC_MESSAGES', '%s.mo' % po_file.domain)
+ if not(os.path.exists(os.path.dirname(mo_fn))):
+ os.makedirs(os.path.dirname(mo_fn))
+
+ # run msgfmt for each .po file
+ file(mo_fn, 'wb').write(Msgfmt(po_file.filename).get())
+ paths.append(mo_fn)
+
+ return paths
+
+ # XXX: Update should really check timestamps or something smart like that
+ update = install
+
+
Deleted: cc.gettext/tags/cc.gettext-0.6.1/setup.py
===================================================================
--- cc.gettext/trunk/setup.py 2007-08-22 17:41:00 UTC (rev 79135)
+++ cc.gettext/tags/cc.gettext-0.6.1/setup.py 2007-10-02 18:15:52 UTC (rev 80515)
@@ -1,64 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2006 Zope Corporation and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-##############################################################################
-"""Compile gettext catalogs from .po files.
-"""
-
-import os
-from setuptools import setup, find_packages
-
-def read(*rnames):
- return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
-
-setup(
- name = "cc.gettext",
- version = "0.6",
- packages = find_packages('.'),
- namespace_packages = ['cc',],
-
- # scripts and dependencies
- install_requires = ['setuptools',
- 'zc.buildout',
- 'python-gettext',
- ],
- setup_requires=['python-gettext'],
-
- entry_points = {'zc.buildout':['msgfmt = cc.gettext:MsgFmtRecipe'],
- },
-
- # author metadata
- author = 'Nathan R. Yergler',
- author_email = 'nathan at creativecommons.org',
- description = "Recipe for manipulating gettext message catalogs.",
- long_description = (
- read('README.txt')
- + '\n' +
- read('CHANGES.txt')
- + '\n' +
- 'Download\n'
- '**********************\n'
- ),
- license = 'ZPL 2.1',
- keywords = 'development build gettext',
- url = 'http://python.org/pypi/cc.gettext/',
-
- classifiers = [
- 'Framework :: Buildout',
- 'Development Status :: 4 - Beta',
- 'Intended Audience :: Developers',
- 'License :: OSI Approved :: Zope Public License',
- 'Topic :: Software Development :: Build Tools',
- 'Topic :: Software Development :: Libraries :: Python Modules',
- ],
-
- )
Copied: cc.gettext/tags/cc.gettext-0.6.1/setup.py (from rev 80514, cc.gettext/trunk/setup.py)
===================================================================
--- cc.gettext/tags/cc.gettext-0.6.1/setup.py (rev 0)
+++ cc.gettext/tags/cc.gettext-0.6.1/setup.py 2007-10-02 18:15:52 UTC (rev 80515)
@@ -0,0 +1,63 @@
+##############################################################################
+#
+# Copyright (c) 2006 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Compile gettext catalogs from .po files.
+"""
+
+import os
+from setuptools import setup, find_packages
+
+def read(*rnames):
+ return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
+
+setup(
+ name = "cc.gettext",
+ version = "0.6.1",
+ packages = find_packages('.'),
+ namespace_packages = ['cc',],
+
+ # scripts and dependencies
+ install_requires = ['setuptools',
+ 'zc.buildout',
+ 'python-gettext',
+ ],
+
+ entry_points = {'zc.buildout':['msgfmt = cc.gettext:MsgFmtRecipe'],
+ },
+
+ # author metadata
+ author = 'Nathan R. Yergler',
+ author_email = 'nathan at creativecommons.org',
+ description = "Recipe for manipulating gettext message catalogs.",
+ long_description = (
+ read('README.txt')
+ + '\n' +
+ read('CHANGES.txt')
+ + '\n' +
+ 'Download\n'
+ '**********************\n'
+ ),
+ license = 'ZPL 2.1',
+ keywords = 'development build gettext',
+ url = 'http://python.org/pypi/cc.gettext/',
+
+ classifiers = [
+ 'Framework :: Buildout',
+ 'Development Status :: 4 - Beta',
+ 'Intended Audience :: Developers',
+ 'License :: OSI Approved :: Zope Public License',
+ 'Topic :: Software Development :: Build Tools',
+ 'Topic :: Software Development :: Libraries :: Python Modules',
+ ],
+
+ )
More information about the Checkins
mailing list