[Checkins] SVN: z3ext.formatter/tags/1.4.0/ release tag
Nikolay Kim
fafhrd91 at gmail.com
Tue Aug 11 06:31:53 EDT 2009
Log message for revision 102669:
release tag
Changed:
A z3ext.formatter/tags/1.4.0/
D z3ext.formatter/tags/1.4.0/CHANGES.txt
A z3ext.formatter/tags/1.4.0/CHANGES.txt
D z3ext.formatter/tags/1.4.0/bootstrap.py
A z3ext.formatter/tags/1.4.0/bootstrap.py
D z3ext.formatter/tags/1.4.0/setup.py
A z3ext.formatter/tags/1.4.0/setup.py
D z3ext.formatter/tags/1.4.0/src/z3ext/formatter/config.py
A z3ext.formatter/tags/1.4.0/src/z3ext/formatter/config.py
D z3ext.formatter/tags/1.4.0/src/z3ext/formatter/dformatter.py
A z3ext.formatter/tags/1.4.0/src/z3ext/formatter/dformatter.py
D z3ext.formatter/tags/1.4.0/src/z3ext/formatter/dtformatter.py
A z3ext.formatter/tags/1.4.0/src/z3ext/formatter/dtformatter.py
D z3ext.formatter/tags/1.4.0/src/z3ext/formatter/expression.py
A z3ext.formatter/tags/1.4.0/src/z3ext/formatter/expression.py
D z3ext.formatter/tags/1.4.0/src/z3ext/formatter/fancydatetime.py
A z3ext.formatter/tags/1.4.0/src/z3ext/formatter/fancydatetime.py
D z3ext.formatter/tags/1.4.0/src/z3ext/formatter/humandatetime.py
A z3ext.formatter/tags/1.4.0/src/z3ext/formatter/humandatetime.py
D z3ext.formatter/tags/1.4.0/src/z3ext/formatter/interfaces.py
A z3ext.formatter/tags/1.4.0/src/z3ext/formatter/interfaces.py
D z3ext.formatter/tags/1.4.0/src/z3ext/formatter/locales/en/LC_MESSAGES/z3ext.formatter.po
A z3ext.formatter/tags/1.4.0/src/z3ext/formatter/locales/en/LC_MESSAGES/z3ext.formatter.po
D z3ext.formatter/tags/1.4.0/src/z3ext/formatter/locales/nl/LC_MESSAGES/z3ext.formatter.po
A z3ext.formatter/tags/1.4.0/src/z3ext/formatter/locales/nl/LC_MESSAGES/z3ext.formatter.po
D z3ext.formatter/tags/1.4.0/src/z3ext/formatter/locales/ru/LC_MESSAGES/z3ext.formatter.po
A z3ext.formatter/tags/1.4.0/src/z3ext/formatter/locales/ru/LC_MESSAGES/z3ext.formatter.po
D z3ext.formatter/tags/1.4.0/src/z3ext/formatter/locales/z3ext.formatter.pot
A z3ext.formatter/tags/1.4.0/src/z3ext/formatter/locales/z3ext.formatter.pot
D z3ext.formatter/tags/1.4.0/src/z3ext/formatter/tests.py
A z3ext.formatter/tags/1.4.0/src/z3ext/formatter/tests.py
D z3ext.formatter/tags/1.4.0/src/z3ext/formatter/utils.py
A z3ext.formatter/tags/1.4.0/src/z3ext/formatter/utils.py
D z3ext.formatter/tags/1.4.0/src/z3ext/formatter/vocabulary.py
A z3ext.formatter/tags/1.4.0/src/z3ext/formatter/vocabulary.py
-=-
Deleted: z3ext.formatter/tags/1.4.0/CHANGES.txt
===================================================================
--- z3ext.formatter/trunk/CHANGES.txt 2009-08-10 17:22:44 UTC (rev 102631)
+++ z3ext.formatter/tags/1.4.0/CHANGES.txt 2009-08-11 10:31:52 UTC (rev 102669)
@@ -1,99 +0,0 @@
-=======
-CHANGES
-=======
-
-1.4.0 (Unreleased)
-------------------
-
-- Predefine date,time,datetime formats, do not use locale formats
-
-
-1.3.0 (2009-07-05)
-------------------
-
-- Added chameleon support
-
-- Added 'formatter' chameleon expression
-
-
-1.2.7 (2009-04-??)
-------------------
-
-- Do not use z3c.autoinclude
-
-
-1.2.6 (2009-03-11)
-------------------
-
-- Added 'human' datetime formatter (XX minute(s) ago)
-
-- Do not show seconds for fancyDatetime fomratter
-
-- Fixed multple usage of one fancyDatetime formatter
-
-
-1.2.5 (2008-11-23)
-------------------
-
-- z3ext.controlpanel is optional
-
-- Added buildout for testing against zope3.4
-
-1.2.4 (2008-10-21)
-------------------
-
-- Fixed russian translation
-
-- nl translation updated
-
-
-1.2.3 (2008-10-20)
-------------------
-
-- Added translations: nl, ru
-
-
-1.2.2 (2008-10-10)
-------------------
-
-- Use new i18n domain z3ext.formatter
-
-
-1.2.1 (2008-05-16)
-------------------
-
-- Replace 'autoinclude' with 'includeDependendcies'
-
-
-1.2.0 (2008-03-25)
-------------------
-
-- Use z3c.autoinclude
-
-- Code moved to svn.zope.org
-
-
-1.1.2 (2008-03-06)
-------------------
-
-- Fixed bug in fancyDatetime formatter
-
-
-1.1.1 (2008-02-05)
-------------------
-
-- Added 'Timezones' vocabulary
-
-- Cleanup code
-
-
-1.1.0 (2007-12-21)
-------------------
-
-- Added controlpanel configlet
-
-
-1.0.0 (2007-12-07)
-------------------
-
-- Initial release.
Copied: z3ext.formatter/tags/1.4.0/CHANGES.txt (from rev 102668, z3ext.formatter/trunk/CHANGES.txt)
===================================================================
--- z3ext.formatter/tags/1.4.0/CHANGES.txt (rev 0)
+++ z3ext.formatter/tags/1.4.0/CHANGES.txt 2009-08-11 10:31:52 UTC (rev 102669)
@@ -0,0 +1,101 @@
+=======
+CHANGES
+=======
+
+1.4.0 (2009-08-11)
+------------------
+
+- Predefine date,time,datetime formats, do not use locale formats
+
+- Copyright holder changed
+
+
+1.3.0 (2009-07-05)
+------------------
+
+- Added chameleon support
+
+- Added 'formatter' chameleon expression
+
+
+1.2.7 (2009-04-??)
+------------------
+
+- Do not use z3c.autoinclude
+
+
+1.2.6 (2009-03-11)
+------------------
+
+- Added 'human' datetime formatter (XX minute(s) ago)
+
+- Do not show seconds for fancyDatetime fomratter
+
+- Fixed multple usage of one fancyDatetime formatter
+
+
+1.2.5 (2008-11-23)
+------------------
+
+- z3ext.controlpanel is optional
+
+- Added buildout for testing against zope3.4
+
+1.2.4 (2008-10-21)
+------------------
+
+- Fixed russian translation
+
+- nl translation updated
+
+
+1.2.3 (2008-10-20)
+------------------
+
+- Added translations: nl, ru
+
+
+1.2.2 (2008-10-10)
+------------------
+
+- Use new i18n domain z3ext.formatter
+
+
+1.2.1 (2008-05-16)
+------------------
+
+- Replace 'autoinclude' with 'includeDependendcies'
+
+
+1.2.0 (2008-03-25)
+------------------
+
+- Use z3c.autoinclude
+
+- Code moved to svn.zope.org
+
+
+1.1.2 (2008-03-06)
+------------------
+
+- Fixed bug in fancyDatetime formatter
+
+
+1.1.1 (2008-02-05)
+------------------
+
+- Added 'Timezones' vocabulary
+
+- Cleanup code
+
+
+1.1.0 (2007-12-21)
+------------------
+
+- Added controlpanel configlet
+
+
+1.0.0 (2007-12-07)
+------------------
+
+- Initial release.
Deleted: z3ext.formatter/tags/1.4.0/bootstrap.py
===================================================================
--- z3ext.formatter/trunk/bootstrap.py 2009-08-10 17:22:44 UTC (rev 102631)
+++ z3ext.formatter/tags/1.4.0/bootstrap.py 2009-08-11 10:31:52 UTC (rev 102669)
@@ -1,52 +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.
-#
-##############################################################################
-"""Bootstrap a buildout-based project
-
-Simply run this script in a directory containing a buildout.cfg.
-The script accepts buildout command-line options, so you can
-use the -c option to specify an alternate configuration file.
-
-$Id$
-"""
-
-import os, shutil, sys, tempfile, urllib2
-
-tmpeggs = tempfile.mkdtemp()
-
-ez = {}
-exec urllib2.urlopen('http://peak.telecommunity.com/dist/ez_setup.py'
- ).read() in ez
-ez['use_setuptools'](to_dir=tmpeggs, download_delay=0)
-
-import pkg_resources
-
-cmd = 'from setuptools.command.easy_install import main; main()'
-if sys.platform == 'win32':
- cmd = '"%s"' % cmd # work around spawn lamosity on windows
-
-ws = pkg_resources.working_set
-assert os.spawnle(
- os.P_WAIT, sys.executable, sys.executable,
- '-c', cmd, '-mqNxd', tmpeggs, 'zc.buildout',
- dict(os.environ,
- PYTHONPATH=
- ws.find(pkg_resources.Requirement.parse('setuptools')).location
- ),
- ) == 0
-
-ws.add_entry(tmpeggs)
-ws.require('zc.buildout')
-import zc.buildout.buildout
-zc.buildout.buildout.main(sys.argv[1:] + ['bootstrap'])
-shutil.rmtree(tmpeggs)
Copied: z3ext.formatter/tags/1.4.0/bootstrap.py (from rev 102668, z3ext.formatter/trunk/bootstrap.py)
===================================================================
--- z3ext.formatter/tags/1.4.0/bootstrap.py (rev 0)
+++ z3ext.formatter/tags/1.4.0/bootstrap.py 2009-08-11 10:31:52 UTC (rev 102669)
@@ -0,0 +1,52 @@
+##############################################################################
+#
+# Copyright (c) 2009 Zope Foundation 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.
+#
+##############################################################################
+"""Bootstrap a buildout-based project
+
+Simply run this script in a directory containing a buildout.cfg.
+The script accepts buildout command-line options, so you can
+use the -c option to specify an alternate configuration file.
+
+$Id$
+"""
+
+import os, shutil, sys, tempfile, urllib2
+
+tmpeggs = tempfile.mkdtemp()
+
+ez = {}
+exec urllib2.urlopen('http://peak.telecommunity.com/dist/ez_setup.py'
+ ).read() in ez
+ez['use_setuptools'](to_dir=tmpeggs, download_delay=0)
+
+import pkg_resources
+
+cmd = 'from setuptools.command.easy_install import main; main()'
+if sys.platform == 'win32':
+ cmd = '"%s"' % cmd # work around spawn lamosity on windows
+
+ws = pkg_resources.working_set
+assert os.spawnle(
+ os.P_WAIT, sys.executable, sys.executable,
+ '-c', cmd, '-mqNxd', tmpeggs, 'zc.buildout',
+ dict(os.environ,
+ PYTHONPATH=
+ ws.find(pkg_resources.Requirement.parse('setuptools')).location
+ ),
+ ) == 0
+
+ws.add_entry(tmpeggs)
+ws.require('zc.buildout')
+import zc.buildout.buildout
+zc.buildout.buildout.main(sys.argv[1:] + ['bootstrap'])
+shutil.rmtree(tmpeggs)
Deleted: z3ext.formatter/tags/1.4.0/setup.py
===================================================================
--- z3ext.formatter/trunk/setup.py 2009-08-10 17:22:44 UTC (rev 102631)
+++ z3ext.formatter/tags/1.4.0/setup.py 2009-08-11 10:31:52 UTC (rev 102669)
@@ -1,76 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2007 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.
-#
-##############################################################################
-"""Setup for z3ext.formatter package
-
-$Id$
-"""
-import sys, os
-from setuptools import setup, find_packages
-
-def read(*rnames):
- return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
-
-version = '1.3.1dev'
-
-
-setup(name='z3ext.formatter',
- version=version,
- description="Extensible TALES fomratter expression.",
- long_description=(
- 'Detailed Dcoumentation\n' +
- '======================\n'
- + '\n\n' +
- read('src', 'z3ext', 'formatter', 'README.txt')
- + '\n\n' +
- read('CHANGES.txt')
- ),
- classifiers=[
- 'Development Status :: 5 - Production/Stable',
- 'Environment :: Web Environment',
- 'Intended Audience :: Developers',
- 'License :: OSI Approved :: Zope Public License',
- 'Programming Language :: Python',
- 'Natural Language :: English',
- 'Operating System :: OS Independent',
- 'Topic :: Internet :: WWW/HTTP',
- 'Framework :: Zope3'],
- author='Nikolay Kim',
- author_email='fafhrd91 at gmail.com',
- url='http://z3ext.net/',
- license='ZPL 2.1',
- package_dir = {'':'src'},
- packages=find_packages('src'),
- namespace_packages=['z3ext'],
- install_requires = ['setuptools',
- 'pytz',
- 'zope.component',
- 'zope.interface',
- 'zope.publisher',
- 'zope.schema',
- 'zope.proxy',
- 'zope.tales',
- 'zope.i18n',
- 'zope.i18nmessageid',
- 'zope.app.appsetup',
- 'zope.app.pagetemplate',
- 'zope.app.publisher',
- 'z3c.pt',
- ],
- extras_require = dict(test=['zope.app.testing',
- 'zope.testing',
- 'z3ext.controlpanel [test]',
- ]),
- include_package_data = True,
- zip_safe = False
- )
Copied: z3ext.formatter/tags/1.4.0/setup.py (from rev 102668, z3ext.formatter/trunk/setup.py)
===================================================================
--- z3ext.formatter/tags/1.4.0/setup.py (rev 0)
+++ z3ext.formatter/tags/1.4.0/setup.py 2009-08-11 10:31:52 UTC (rev 102669)
@@ -0,0 +1,76 @@
+##############################################################################
+#
+# Copyright (c) 2009 Zope Foundation 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.
+#
+##############################################################################
+"""Setup for z3ext.formatter package
+
+$Id$
+"""
+import sys, os
+from setuptools import setup, find_packages
+
+def read(*rnames):
+ return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
+
+version = '1.4.0'
+
+
+setup(name='z3ext.formatter',
+ version=version,
+ description="Extensible TALES fomratter expression.",
+ long_description=(
+ 'Detailed Dcoumentation\n' +
+ '======================\n'
+ + '\n\n' +
+ read('src', 'z3ext', 'formatter', 'README.txt')
+ + '\n\n' +
+ read('CHANGES.txt')
+ ),
+ classifiers=[
+ 'Development Status :: 5 - Production/Stable',
+ 'Environment :: Web Environment',
+ 'Intended Audience :: Developers',
+ 'License :: OSI Approved :: Zope Public License',
+ 'Programming Language :: Python',
+ 'Natural Language :: English',
+ 'Operating System :: OS Independent',
+ 'Topic :: Internet :: WWW/HTTP',
+ 'Framework :: Zope3'],
+ author='Nikolay Kim',
+ author_email='fafhrd91 at gmail.com',
+ url='http://z3ext.net/',
+ license='ZPL 2.1',
+ package_dir = {'':'src'},
+ packages=find_packages('src'),
+ namespace_packages=['z3ext'],
+ install_requires = ['setuptools',
+ 'pytz',
+ 'zope.component',
+ 'zope.interface',
+ 'zope.publisher',
+ 'zope.schema',
+ 'zope.proxy',
+ 'zope.tales',
+ 'zope.i18n',
+ 'zope.i18nmessageid',
+ 'zope.app.appsetup',
+ 'zope.app.pagetemplate',
+ 'zope.app.publisher',
+ 'z3c.pt',
+ ],
+ extras_require = dict(test=['zope.app.testing',
+ 'zope.testing',
+ 'z3ext.controlpanel [test]',
+ ]),
+ include_package_data = True,
+ zip_safe = False
+ )
Deleted: z3ext.formatter/tags/1.4.0/src/z3ext/formatter/config.py
===================================================================
--- z3ext.formatter/trunk/src/z3ext/formatter/config.py 2009-08-10 17:22:44 UTC (rev 102631)
+++ z3ext.formatter/tags/1.4.0/src/z3ext/formatter/config.py 2009-08-11 10:31:52 UTC (rev 102669)
@@ -1,42 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2007 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.
-#
-##############################################################################
-""" default IFormatterConfiglet utility
-
-$Id$
-"""
-
-from zope import interface, component
-from zope.component import getGlobalSiteManager
-from zope.app.appsetup.product import getProductConfiguration
-from zope.app.appsetup.interfaces import IDatabaseOpenedEvent
-
-import vocabulary
-from interfaces import IFormatterConfiglet
-
-
- at component.adapter(IDatabaseOpenedEvent)
-def initFormatter(event):
- config = getProductConfiguration('z3ext.formatter')
- if config is None:
- config = {}
-
- sm = getGlobalSiteManager()
-
- try:
- timezone = vocabulary.timezones.getTermByToken(
- config.get('timezone', u'US/Pacific')).value
- except LookupError:
- timezone = u'US/Pacific'
-
- IFormatterConfiglet['timezone'].default = timezone
Copied: z3ext.formatter/tags/1.4.0/src/z3ext/formatter/config.py (from rev 102668, z3ext.formatter/trunk/src/z3ext/formatter/config.py)
===================================================================
--- z3ext.formatter/tags/1.4.0/src/z3ext/formatter/config.py (rev 0)
+++ z3ext.formatter/tags/1.4.0/src/z3ext/formatter/config.py 2009-08-11 10:31:52 UTC (rev 102669)
@@ -0,0 +1,42 @@
+##############################################################################
+#
+# Copyright (c) 2009 Zope Foundation 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.
+#
+##############################################################################
+""" default IFormatterConfiglet utility
+
+$Id$
+"""
+
+from zope import interface, component
+from zope.component import getGlobalSiteManager
+from zope.app.appsetup.product import getProductConfiguration
+from zope.app.appsetup.interfaces import IDatabaseOpenedEvent
+
+import vocabulary
+from interfaces import IFormatterConfiglet
+
+
+ at component.adapter(IDatabaseOpenedEvent)
+def initFormatter(event):
+ config = getProductConfiguration('z3ext.formatter')
+ if config is None:
+ config = {}
+
+ sm = getGlobalSiteManager()
+
+ try:
+ timezone = vocabulary.timezones.getTermByToken(
+ config.get('timezone', u'US/Pacific')).value
+ except LookupError:
+ timezone = u'US/Pacific'
+
+ IFormatterConfiglet['timezone'].default = timezone
Deleted: z3ext.formatter/tags/1.4.0/src/z3ext/formatter/dformatter.py
===================================================================
--- z3ext.formatter/trunk/src/z3ext/formatter/dformatter.py 2009-08-10 17:22:44 UTC (rev 102631)
+++ z3ext.formatter/tags/1.4.0/src/z3ext/formatter/dformatter.py 2009-08-11 10:31:52 UTC (rev 102669)
@@ -1,52 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2007 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.
-#
-##############################################################################
-""" ``date`` formatter implementation
-Author: Nikolay Kim <fafhrd91 at gmail.com>
-
-$Id$
-"""
-from datetime import date
-from zope import interface, component
-from zope.component import getUtility
-from zope.publisher.interfaces.http import IHTTPRequest
-
-from interfaces import IFormatter, IFormatterFactory, IFormatterConfiglet
-
-
-class DateFormatter(object):
- interface.implements(IFormatter)
-
- def __init__(self, request, *args):
- try:
- self.tp = args[0]
- except:
- self.tp = 'medium'
-
- def format(self, value):
- if not isinstance(value, date):
- return value
-
- configlet = getUtility(IFormatterConfiglet)
- return value.strftime(str(getattr(configlet, 'date_'+self.tp)))
-
-
-class DateFormatterFactory(object):
- component.adapts(IHTTPRequest)
- interface.implements(IFormatterFactory)
-
- def __init__(self, request):
- self.request = request
-
- def __call__(self, *args, **kw):
- return DateFormatter(self.request, *args)
Copied: z3ext.formatter/tags/1.4.0/src/z3ext/formatter/dformatter.py (from rev 102668, z3ext.formatter/trunk/src/z3ext/formatter/dformatter.py)
===================================================================
--- z3ext.formatter/tags/1.4.0/src/z3ext/formatter/dformatter.py (rev 0)
+++ z3ext.formatter/tags/1.4.0/src/z3ext/formatter/dformatter.py 2009-08-11 10:31:52 UTC (rev 102669)
@@ -0,0 +1,52 @@
+##############################################################################
+#
+# Copyright (c) 2009 Zope Foundation 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.
+#
+##############################################################################
+""" ``date`` formatter implementation
+Author: Nikolay Kim <fafhrd91 at gmail.com>
+
+$Id$
+"""
+from datetime import date
+from zope import interface, component
+from zope.component import getUtility
+from zope.publisher.interfaces.http import IHTTPRequest
+
+from interfaces import IFormatter, IFormatterFactory, IFormatterConfiglet
+
+
+class DateFormatter(object):
+ interface.implements(IFormatter)
+
+ def __init__(self, request, *args):
+ try:
+ self.tp = args[0]
+ except:
+ self.tp = 'medium'
+
+ def format(self, value):
+ if not isinstance(value, date):
+ return value
+
+ configlet = getUtility(IFormatterConfiglet)
+ return value.strftime(str(getattr(configlet, 'date_'+self.tp)))
+
+
+class DateFormatterFactory(object):
+ component.adapts(IHTTPRequest)
+ interface.implements(IFormatterFactory)
+
+ def __init__(self, request):
+ self.request = request
+
+ def __call__(self, *args, **kw):
+ return DateFormatter(self.request, *args)
Deleted: z3ext.formatter/tags/1.4.0/src/z3ext/formatter/dtformatter.py
===================================================================
--- z3ext.formatter/trunk/src/z3ext/formatter/dtformatter.py 2009-08-10 17:22:44 UTC (rev 102631)
+++ z3ext.formatter/tags/1.4.0/src/z3ext/formatter/dtformatter.py 2009-08-11 10:31:52 UTC (rev 102669)
@@ -1,67 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2007 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.
-#
-##############################################################################
-""" ``dateTime`` formatter implementation
-Author: Nikolay Kim <fafhrd91 at gmail.com>
-
-$Id$
-"""
-from pytz import timezone
-from datetime import datetime
-
-from zope import interface, component
-from zope.component import getUtility
-from zope.interface.common.idatetime import ITZInfo
-from zope.publisher.interfaces.http import IHTTPRequest
-
-from interfaces import IFormatter, IFormatterFactory, IFormatterConfiglet
-
-
-class DatetimeFormatter(object):
- interface.implements(IFormatter)
-
- def __init__(self, request, *args):
- try:
- self.tp = args[0]
- except:
- self.tp = 'medium'
-
- def format(self, value):
- if not isinstance(value, datetime):
- return value
-
- configlet = getUtility(IFormatterConfiglet)
-
- tz = timezone(configlet.timezone)
- if value.tzinfo is None:
- value = datetime(value.year, value.month, value.day, value.hour,
- value.minute, value.second, value.microsecond, tz)
-
- value = value.astimezone(tz)
-
- format = '%s %s'%(
- getattr(configlet, 'date_'+self.tp),
- getattr(configlet, 'time_'+self.tp))
-
- return unicode(value.strftime(str(format)))
-
-
-class DatetimeFormatterFactory(object):
- component.adapts(IHTTPRequest)
- interface.implements(IFormatterFactory)
-
- def __init__(self, request):
- self.request = request
-
- def __call__(self, *args, **kw):
- return DatetimeFormatter(self.request, *args)
Copied: z3ext.formatter/tags/1.4.0/src/z3ext/formatter/dtformatter.py (from rev 102668, z3ext.formatter/trunk/src/z3ext/formatter/dtformatter.py)
===================================================================
--- z3ext.formatter/tags/1.4.0/src/z3ext/formatter/dtformatter.py (rev 0)
+++ z3ext.formatter/tags/1.4.0/src/z3ext/formatter/dtformatter.py 2009-08-11 10:31:52 UTC (rev 102669)
@@ -0,0 +1,67 @@
+##############################################################################
+#
+# Copyright (c) 2009 Zope Foundation 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.
+#
+##############################################################################
+""" ``dateTime`` formatter implementation
+Author: Nikolay Kim <fafhrd91 at gmail.com>
+
+$Id$
+"""
+from pytz import timezone
+from datetime import datetime
+
+from zope import interface, component
+from zope.component import getUtility
+from zope.interface.common.idatetime import ITZInfo
+from zope.publisher.interfaces.http import IHTTPRequest
+
+from interfaces import IFormatter, IFormatterFactory, IFormatterConfiglet
+
+
+class DatetimeFormatter(object):
+ interface.implements(IFormatter)
+
+ def __init__(self, request, *args):
+ try:
+ self.tp = args[0]
+ except:
+ self.tp = 'medium'
+
+ def format(self, value):
+ if not isinstance(value, datetime):
+ return value
+
+ configlet = getUtility(IFormatterConfiglet)
+
+ tz = timezone(configlet.timezone)
+ if value.tzinfo is None:
+ value = datetime(value.year, value.month, value.day, value.hour,
+ value.minute, value.second, value.microsecond, tz)
+
+ value = value.astimezone(tz)
+
+ format = '%s %s'%(
+ getattr(configlet, 'date_'+self.tp),
+ getattr(configlet, 'time_'+self.tp))
+
+ return unicode(value.strftime(str(format)))
+
+
+class DatetimeFormatterFactory(object):
+ component.adapts(IHTTPRequest)
+ interface.implements(IFormatterFactory)
+
+ def __init__(self, request):
+ self.request = request
+
+ def __call__(self, *args, **kw):
+ return DatetimeFormatter(self.request, *args)
Deleted: z3ext.formatter/tags/1.4.0/src/z3ext/formatter/expression.py
===================================================================
--- z3ext.formatter/trunk/src/z3ext/formatter/expression.py 2009-08-10 17:22:44 UTC (rev 102631)
+++ z3ext.formatter/tags/1.4.0/src/z3ext/formatter/expression.py 2009-08-11 10:31:52 UTC (rev 102669)
@@ -1,57 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2007 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.
-#
-##############################################################################
-""" ``formatter`` TALES expression
-Author: Nikolay Kim <fafhrd91 at gmail.com>
-
-$Id$
-"""
-from zope.component import queryAdapter
-from zope.proxy import removeAllProxies
-from zope.tales.expressions import PathExpr, simpleTraverse
-
-from interfaces import IFormatterFactory
-from interfaces import FormatterNotDefined, FormatterExpressionError
-
-
-class FormatterExpression(PathExpr):
- """ formatter sytax:
- formatter:<formatterName>,<formatterVar1>,<formatterVar2>,...:pathExpr """
-
- def __init__(self, name, expr, engine, traverser=simpleTraverse):
- parts = expr.split(':', 1)
- try:
- formatterName, pathExpr = parts[0], parts[1]
- except IndexError:
- raise FormatterExpressionError(expr)
-
- args = formatterName.split(',')
- self.formatterName = args[0]
- self.formatterArgs = args[1:]
-
- super(FormatterExpression, self).__init__(
- name, pathExpr, engine, traverser=simpleTraverse)
-
- def __call__(self, econtext):
- request = removeAllProxies(econtext.request)
-
- factory = queryAdapter(
- request, IFormatterFactory, name=self.formatterName)
-
- if factory is None:
- raise FormatterNotDefined(self.formatterName)
-
- formatter = factory(*self.formatterArgs)
-
- value = super(FormatterExpression, self).__call__(econtext)
- return formatter.format(value)
Copied: z3ext.formatter/tags/1.4.0/src/z3ext/formatter/expression.py (from rev 102668, z3ext.formatter/trunk/src/z3ext/formatter/expression.py)
===================================================================
--- z3ext.formatter/tags/1.4.0/src/z3ext/formatter/expression.py (rev 0)
+++ z3ext.formatter/tags/1.4.0/src/z3ext/formatter/expression.py 2009-08-11 10:31:52 UTC (rev 102669)
@@ -0,0 +1,57 @@
+##############################################################################
+#
+# Copyright (c) 2009 Zope Foundation 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.
+#
+##############################################################################
+""" ``formatter`` TALES expression
+Author: Nikolay Kim <fafhrd91 at gmail.com>
+
+$Id$
+"""
+from zope.component import queryAdapter
+from zope.proxy import removeAllProxies
+from zope.tales.expressions import PathExpr, simpleTraverse
+
+from interfaces import IFormatterFactory
+from interfaces import FormatterNotDefined, FormatterExpressionError
+
+
+class FormatterExpression(PathExpr):
+ """ formatter sytax:
+ formatter:<formatterName>,<formatterVar1>,<formatterVar2>,...:pathExpr """
+
+ def __init__(self, name, expr, engine, traverser=simpleTraverse):
+ parts = expr.split(':', 1)
+ try:
+ formatterName, pathExpr = parts[0], parts[1]
+ except IndexError:
+ raise FormatterExpressionError(expr)
+
+ args = formatterName.split(',')
+ self.formatterName = args[0]
+ self.formatterArgs = args[1:]
+
+ super(FormatterExpression, self).__init__(
+ name, pathExpr, engine, traverser=simpleTraverse)
+
+ def __call__(self, econtext):
+ request = removeAllProxies(econtext.request)
+
+ factory = queryAdapter(
+ request, IFormatterFactory, name=self.formatterName)
+
+ if factory is None:
+ raise FormatterNotDefined(self.formatterName)
+
+ formatter = factory(*self.formatterArgs)
+
+ value = super(FormatterExpression, self).__call__(econtext)
+ return formatter.format(value)
Deleted: z3ext.formatter/tags/1.4.0/src/z3ext/formatter/fancydatetime.py
===================================================================
--- z3ext.formatter/trunk/src/z3ext/formatter/fancydatetime.py 2009-08-10 17:22:44 UTC (rev 102631)
+++ z3ext.formatter/tags/1.4.0/src/z3ext/formatter/fancydatetime.py 2009-08-11 10:31:52 UTC (rev 102669)
@@ -1,91 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2007 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.
-#
-##############################################################################
-""" ``fancyDatetime`` formatter implementation
-
-$Id$
-"""
-
-from pytz import utc, timezone
-from datetime import datetime
-from zope import interface, component
-from zope.i18n import translate
-from zope.component import getUtility
-from zope.publisher.interfaces.http import IHTTPRequest
-
-from interfaces import IFormatter, IFormatterFactory, IFormatterConfiglet
-
-
-class FancyDatetimeFormatter(object):
- interface.implements(IFormatter)
-
- def __init__(self, request, *args):
- try:
- self.tp = args[0]
- except:
- self.tp = 'medium'
-
- self.request = request
- self.formatter = request.locale.dates.getFormatter('dateTime', self.tp)
-
- def format(self, value):
- if not isinstance(value, datetime):
- return value
-
- configlet = getUtility(IFormatterConfiglet)
-
- tz = timezone(configlet.timezone)
-
- if value.tzinfo is None:
- value = datetime(value.year, value.month, value.day, value.hour,
- value.minute, value.second, value.microsecond, tz)
-
- value = value.astimezone(tz)
-
- d1 = datetime.now(utc).date()
- d2 = value.astimezone(utc).date()
-
- delta = d1 - d2
-
- if delta.days == 0:
- format = str(getattr(configlet, 'time_'+self.tp))
-
- value = translate(
- u'Today at ${value}', 'z3ext.formatter',
- mapping={'value': value.strftime(format)})
- return value
-
- if delta.days == 1:
- format = str(getattr(configlet, 'time_'+self.tp))
-
- value = translate(
- u'Yesterday at ${value}', 'z3ext.formatter',
- mapping={'value': value.strftime(format)})
- return value
-
- format = '%s %s'%(
- getattr(configlet, 'date_'+self.tp),
- getattr(configlet, 'time_'+self.tp))
-
- return unicode(value.strftime(str(format)))
-
-
-class FancyDatetimeFormatterFactory(object):
- component.adapts(IHTTPRequest)
- interface.implements(IFormatterFactory)
-
- def __init__(self, request):
- self.request = request
-
- def __call__(self, *args, **kw):
- return FancyDatetimeFormatter(self.request, *args)
Copied: z3ext.formatter/tags/1.4.0/src/z3ext/formatter/fancydatetime.py (from rev 102668, z3ext.formatter/trunk/src/z3ext/formatter/fancydatetime.py)
===================================================================
--- z3ext.formatter/tags/1.4.0/src/z3ext/formatter/fancydatetime.py (rev 0)
+++ z3ext.formatter/tags/1.4.0/src/z3ext/formatter/fancydatetime.py 2009-08-11 10:31:52 UTC (rev 102669)
@@ -0,0 +1,91 @@
+##############################################################################
+#
+# Copyright (c) 2009 Zope Foundation 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.
+#
+##############################################################################
+""" ``fancyDatetime`` formatter implementation
+
+$Id$
+"""
+
+from pytz import utc, timezone
+from datetime import datetime
+from zope import interface, component
+from zope.i18n import translate
+from zope.component import getUtility
+from zope.publisher.interfaces.http import IHTTPRequest
+
+from interfaces import IFormatter, IFormatterFactory, IFormatterConfiglet
+
+
+class FancyDatetimeFormatter(object):
+ interface.implements(IFormatter)
+
+ def __init__(self, request, *args):
+ try:
+ self.tp = args[0]
+ except:
+ self.tp = 'medium'
+
+ self.request = request
+ self.formatter = request.locale.dates.getFormatter('dateTime', self.tp)
+
+ def format(self, value):
+ if not isinstance(value, datetime):
+ return value
+
+ configlet = getUtility(IFormatterConfiglet)
+
+ tz = timezone(configlet.timezone)
+
+ if value.tzinfo is None:
+ value = datetime(value.year, value.month, value.day, value.hour,
+ value.minute, value.second, value.microsecond, tz)
+
+ value = value.astimezone(tz)
+
+ d1 = datetime.now(utc).date()
+ d2 = value.astimezone(utc).date()
+
+ delta = d1 - d2
+
+ if delta.days == 0:
+ format = str(getattr(configlet, 'time_'+self.tp))
+
+ value = translate(
+ u'Today at ${value}', 'z3ext.formatter',
+ mapping={'value': value.strftime(format)})
+ return value
+
+ if delta.days == 1:
+ format = str(getattr(configlet, 'time_'+self.tp))
+
+ value = translate(
+ u'Yesterday at ${value}', 'z3ext.formatter',
+ mapping={'value': value.strftime(format)})
+ return value
+
+ format = '%s %s'%(
+ getattr(configlet, 'date_'+self.tp),
+ getattr(configlet, 'time_'+self.tp))
+
+ return unicode(value.strftime(str(format)))
+
+
+class FancyDatetimeFormatterFactory(object):
+ component.adapts(IHTTPRequest)
+ interface.implements(IFormatterFactory)
+
+ def __init__(self, request):
+ self.request = request
+
+ def __call__(self, *args, **kw):
+ return FancyDatetimeFormatter(self.request, *args)
Deleted: z3ext.formatter/tags/1.4.0/src/z3ext/formatter/humandatetime.py
===================================================================
--- z3ext.formatter/trunk/src/z3ext/formatter/humandatetime.py 2009-08-10 17:22:44 UTC (rev 102631)
+++ z3ext.formatter/tags/1.4.0/src/z3ext/formatter/humandatetime.py 2009-08-11 10:31:52 UTC (rev 102669)
@@ -1,90 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2007 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.
-#
-##############################################################################
-""" ``humanDatetime`` formatter implementation
-
-$Id$
-"""
-from pytz import utc, timezone
-from datetime import datetime
-from zope import interface, component
-from zope.i18n import translate
-from zope.component import getUtility
-from zope.publisher.interfaces.http import IHTTPRequest
-
-from interfaces import IFormatter, IFormatterFactory, IFormatterConfiglet
-
-
-class HumanDatetimeFormatter(object):
- interface.implements(IFormatter)
-
- def __init__(self, request, *args):
- self.request = request
-
- def format(self, value):
- configlet = getUtility(IFormatterConfiglet)
- tz = timezone(configlet.timezone)
-
- if value.tzinfo is None:
- value = datetime(value.year, value.month, value.day, value.hour,
- value.minute, value.second, value.microsecond, tz)
-
- value = value.astimezone(tz)
-
- d1 = datetime.now(utc)
- d2 = value.astimezone(utc)
-
- delta = d1 - d2
-
- years, months, weeks, hours, minutes = (
- delta.days/365, delta.days/30, delta.days/7,
- delta.seconds/3600, delta.seconds/60)
-
- if years > 0:
- return translate(
- u'${value} year(s) ago', 'z3ext.formatter',
- mapping={'value': years})
-
- if months > 0:
- return translate(u'${value} month(s) ago', 'z3ext.formatter',
- mapping={'value': months})
-
- if weeks > 0:
- return translate(u'${value} week(s) ago', 'z3ext.formatter',
- mapping={'value': weeks})
-
- if delta.days > 0:
- return translate(u'${value} day(s) ago', 'z3ext.formatter',
- mapping={'value': delta.days})
-
- if hours > 0:
- return translate(u'${value} hour(s) ago', 'z3ext.formatter',
- mapping={'value': hours})
-
- if minutes > 0:
- return translate(u'${value} minute(s) ago', 'z3ext.formatter',
- mapping={'value': minutes})
-
- return translate(u'${value} second(s) ago', 'z3ext.formatter',
- mapping={'value': delta.seconds})
-
-
-class HumanDatetimeFormatterFactory(object):
- component.adapts(IHTTPRequest)
- interface.implements(IFormatterFactory)
-
- def __init__(self, request):
- self.request = request
-
- def __call__(self, *args, **kw):
- return HumanDatetimeFormatter(self.request, *args)
Copied: z3ext.formatter/tags/1.4.0/src/z3ext/formatter/humandatetime.py (from rev 102668, z3ext.formatter/trunk/src/z3ext/formatter/humandatetime.py)
===================================================================
--- z3ext.formatter/tags/1.4.0/src/z3ext/formatter/humandatetime.py (rev 0)
+++ z3ext.formatter/tags/1.4.0/src/z3ext/formatter/humandatetime.py 2009-08-11 10:31:52 UTC (rev 102669)
@@ -0,0 +1,90 @@
+##############################################################################
+#
+# Copyright (c) 2009 Zope Foundation 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.
+#
+##############################################################################
+""" ``humanDatetime`` formatter implementation
+
+$Id$
+"""
+from pytz import utc, timezone
+from datetime import datetime
+from zope import interface, component
+from zope.i18n import translate
+from zope.component import getUtility
+from zope.publisher.interfaces.http import IHTTPRequest
+
+from interfaces import IFormatter, IFormatterFactory, IFormatterConfiglet
+
+
+class HumanDatetimeFormatter(object):
+ interface.implements(IFormatter)
+
+ def __init__(self, request, *args):
+ self.request = request
+
+ def format(self, value):
+ configlet = getUtility(IFormatterConfiglet)
+ tz = timezone(configlet.timezone)
+
+ if value.tzinfo is None:
+ value = datetime(value.year, value.month, value.day, value.hour,
+ value.minute, value.second, value.microsecond, tz)
+
+ value = value.astimezone(tz)
+
+ d1 = datetime.now(utc)
+ d2 = value.astimezone(utc)
+
+ delta = d1 - d2
+
+ years, months, weeks, hours, minutes = (
+ delta.days/365, delta.days/30, delta.days/7,
+ delta.seconds/3600, delta.seconds/60)
+
+ if years > 0:
+ return translate(
+ u'${value} year(s) ago', 'z3ext.formatter',
+ mapping={'value': years})
+
+ if months > 0:
+ return translate(u'${value} month(s) ago', 'z3ext.formatter',
+ mapping={'value': months})
+
+ if weeks > 0:
+ return translate(u'${value} week(s) ago', 'z3ext.formatter',
+ mapping={'value': weeks})
+
+ if delta.days > 0:
+ return translate(u'${value} day(s) ago', 'z3ext.formatter',
+ mapping={'value': delta.days})
+
+ if hours > 0:
+ return translate(u'${value} hour(s) ago', 'z3ext.formatter',
+ mapping={'value': hours})
+
+ if minutes > 0:
+ return translate(u'${value} minute(s) ago', 'z3ext.formatter',
+ mapping={'value': minutes})
+
+ return translate(u'${value} second(s) ago', 'z3ext.formatter',
+ mapping={'value': delta.seconds})
+
+
+class HumanDatetimeFormatterFactory(object):
+ component.adapts(IHTTPRequest)
+ interface.implements(IFormatterFactory)
+
+ def __init__(self, request):
+ self.request = request
+
+ def __call__(self, *args, **kw):
+ return HumanDatetimeFormatter(self.request, *args)
Deleted: z3ext.formatter/tags/1.4.0/src/z3ext/formatter/interfaces.py
===================================================================
--- z3ext.formatter/trunk/src/z3ext/formatter/interfaces.py 2009-08-10 17:22:44 UTC (rev 102631)
+++ z3ext.formatter/tags/1.4.0/src/z3ext/formatter/interfaces.py 2009-08-11 10:31:52 UTC (rev 102669)
@@ -1,105 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2007 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.
-#
-##############################################################################
-""" z3ext.formatter interfaces
-
-$Id$
-"""
-import vocabulary
-from zope import schema, interface
-from zope.i18nmessageid import MessageFactory
-
-_ = MessageFactory('z3ext.formatter')
-
-
-class FormatterNotDefined(Exception):
- """ """
-
-
-class FormatterExpressionError(Exception):
- """ """
-
-
-class IFormatterConfiglet(interface.Interface):
- """ formatter configlet schema """
-
- date_short = schema.TextLine(
- title = _(u'Short date format'),
- default = u'%m/%d/%y',
- required = True)
-
- date_medium = schema.TextLine(
- title = _(u'Medium date format'),
- default = u'%b %d, %Y',
- required = True)
-
- date_long = schema.TextLine(
- title = _(u'Long date format'),
- default = u'%B %d, %Y',
- required = True)
-
- date_full = schema.TextLine(
- title = _(u'Full date format'),
- default = u'%A, %B %d, %Y',
- required = True)
-
- time_short = schema.TextLine(
- title = _(u'Short time format'),
- default = u'%I:%M %p',
- required = True)
-
- time_medium = schema.TextLine(
- title = _(u'Medium time format'),
- default = u'%I:%M:%S %p',
- required = True)
-
- time_long = schema.TextLine(
- title = _(u'Long time format'),
- default = u'%I:%M:%S %p %z',
- required = True)
-
- time_full = schema.TextLine(
- title = _(u'Full time format'),
- default = u'%I:%M:%S %p %Z',
- required = True)
-
- timezone = schema.Choice(
- title = _(u'Timezone'),
- description = _(u'Portal timezone.'),
- default = 'US/Pacific',
- vocabulary = vocabulary.timezones,
- required = False)
-
- #principalTimezone = schema.Bool(
- # title = _(u'Use principal timezone'),
- # description = _(u'Render datetime with user selected timezone.'),
- # default = True,
- # required = False)
-
-
-class IFormatterFactory(interface.Interface):
- """ formatter factory """
-
- def __call__(*args):
- """ create formatter """
-
-
-class IFormatter(interface.Interface):
- """ locale formatter """
-
- def format(value):
- """ format value """
-
-
-class IStaticFormatter(interface.Interface):
- """ """
Copied: z3ext.formatter/tags/1.4.0/src/z3ext/formatter/interfaces.py (from rev 102668, z3ext.formatter/trunk/src/z3ext/formatter/interfaces.py)
===================================================================
--- z3ext.formatter/tags/1.4.0/src/z3ext/formatter/interfaces.py (rev 0)
+++ z3ext.formatter/tags/1.4.0/src/z3ext/formatter/interfaces.py 2009-08-11 10:31:52 UTC (rev 102669)
@@ -0,0 +1,105 @@
+##############################################################################
+#
+# Copyright (c) 2009 Zope Foundation 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.
+#
+##############################################################################
+""" z3ext.formatter interfaces
+
+$Id$
+"""
+import vocabulary
+from zope import schema, interface
+from zope.i18nmessageid import MessageFactory
+
+_ = MessageFactory('z3ext.formatter')
+
+
+class FormatterNotDefined(Exception):
+ """ """
+
+
+class FormatterExpressionError(Exception):
+ """ """
+
+
+class IFormatterConfiglet(interface.Interface):
+ """ formatter configlet schema """
+
+ date_short = schema.TextLine(
+ title = _(u'Short date format'),
+ default = u'%m/%d/%y',
+ required = True)
+
+ date_medium = schema.TextLine(
+ title = _(u'Medium date format'),
+ default = u'%b %d, %Y',
+ required = True)
+
+ date_long = schema.TextLine(
+ title = _(u'Long date format'),
+ default = u'%B %d, %Y',
+ required = True)
+
+ date_full = schema.TextLine(
+ title = _(u'Full date format'),
+ default = u'%A, %B %d, %Y',
+ required = True)
+
+ time_short = schema.TextLine(
+ title = _(u'Short time format'),
+ default = u'%I:%M %p',
+ required = True)
+
+ time_medium = schema.TextLine(
+ title = _(u'Medium time format'),
+ default = u'%I:%M:%S %p',
+ required = True)
+
+ time_long = schema.TextLine(
+ title = _(u'Long time format'),
+ default = u'%I:%M:%S %p %z',
+ required = True)
+
+ time_full = schema.TextLine(
+ title = _(u'Full time format'),
+ default = u'%I:%M:%S %p %Z',
+ required = True)
+
+ timezone = schema.Choice(
+ title = _(u'Timezone'),
+ description = _(u'Portal timezone.'),
+ default = 'US/Pacific',
+ vocabulary = vocabulary.timezones,
+ required = False)
+
+ #principalTimezone = schema.Bool(
+ # title = _(u'Use principal timezone'),
+ # description = _(u'Render datetime with user selected timezone.'),
+ # default = True,
+ # required = False)
+
+
+class IFormatterFactory(interface.Interface):
+ """ formatter factory """
+
+ def __call__(*args):
+ """ create formatter """
+
+
+class IFormatter(interface.Interface):
+ """ locale formatter """
+
+ def format(value):
+ """ format value """
+
+
+class IStaticFormatter(interface.Interface):
+ """ """
Deleted: z3ext.formatter/tags/1.4.0/src/z3ext/formatter/locales/en/LC_MESSAGES/z3ext.formatter.po
===================================================================
--- z3ext.formatter/trunk/src/z3ext/formatter/locales/en/LC_MESSAGES/z3ext.formatter.po 2009-08-10 17:22:44 UTC (rev 102631)
+++ z3ext.formatter/tags/1.4.0/src/z3ext/formatter/locales/en/LC_MESSAGES/z3ext.formatter.po 2009-08-11 10:31:52 UTC (rev 102669)
@@ -1,74 +0,0 @@
-###############################################################################
-#
-# Copyright (c) 2003-2004 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.
-#
-# #############################################################################
-msgid ""
-msgstr ""
-"Project-Id-Version: Development/Unknown\n"
-"POT-Creation-Date: Mon Oct 20 22:53:40 2008\n"
-"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
-"Last-Translator: FULL NAME <EMAIL at ADDRESS>\n"
-"Language-Team: Zope 3 Developers <zope3-dev at zope.org>\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Generated-By: zope/app/locales/extract.py\n"
-
-#: src/z3ext/formatter/configure.zcml:26
-msgid "Configure portal formatters."
-msgstr ""
-
-#: src/z3ext/formatter/configure.zcml:26
-msgid "Portal formatters"
-msgstr ""
-
-#. Default: ""
-#: src/z3ext/formatter/fancydatetime.py:72
-msgid "Today at ${value}"
-msgstr ""
-
-#. Default: ""
-#: src/z3ext/formatter/fancydatetime.py:82
-msgid "Yesterday at ${value}"
-msgstr ""
-
-#: src/z3ext/formatter/interfaces.py:35
-msgid "Timezone"
-msgstr ""
-
-#: src/z3ext/formatter/interfaces.py:36
-msgid "Portal timezone."
-msgstr ""
-
-#: src/z3ext/formatter/interfaces.py:42 src/z3ext/formatter/interfaces.py:43
-msgid "Timezone format"
-msgstr ""
-
-#: src/z3ext/formatter/interfaces.py:49
-msgid "Use principal timezone"
-msgstr ""
-
-#: src/z3ext/formatter/interfaces.py:50
-msgid "Render datetime with user selected timezone."
-msgstr ""
-
-#: src/z3ext/formatter/vocabulary.py:28
-msgid "No timezone"
-msgstr ""
-
-#: src/z3ext/formatter/vocabulary.py:29
-msgid "Number of hours"
-msgstr ""
-
-#: src/z3ext/formatter/vocabulary.py:30
-msgid "Timezone name"
-msgstr ""
Copied: z3ext.formatter/tags/1.4.0/src/z3ext/formatter/locales/en/LC_MESSAGES/z3ext.formatter.po (from rev 102668, z3ext.formatter/trunk/src/z3ext/formatter/locales/en/LC_MESSAGES/z3ext.formatter.po)
===================================================================
--- z3ext.formatter/tags/1.4.0/src/z3ext/formatter/locales/en/LC_MESSAGES/z3ext.formatter.po (rev 0)
+++ z3ext.formatter/tags/1.4.0/src/z3ext/formatter/locales/en/LC_MESSAGES/z3ext.formatter.po 2009-08-11 10:31:52 UTC (rev 102669)
@@ -0,0 +1,74 @@
+###############################################################################
+#
+# Copyright (c) 2009 Zope Foundation 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.
+#
+# #############################################################################
+msgid ""
+msgstr ""
+"Project-Id-Version: Development/Unknown\n"
+"POT-Creation-Date: Mon Oct 20 22:53:40 2008\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL at ADDRESS>\n"
+"Language-Team: Zope 3 Developers <zope3-dev at zope.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Generated-By: zope/app/locales/extract.py\n"
+
+#: src/z3ext/formatter/configure.zcml:26
+msgid "Configure portal formatters."
+msgstr ""
+
+#: src/z3ext/formatter/configure.zcml:26
+msgid "Portal formatters"
+msgstr ""
+
+#. Default: ""
+#: src/z3ext/formatter/fancydatetime.py:72
+msgid "Today at ${value}"
+msgstr ""
+
+#. Default: ""
+#: src/z3ext/formatter/fancydatetime.py:82
+msgid "Yesterday at ${value}"
+msgstr ""
+
+#: src/z3ext/formatter/interfaces.py:35
+msgid "Timezone"
+msgstr ""
+
+#: src/z3ext/formatter/interfaces.py:36
+msgid "Portal timezone."
+msgstr ""
+
+#: src/z3ext/formatter/interfaces.py:42 src/z3ext/formatter/interfaces.py:43
+msgid "Timezone format"
+msgstr ""
+
+#: src/z3ext/formatter/interfaces.py:49
+msgid "Use principal timezone"
+msgstr ""
+
+#: src/z3ext/formatter/interfaces.py:50
+msgid "Render datetime with user selected timezone."
+msgstr ""
+
+#: src/z3ext/formatter/vocabulary.py:28
+msgid "No timezone"
+msgstr ""
+
+#: src/z3ext/formatter/vocabulary.py:29
+msgid "Number of hours"
+msgstr ""
+
+#: src/z3ext/formatter/vocabulary.py:30
+msgid "Timezone name"
+msgstr ""
Deleted: z3ext.formatter/tags/1.4.0/src/z3ext/formatter/locales/nl/LC_MESSAGES/z3ext.formatter.po
===================================================================
--- z3ext.formatter/trunk/src/z3ext/formatter/locales/nl/LC_MESSAGES/z3ext.formatter.po 2009-08-10 17:22:44 UTC (rev 102631)
+++ z3ext.formatter/tags/1.4.0/src/z3ext/formatter/locales/nl/LC_MESSAGES/z3ext.formatter.po 2009-08-11 10:31:52 UTC (rev 102669)
@@ -1,76 +0,0 @@
-###############################################################################
-#
-# Copyright (c) 2003-2004 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.
-#
-# #############################################################################
-msgid ""
-msgstr ""
-"Project-Id-Version: Development/Unknown\n"
-"POT-Creation-Date: Mon Oct 20 22:53:40 2008\n"
-"PO-Revision-Date: 2008-10-21 10:01+0100\n"
-"Last-Translator: F. Kooman <fkooman at tuxed.net>\n"
-"Language-Team: Zope 3 Developers <zope3-dev at zope.org>\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Generated-By: zope/app/locales/extract.py\n"
-
-#: src/z3ext/formatter/configure.zcml:26
-msgid "Configure portal formatters."
-msgstr "Website datum/tijd instellingen."
-
-#: src/z3ext/formatter/configure.zcml:26
-msgid "Portal formatters"
-msgstr "Website datum/tijd"
-
-#. Default: ""
-#: src/z3ext/formatter/fancydatetime.py:72
-msgid "Today at ${value}"
-msgstr "Vandaag om ${value}"
-
-#. Default: ""
-#: src/z3ext/formatter/fancydatetime.py:82
-msgid "Yesterday at ${value}"
-msgstr "Gisteren om ${value}"
-
-#: src/z3ext/formatter/interfaces.py:35
-msgid "Timezone"
-msgstr "Tijdzone"
-
-#: src/z3ext/formatter/interfaces.py:36
-msgid "Portal timezone."
-msgstr "Tijdzone van website."
-
-#: src/z3ext/formatter/interfaces.py:42
-#: src/z3ext/formatter/interfaces.py:43
-msgid "Timezone format"
-msgstr "Tijdzoneformaat"
-
-#: src/z3ext/formatter/interfaces.py:49
-msgid "Use principal timezone"
-msgstr "Tijdzone"
-
-#: src/z3ext/formatter/interfaces.py:50
-msgid "Render datetime with user selected timezone."
-msgstr "Geef de datum en tijd weer in de door de gebruiker gespecificeerde tijdzone."
-
-#: src/z3ext/formatter/vocabulary.py:28
-msgid "No timezone"
-msgstr "Geen tijdzone"
-
-#: src/z3ext/formatter/vocabulary.py:29
-msgid "Number of hours"
-msgstr "Aantal uren"
-
-#: src/z3ext/formatter/vocabulary.py:30
-msgid "Timezone name"
-msgstr "Naam van tijdzone"
-
Copied: z3ext.formatter/tags/1.4.0/src/z3ext/formatter/locales/nl/LC_MESSAGES/z3ext.formatter.po (from rev 102668, z3ext.formatter/trunk/src/z3ext/formatter/locales/nl/LC_MESSAGES/z3ext.formatter.po)
===================================================================
--- z3ext.formatter/tags/1.4.0/src/z3ext/formatter/locales/nl/LC_MESSAGES/z3ext.formatter.po (rev 0)
+++ z3ext.formatter/tags/1.4.0/src/z3ext/formatter/locales/nl/LC_MESSAGES/z3ext.formatter.po 2009-08-11 10:31:52 UTC (rev 102669)
@@ -0,0 +1,76 @@
+###############################################################################
+#
+# Copyright (c) 2009 Zope Foundation 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.
+#
+# #############################################################################
+msgid ""
+msgstr ""
+"Project-Id-Version: Development/Unknown\n"
+"POT-Creation-Date: Mon Oct 20 22:53:40 2008\n"
+"PO-Revision-Date: 2008-10-21 10:01+0100\n"
+"Last-Translator: F. Kooman <fkooman at tuxed.net>\n"
+"Language-Team: Zope 3 Developers <zope3-dev at zope.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Generated-By: zope/app/locales/extract.py\n"
+
+#: src/z3ext/formatter/configure.zcml:26
+msgid "Configure portal formatters."
+msgstr "Website datum/tijd instellingen."
+
+#: src/z3ext/formatter/configure.zcml:26
+msgid "Portal formatters"
+msgstr "Website datum/tijd"
+
+#. Default: ""
+#: src/z3ext/formatter/fancydatetime.py:72
+msgid "Today at ${value}"
+msgstr "Vandaag om ${value}"
+
+#. Default: ""
+#: src/z3ext/formatter/fancydatetime.py:82
+msgid "Yesterday at ${value}"
+msgstr "Gisteren om ${value}"
+
+#: src/z3ext/formatter/interfaces.py:35
+msgid "Timezone"
+msgstr "Tijdzone"
+
+#: src/z3ext/formatter/interfaces.py:36
+msgid "Portal timezone."
+msgstr "Tijdzone van website."
+
+#: src/z3ext/formatter/interfaces.py:42
+#: src/z3ext/formatter/interfaces.py:43
+msgid "Timezone format"
+msgstr "Tijdzoneformaat"
+
+#: src/z3ext/formatter/interfaces.py:49
+msgid "Use principal timezone"
+msgstr "Tijdzone"
+
+#: src/z3ext/formatter/interfaces.py:50
+msgid "Render datetime with user selected timezone."
+msgstr "Geef de datum en tijd weer in de door de gebruiker gespecificeerde tijdzone."
+
+#: src/z3ext/formatter/vocabulary.py:28
+msgid "No timezone"
+msgstr "Geen tijdzone"
+
+#: src/z3ext/formatter/vocabulary.py:29
+msgid "Number of hours"
+msgstr "Aantal uren"
+
+#: src/z3ext/formatter/vocabulary.py:30
+msgid "Timezone name"
+msgstr "Naam van tijdzone"
+
Deleted: z3ext.formatter/tags/1.4.0/src/z3ext/formatter/locales/ru/LC_MESSAGES/z3ext.formatter.po
===================================================================
--- z3ext.formatter/trunk/src/z3ext/formatter/locales/ru/LC_MESSAGES/z3ext.formatter.po 2009-08-10 17:22:44 UTC (rev 102631)
+++ z3ext.formatter/tags/1.4.0/src/z3ext/formatter/locales/ru/LC_MESSAGES/z3ext.formatter.po 2009-08-11 10:31:52 UTC (rev 102669)
@@ -1,74 +0,0 @@
-###############################################################################
-#
-# Copyright (c) 2003-2004 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.
-#
-# #############################################################################
-msgid ""
-msgstr ""
-"Project-Id-Version: Development/Unknown\n"
-"POT-Creation-Date: Mon Oct 20 22:53:40 2008\n"
-"PO-Revision-Date: 2008-10-21 13:43+0600\n"
-"Last-Translator: Nikolay Kim <fafhrd91 at gmail.com>\n"
-"Language-Team: Zope 3 Developers <zope3-dev at zope.org>\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Generated-By: zope/app/locales/extract.py\n"
-
-#: src/z3ext/formatter/configure.zcml:26
-msgid "Configure portal formatters."
-msgstr "ÐонÑигÑÑаÑÐ¸Ñ ÑÑедÑÑв ÑоÑмаÑиÑованиÑ."
-
-#: src/z3ext/formatter/configure.zcml:26
-msgid "Portal formatters"
-msgstr "CÑедÑÑва ÑоÑмаÑиÑованиÑ"
-
-#. Default: ""
-#: src/z3ext/formatter/fancydatetime.py:72
-msgid "Today at ${value}"
-msgstr "Ð¡ÐµÐ³Ð¾Ð´Ð½Ñ Ð² ${value}"
-
-#. Default: ""
-#: src/z3ext/formatter/fancydatetime.py:82
-msgid "Yesterday at ${value}"
-msgstr "ÐÑеÑа в ${value}"
-
-#: src/z3ext/formatter/interfaces.py:35
-msgid "Timezone"
-msgstr "ЧаÑовой поÑÑ"
-
-#: src/z3ext/formatter/interfaces.py:36
-msgid "Portal timezone."
-msgstr "ЧаÑовой поÑÑ ÑайÑа."
-
-#: src/z3ext/formatter/interfaces.py:42 src/z3ext/formatter/interfaces.py:43
-msgid "Timezone format"
-msgstr "ФоÑÐ¼Ð°Ñ ÑаÑового поÑÑа"
-
-#: src/z3ext/formatter/interfaces.py:49
-msgid "Use principal timezone"
-msgstr "ÐÑполÑзоваÑÑ ÑаÑовой поÑÑ Ð¿Ð¾Ð»ÑзоваÑелÑ"
-
-#: src/z3ext/formatter/interfaces.py:50
-msgid "Render datetime with user selected timezone."
-msgstr "ÐÑобÑажаÑÑ Ð´Ð°ÑÑ Ð¸ вÑÐµÐ¼Ñ Ð² завиÑимоÑÑи Ð¾Ñ Ð²ÑбоÑа полÑзоваÑелÑ."
-
-#: src/z3ext/formatter/vocabulary.py:28
-msgid "No timezone"
-msgstr "Ðез ÑаÑового поÑÑа"
-
-#: src/z3ext/formatter/vocabulary.py:29
-msgid "Number of hours"
-msgstr "ÐоллиÑеÑÑво ÑаÑов"
-
-#: src/z3ext/formatter/vocabulary.py:30
-msgid "Timezone name"
-msgstr "Ðазвание ÑаÑового поÑÑа"
Copied: z3ext.formatter/tags/1.4.0/src/z3ext/formatter/locales/ru/LC_MESSAGES/z3ext.formatter.po (from rev 102668, z3ext.formatter/trunk/src/z3ext/formatter/locales/ru/LC_MESSAGES/z3ext.formatter.po)
===================================================================
--- z3ext.formatter/tags/1.4.0/src/z3ext/formatter/locales/ru/LC_MESSAGES/z3ext.formatter.po (rev 0)
+++ z3ext.formatter/tags/1.4.0/src/z3ext/formatter/locales/ru/LC_MESSAGES/z3ext.formatter.po 2009-08-11 10:31:52 UTC (rev 102669)
@@ -0,0 +1,74 @@
+###############################################################################
+#
+# Copyright (c) 2009 Zope Foundation 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.
+#
+# #############################################################################
+msgid ""
+msgstr ""
+"Project-Id-Version: Development/Unknown\n"
+"POT-Creation-Date: Mon Oct 20 22:53:40 2008\n"
+"PO-Revision-Date: 2008-10-21 13:43+0600\n"
+"Last-Translator: Nikolay Kim <fafhrd91 at gmail.com>\n"
+"Language-Team: Zope 3 Developers <zope3-dev at zope.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Generated-By: zope/app/locales/extract.py\n"
+
+#: src/z3ext/formatter/configure.zcml:26
+msgid "Configure portal formatters."
+msgstr "ÐонÑигÑÑаÑÐ¸Ñ ÑÑедÑÑв ÑоÑмаÑиÑованиÑ."
+
+#: src/z3ext/formatter/configure.zcml:26
+msgid "Portal formatters"
+msgstr "CÑедÑÑва ÑоÑмаÑиÑованиÑ"
+
+#. Default: ""
+#: src/z3ext/formatter/fancydatetime.py:72
+msgid "Today at ${value}"
+msgstr "Ð¡ÐµÐ³Ð¾Ð´Ð½Ñ Ð² ${value}"
+
+#. Default: ""
+#: src/z3ext/formatter/fancydatetime.py:82
+msgid "Yesterday at ${value}"
+msgstr "ÐÑеÑа в ${value}"
+
+#: src/z3ext/formatter/interfaces.py:35
+msgid "Timezone"
+msgstr "ЧаÑовой поÑÑ"
+
+#: src/z3ext/formatter/interfaces.py:36
+msgid "Portal timezone."
+msgstr "ЧаÑовой поÑÑ ÑайÑа."
+
+#: src/z3ext/formatter/interfaces.py:42 src/z3ext/formatter/interfaces.py:43
+msgid "Timezone format"
+msgstr "ФоÑÐ¼Ð°Ñ ÑаÑового поÑÑа"
+
+#: src/z3ext/formatter/interfaces.py:49
+msgid "Use principal timezone"
+msgstr "ÐÑполÑзоваÑÑ ÑаÑовой поÑÑ Ð¿Ð¾Ð»ÑзоваÑелÑ"
+
+#: src/z3ext/formatter/interfaces.py:50
+msgid "Render datetime with user selected timezone."
+msgstr "ÐÑобÑажаÑÑ Ð´Ð°ÑÑ Ð¸ вÑÐµÐ¼Ñ Ð² завиÑимоÑÑи Ð¾Ñ Ð²ÑбоÑа полÑзоваÑелÑ."
+
+#: src/z3ext/formatter/vocabulary.py:28
+msgid "No timezone"
+msgstr "Ðез ÑаÑового поÑÑа"
+
+#: src/z3ext/formatter/vocabulary.py:29
+msgid "Number of hours"
+msgstr "ÐоллиÑеÑÑво ÑаÑов"
+
+#: src/z3ext/formatter/vocabulary.py:30
+msgid "Timezone name"
+msgstr "Ðазвание ÑаÑового поÑÑа"
Deleted: z3ext.formatter/tags/1.4.0/src/z3ext/formatter/locales/z3ext.formatter.pot
===================================================================
--- z3ext.formatter/trunk/src/z3ext/formatter/locales/z3ext.formatter.pot 2009-08-10 17:22:44 UTC (rev 102631)
+++ z3ext.formatter/tags/1.4.0/src/z3ext/formatter/locales/z3ext.formatter.pot 2009-08-11 10:31:52 UTC (rev 102669)
@@ -1,76 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2003-2004 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.
-#
-##############################################################################
-msgid ""
-msgstr ""
-"Project-Id-Version: Development/Unknown\n"
-"POT-Creation-Date: Tue Oct 21 15:00:08 2008\n"
-"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
-"Last-Translator: FULL NAME <EMAIL at ADDRESS>\n"
-"Language-Team: Zope 3 Developers <zope3-dev at zope.org>\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Generated-By: zope/app/locales/extract.py\n"
-
-#: src/z3ext/formatter/configure.zcml:26
-msgid "Configure portal formatters."
-msgstr ""
-
-#: src/z3ext/formatter/configure.zcml:26
-msgid "Portal formatters"
-msgstr ""
-
-#: src/z3ext/formatter/fancydatetime.py:72
-#. Default: ""
-msgid "Today at ${value}"
-msgstr ""
-
-#: src/z3ext/formatter/fancydatetime.py:82
-#. Default: ""
-msgid "Yesterday at ${value}"
-msgstr ""
-
-#: src/z3ext/formatter/interfaces.py:35
-msgid "Timezone"
-msgstr ""
-
-#: src/z3ext/formatter/interfaces.py:36
-msgid "Portal timezone."
-msgstr ""
-
-#: src/z3ext/formatter/interfaces.py:42
-#: src/z3ext/formatter/interfaces.py:43
-msgid "Timezone format"
-msgstr ""
-
-#: src/z3ext/formatter/interfaces.py:49
-msgid "Use principal timezone"
-msgstr ""
-
-#: src/z3ext/formatter/interfaces.py:50
-msgid "Render datetime with user selected timezone."
-msgstr ""
-
-#: src/z3ext/formatter/vocabulary.py:28
-msgid "No timezone"
-msgstr ""
-
-#: src/z3ext/formatter/vocabulary.py:29
-msgid "Number of hours"
-msgstr ""
-
-#: src/z3ext/formatter/vocabulary.py:30
-msgid "Timezone name"
-msgstr ""
-
Copied: z3ext.formatter/tags/1.4.0/src/z3ext/formatter/locales/z3ext.formatter.pot (from rev 102668, z3ext.formatter/trunk/src/z3ext/formatter/locales/z3ext.formatter.pot)
===================================================================
--- z3ext.formatter/tags/1.4.0/src/z3ext/formatter/locales/z3ext.formatter.pot (rev 0)
+++ z3ext.formatter/tags/1.4.0/src/z3ext/formatter/locales/z3ext.formatter.pot 2009-08-11 10:31:52 UTC (rev 102669)
@@ -0,0 +1,76 @@
+##############################################################################
+#
+# Copyright (c) 2009 Zope Foundation 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.
+#
+##############################################################################
+msgid ""
+msgstr ""
+"Project-Id-Version: Development/Unknown\n"
+"POT-Creation-Date: Tue Oct 21 15:00:08 2008\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL at ADDRESS>\n"
+"Language-Team: Zope 3 Developers <zope3-dev at zope.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Generated-By: zope/app/locales/extract.py\n"
+
+#: src/z3ext/formatter/configure.zcml:26
+msgid "Configure portal formatters."
+msgstr ""
+
+#: src/z3ext/formatter/configure.zcml:26
+msgid "Portal formatters"
+msgstr ""
+
+#: src/z3ext/formatter/fancydatetime.py:72
+#. Default: ""
+msgid "Today at ${value}"
+msgstr ""
+
+#: src/z3ext/formatter/fancydatetime.py:82
+#. Default: ""
+msgid "Yesterday at ${value}"
+msgstr ""
+
+#: src/z3ext/formatter/interfaces.py:35
+msgid "Timezone"
+msgstr ""
+
+#: src/z3ext/formatter/interfaces.py:36
+msgid "Portal timezone."
+msgstr ""
+
+#: src/z3ext/formatter/interfaces.py:42
+#: src/z3ext/formatter/interfaces.py:43
+msgid "Timezone format"
+msgstr ""
+
+#: src/z3ext/formatter/interfaces.py:49
+msgid "Use principal timezone"
+msgstr ""
+
+#: src/z3ext/formatter/interfaces.py:50
+msgid "Render datetime with user selected timezone."
+msgstr ""
+
+#: src/z3ext/formatter/vocabulary.py:28
+msgid "No timezone"
+msgstr ""
+
+#: src/z3ext/formatter/vocabulary.py:29
+msgid "Number of hours"
+msgstr ""
+
+#: src/z3ext/formatter/vocabulary.py:30
+msgid "Timezone name"
+msgstr ""
+
Deleted: z3ext.formatter/tags/1.4.0/src/z3ext/formatter/tests.py
===================================================================
--- z3ext.formatter/trunk/src/z3ext/formatter/tests.py 2009-08-10 17:22:44 UTC (rev 102631)
+++ z3ext.formatter/tags/1.4.0/src/z3ext/formatter/tests.py 2009-08-11 10:31:52 UTC (rev 102669)
@@ -1,71 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2007 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.
-#
-##############################################################################
-""" z3ext.formatter tests
-
-$Id$
-"""
-__docformat__ = "reStructuredText"
-
-import unittest, doctest
-from zope import interface, schema
-from zope.component import provideAdapter
-from zope.testing.cleanup import cleanUp
-from zope.app.testing import setup
-
-from zope.pagetemplate.pagetemplate import PageTemplate
-from zope.app.pagetemplate.engine import Engine, TrustedEngine, TrustedAppPT
-from zope.app.pagetemplate.metaconfigure import clear
-
-from z3ext.controlpanel.testing import setUpControlPanel
-
-from z3ext.formatter import \
- dformatter, dtformatter, fancydatetime, timeformatter
-from z3ext.formatter.expression import FormatterExpression
-
-
-class ZPTPage(TrustedAppPT, PageTemplate):
-
- def render(self, request, *args, **kw):
- namespace = self.pt_getContext(args, kw)
- namespace['request'] = request
- return self.pt_render(namespace)
-
-
-def setUp(test):
- setup.placefulSetUp(True)
- setup.setUpTraversal()
- setUpControlPanel()
-
- Engine.registerType(u'formatter', FormatterExpression)
- TrustedEngine.registerType(u'formatter', FormatterExpression)
-
- provideAdapter(dformatter.DateFormatterFactory, name='date')
- provideAdapter(dtformatter.DatetimeFormatterFactory, name='dateTime')
- provideAdapter(
- fancydatetime.FancyDatetimeFormatterFactory, name='fancyDatetime')
- provideAdapter(timeformatter.TimeFormatterFactory, name='time')
-
-
-def tearDown(test):
- setup.placelessTearDown()
- clear()
-
-
-def test_suite():
- return unittest.TestSuite((
- doctest.DocFileSuite(
- 'README.txt',
- setUp=setUp, tearDown=tearDown,
- optionflags=doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS),
- ))
Copied: z3ext.formatter/tags/1.4.0/src/z3ext/formatter/tests.py (from rev 102668, z3ext.formatter/trunk/src/z3ext/formatter/tests.py)
===================================================================
--- z3ext.formatter/tags/1.4.0/src/z3ext/formatter/tests.py (rev 0)
+++ z3ext.formatter/tags/1.4.0/src/z3ext/formatter/tests.py 2009-08-11 10:31:52 UTC (rev 102669)
@@ -0,0 +1,71 @@
+##############################################################################
+#
+# Copyright (c) 2009 Zope Foundation 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.
+#
+##############################################################################
+""" z3ext.formatter tests
+
+$Id$
+"""
+__docformat__ = "reStructuredText"
+
+import unittest, doctest
+from zope import interface, schema
+from zope.component import provideAdapter
+from zope.testing.cleanup import cleanUp
+from zope.app.testing import setup
+
+from zope.pagetemplate.pagetemplate import PageTemplate
+from zope.app.pagetemplate.engine import Engine, TrustedEngine, TrustedAppPT
+from zope.app.pagetemplate.metaconfigure import clear
+
+from z3ext.controlpanel.testing import setUpControlPanel
+
+from z3ext.formatter import \
+ dformatter, dtformatter, fancydatetime, timeformatter
+from z3ext.formatter.expression import FormatterExpression
+
+
+class ZPTPage(TrustedAppPT, PageTemplate):
+
+ def render(self, request, *args, **kw):
+ namespace = self.pt_getContext(args, kw)
+ namespace['request'] = request
+ return self.pt_render(namespace)
+
+
+def setUp(test):
+ setup.placefulSetUp(True)
+ setup.setUpTraversal()
+ setUpControlPanel()
+
+ Engine.registerType(u'formatter', FormatterExpression)
+ TrustedEngine.registerType(u'formatter', FormatterExpression)
+
+ provideAdapter(dformatter.DateFormatterFactory, name='date')
+ provideAdapter(dtformatter.DatetimeFormatterFactory, name='dateTime')
+ provideAdapter(
+ fancydatetime.FancyDatetimeFormatterFactory, name='fancyDatetime')
+ provideAdapter(timeformatter.TimeFormatterFactory, name='time')
+
+
+def tearDown(test):
+ setup.placelessTearDown()
+ clear()
+
+
+def test_suite():
+ return unittest.TestSuite((
+ doctest.DocFileSuite(
+ 'README.txt',
+ setUp=setUp, tearDown=tearDown,
+ optionflags=doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS),
+ ))
Deleted: z3ext.formatter/tags/1.4.0/src/z3ext/formatter/utils.py
===================================================================
--- z3ext.formatter/trunk/src/z3ext/formatter/utils.py 2009-08-10 17:22:44 UTC (rev 102631)
+++ z3ext.formatter/tags/1.4.0/src/z3ext/formatter/utils.py 2009-08-11 10:31:52 UTC (rev 102669)
@@ -1,26 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2007 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.
-#
-##############################################################################
-"""
-
-$Id$
-"""
-from zope.component import queryAdapter
-from interfaces import IFormatterFactory, FormatterNotDefined
-
-def getFormatter(request, name, *args):
- factory = queryAdapter(request, IFormatterFactory, name=name)
- if factory is None:
- raise FormatterNotDefined(name)
-
- return factory(*args)
Copied: z3ext.formatter/tags/1.4.0/src/z3ext/formatter/utils.py (from rev 102668, z3ext.formatter/trunk/src/z3ext/formatter/utils.py)
===================================================================
--- z3ext.formatter/tags/1.4.0/src/z3ext/formatter/utils.py (rev 0)
+++ z3ext.formatter/tags/1.4.0/src/z3ext/formatter/utils.py 2009-08-11 10:31:52 UTC (rev 102669)
@@ -0,0 +1,26 @@
+##############################################################################
+#
+# Copyright (c) 2009 Zope Foundation 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.
+#
+##############################################################################
+"""
+
+$Id$
+"""
+from zope.component import queryAdapter
+from interfaces import IFormatterFactory, FormatterNotDefined
+
+def getFormatter(request, name, *args):
+ factory = queryAdapter(request, IFormatterFactory, name=name)
+ if factory is None:
+ raise FormatterNotDefined(name)
+
+ return factory(*args)
Deleted: z3ext.formatter/tags/1.4.0/src/z3ext/formatter/vocabulary.py
===================================================================
--- z3ext.formatter/trunk/src/z3ext/formatter/vocabulary.py 2009-08-10 17:22:44 UTC (rev 102631)
+++ z3ext.formatter/tags/1.4.0/src/z3ext/formatter/vocabulary.py 2009-08-11 10:31:52 UTC (rev 102669)
@@ -1,35 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2007 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.
-#
-##############################################################################
-""" vocabularies
-
-$Id$
-"""
-import pytz
-from zope import interface
-from zope.schema.interfaces import IVocabularyFactory
-from zope.schema.vocabulary import SimpleTerm, SimpleVocabulary
-from zope.i18nmessageid import MessageFactory
-
-_ = MessageFactory('z3ext.formatter')
-
-
-timezones = SimpleVocabulary(
- [SimpleTerm(unicode(tz), tz, unicode(tz)) for tz in pytz.common_timezones])
-
-
-class Timezones(object):
- interface.implements(IVocabularyFactory)
-
- def __call__(self, context):
- return timezones
Copied: z3ext.formatter/tags/1.4.0/src/z3ext/formatter/vocabulary.py (from rev 102668, z3ext.formatter/trunk/src/z3ext/formatter/vocabulary.py)
===================================================================
--- z3ext.formatter/tags/1.4.0/src/z3ext/formatter/vocabulary.py (rev 0)
+++ z3ext.formatter/tags/1.4.0/src/z3ext/formatter/vocabulary.py 2009-08-11 10:31:52 UTC (rev 102669)
@@ -0,0 +1,35 @@
+##############################################################################
+#
+# Copyright (c) 2009 Zope Foundation 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.
+#
+##############################################################################
+""" vocabularies
+
+$Id$
+"""
+import pytz
+from zope import interface
+from zope.schema.interfaces import IVocabularyFactory
+from zope.schema.vocabulary import SimpleTerm, SimpleVocabulary
+from zope.i18nmessageid import MessageFactory
+
+_ = MessageFactory('z3ext.formatter')
+
+
+timezones = SimpleVocabulary(
+ [SimpleTerm(unicode(tz), tz, unicode(tz)) for tz in pytz.common_timezones])
+
+
+class Timezones(object):
+ interface.implements(IVocabularyFactory)
+
+ def __call__(self, context):
+ return timezones
More information about the Checkins
mailing list