[Zope3-checkins] CVS: Zope3/src/zope/i18n - format.py:1.8 gettextmessagecatalog.py:1.7 globaltranslationservice.py:1.10 locales.py:1.14 negotiator.py:1.6 simpletranslationservice.py:1.9 translate.py:1.8
Steve Alexander
steve@cat-box.net
Fri, 6 Jun 2003 15:29:41 -0400
Update of /cvs-repository/Zope3/src/zope/i18n
In directory cvs.zope.org:/tmp/cvs-serv7875/src/zope/i18n
Modified Files:
format.py gettextmessagecatalog.py globaltranslationservice.py
locales.py negotiator.py simpletranslationservice.py
translate.py
Log Message:
Changed old-style __implements__ to new-style implements()
Also, fixed up some incorrect formatting.
=== Zope3/src/zope/i18n/format.py 1.7 => 1.8 ===
--- Zope3/src/zope/i18n/format.py:1.7 Tue Apr 15 11:24:03 2003
+++ Zope3/src/zope/i18n/format.py Fri Jun 6 15:29:09 2003
@@ -23,6 +23,7 @@
import datetime
import calendar
from zope.i18n.interfaces import IDateTimeFormat, INumberFormat
+from zope.interface import implements
class DateTimeParseError(Exception):
"""Error is raised when parsing of datetime failed."""
@@ -30,7 +31,7 @@
class DateTimeFormat(object):
__doc__ = IDateTimeFormat.__doc__
- __implements__ = IDateTimeFormat
+ implements(IDateTimeFormat)
_DATETIMECHARS = "aGyMdEDFwWhHmsSkKz"
@@ -140,7 +141,7 @@
class NumberFormat(object):
__doc__ = INumberFormat.__doc__
- __implements__ = INumberFormat
+ implements(INumberFormat)
# See zope.i18n.interfaces.INumberFormat
symbols = {u'decimal': u'.',
=== Zope3/src/zope/i18n/gettextmessagecatalog.py 1.6 => 1.7 ===
--- Zope3/src/zope/i18n/gettextmessagecatalog.py:1.6 Mon Apr 28 13:21:39 2003
+++ Zope3/src/zope/i18n/gettextmessagecatalog.py Fri Jun 6 15:29:09 2003
@@ -18,6 +18,7 @@
from pythonlib.gettext import GNUTranslations
from zope.i18n.interfaces import IMessageCatalog
+from zope.interface import implements
class _KeyErrorRaisingFallback:
@@ -28,7 +29,7 @@
class GettextMessageCatalog:
"""A message catalog based on GNU gettext and Python's gettext module."""
- __implements__ = IMessageCatalog
+ implements(IMessageCatalog)
def __init__(self, language, domain, path_to_file):
"""Initialize the message catalog"""
=== Zope3/src/zope/i18n/globaltranslationservice.py 1.9 => 1.10 ===
--- Zope3/src/zope/i18n/globaltranslationservice.py:1.9 Thu Apr 17 16:05:13 2003
+++ Zope3/src/zope/i18n/globaltranslationservice.py Fri Jun 6 15:29:09 2003
@@ -33,8 +33,6 @@
class GlobalTranslationService(SimpleTranslationService):
- __implements__ = SimpleTranslationService.__implements__
-
def __init__(self, default_domain='global', fallbacks=None):
# XXX We haven't specified that ITranslationServices have a default
# domain. So far, we've required the domain argument to .translate()
=== Zope3/src/zope/i18n/locales.py 1.13 => 1.14 ===
--- Zope3/src/zope/i18n/locales.py:1.13 Thu Apr 10 02:17:00 2003
+++ Zope3/src/zope/i18n/locales.py Fri Jun 6 15:29:09 2003
@@ -18,6 +18,7 @@
import os
import datetime
from xml.dom.minidom import parse as parseXML
+from zope.interface import implements
# time.strptime() isn't available on all platforms before Python 2.3. When
# it isn't available, use the implementation from 2.3's _strptime.py, checked
@@ -76,7 +77,7 @@
class LocaleProvider:
__doc__ = ILocaleProvider.__doc__
- __implements__ = ILocaleProvider
+ implements(ILocaleProvider)
def __init__(self, locale_dir):
@@ -130,7 +131,7 @@
class LocaleIdentity:
__doc__ = ILocaleIdentity.__doc__
- __implements__ = ILocaleIdentity
+ implements(ILocaleIdentity)
def __init__(self, language=None, country=None, variant=None):
"""Initialize object."""
@@ -148,7 +149,7 @@
class LocaleVersion:
__doc__ = ILocaleVersion.__doc__
- __implements__ = ILocaleVersion
+ implements(ILocaleVersion)
# See zope.i18n.interfaces.ILocaleVersion
id = None
@@ -172,7 +173,7 @@
class LocaleTimeZone:
__doc__ = ILocaleTimeZone.__doc__
- __implements__ = ILocaleTimeZone
+ implements(ILocaleTimeZone)
def __init__(self, id):
"""Initialize the object."""
@@ -184,7 +185,7 @@
class LocaleCalendar:
__doc__ = ILocaleCalendar.__doc__
- __implements__ = ILocaleCalendar
+ implements(ILocaleCalendar)
def __init__(self, klass):
"""Initialize the object."""
@@ -273,7 +274,7 @@
class LocaleNumberFormat:
__doc__ = ILocaleNumberFormat.__doc__
- __implements__ = ILocaleNumberFormat
+ implements(ILocaleNumberFormat)
def __init__(self, klass):
"""Initialize object."""
@@ -285,7 +286,7 @@
class LocaleCurrency:
__doc__ = ILocaleCurrency.__doc__
- __implements__ = ILocaleCurrency
+ implements(ILocaleCurrency)
def __init__(self, id):
"""Initialize object."""
@@ -299,7 +300,7 @@
class Locale:
__doc__ = ILocale.__doc__
- __implements__ = ILocale
+ implements(ILocale)
def __init__(self, id):
self.id = id
=== Zope3/src/zope/i18n/negotiator.py 1.5 => 1.6 ===
--- Zope3/src/zope/i18n/negotiator.py:1.5 Thu May 1 15:35:42 2003
+++ Zope3/src/zope/i18n/negotiator.py Fri Jun 6 15:29:09 2003
@@ -19,10 +19,11 @@
from zope.i18n.interfaces import INegotiator
from zope.i18n.interfaces import IUserPreferredLanguages
from zope.component import getAdapter
+from zope.interface import implements
class Negotiator:
- __implements__ = INegotiator
+ implements(INegotiator)
def getLanguage(self, langs, env):
envadapter = getAdapter(env, IUserPreferredLanguages)
=== Zope3/src/zope/i18n/simpletranslationservice.py 1.8 => 1.9 ===
--- Zope3/src/zope/i18n/simpletranslationservice.py:1.8 Thu Apr 17 16:05:13 2003
+++ Zope3/src/zope/i18n/simpletranslationservice.py Fri Jun 6 15:29:09 2003
@@ -20,6 +20,7 @@
from zope.component import getService
from zope.i18n.interfaces import ITranslationService
+from zope.interface import implements
# Set up regular expressions for finding interpolation variables in text.
@@ -44,7 +45,7 @@
Note: This Translation Service does not implemen
"""
- __implements__ = ITranslationService
+ implements(ITranslationService)
def __init__(self, messages=None):
=== Zope3/src/zope/i18n/translate.py 1.7 => 1.8 ===
--- Zope3/src/zope/i18n/translate.py:1.7 Thu Apr 17 16:05:13 2003
+++ Zope3/src/zope/i18n/translate.py Fri Jun 6 15:29:09 2003
@@ -18,6 +18,7 @@
from zope.i18n.interfaces import ITranslator
from zope.component import getService
+from zope.interface import implements
class Translator:
@@ -27,7 +28,7 @@
the domain, context, and target language.
"""
- __implements__ = ITranslator
+ implements(ITranslator)
def __init__(self, locale, domain, context=None):
"""locale comes from the request, domain specifies the application,