comparison babel/messages/catalog.py @ 99:b6b5992daa6c

Renamed `LOCAL` to `LOCALTZ`.
author cmlenz
date Tue, 12 Jun 2007 20:09:35 +0000
parents debd9ac3bb4d
children abd3a594dab4
comparison
equal deleted inserted replaced
98:fb9109dd9070 99:b6b5992daa6c
22 import time 22 import time
23 23
24 from babel import __version__ as VERSION 24 from babel import __version__ as VERSION
25 from babel.core import Locale 25 from babel.core import Locale
26 from babel.messages.plurals import PLURALS 26 from babel.messages.plurals import PLURALS
27 from babel.util import odict, LOCAL, UTC 27 from babel.util import odict, LOCALTZ, UTC
28 28
29 __all__ = ['Message', 'Catalog'] 29 __all__ = ['Message', 'Catalog']
30 __docformat__ = 'restructuredtext en' 30 __docformat__ = 'restructuredtext en'
31 31
32 PYTHON_FORMAT = re.compile(r'\%(\([\w]+\))?[diouxXeEfFgGcrs]').search 32 PYTHON_FORMAT = re.compile(r'\%(\([\w]+\))?[diouxXeEfFgGcrs]').search
134 self.msgid_bugs_address = msgid_bugs_address or 'EMAIL@ADDRESS' 134 self.msgid_bugs_address = msgid_bugs_address or 'EMAIL@ADDRESS'
135 self.last_translator = last_translator #: last translator name + email 135 self.last_translator = last_translator #: last translator name + email
136 self.charset = charset or 'utf-8' 136 self.charset = charset or 'utf-8'
137 137
138 if creation_date is None: 138 if creation_date is None:
139 creation_date = datetime.now(LOCAL) 139 creation_date = datetime.now(LOCALTZ)
140 elif isinstance(creation_date, datetime) and not creation_date.tzinfo: 140 elif isinstance(creation_date, datetime) and not creation_date.tzinfo:
141 creation_date = creation_date.replace(tzinfo=LOCAL) 141 creation_date = creation_date.replace(tzinfo=LOCALTZ)
142 self.creation_date = creation_date #: creation date of the template 142 self.creation_date = creation_date #: creation date of the template
143 if revision_date is None: 143 if revision_date is None:
144 revision_date = datetime.now(LOCAL) 144 revision_date = datetime.now(LOCALTZ)
145 elif isinstance(revision_date, datetime) and not revision_date.tzinfo: 145 elif isinstance(revision_date, datetime) and not revision_date.tzinfo:
146 revision_date = revision_date.replace(tzinfo=LOCAL) 146 revision_date = revision_date.replace(tzinfo=LOCALTZ)
147 self.revision_date = revision_date #: last revision date of the catalog 147 self.revision_date = revision_date #: last revision date of the catalog
148 148
149 def headers(self): 149 def headers(self):
150 headers = [] 150 headers = []
151 headers.append(('Project-Id-Version', 151 headers.append(('Project-Id-Version',
Copyright (C) 2012-2017 Edgewall Software