[-]
[+]
|
Changed |
python-babel.changes
|
|
[-]
[+]
|
Changed |
python-babel.spec
^
|
|
[-]
[+]
|
Changed |
Babel-0.9.6.tar.bz2/Babel.egg-info/PKG-INFO
^
|
@@ -1,6 +1,6 @@
Metadata-Version: 1.0
Name: Babel
-Version: 0.9.5
+Version: 0.9.6
Summary: Internationalization utilities
Home-page: http://babel.edgewall.org/
Author: Edgewall Software
|
[-]
[+]
|
Changed |
Babel-0.9.6.tar.bz2/ChangeLog
^
|
@@ -1,3 +1,37 @@
+Version 0.9.6
+http://svn.edgewall.org/repos/babel/tags/0.9.6/
+(Mar 17 2011, from branches/stable/0.9.x)
+
+ * Backport r493-494: documentation typo fixes.
+ * Make the CLDR import script work with Python 2.7.
+ * Fix various typos.
+ * Fixed Python 2.3 compatibility (ticket #146, #233).
+ * Sort output of list-locales.
+ * Make the POT-Creation-Date of the catalog being updated equal to
+ POT-Creation-Date of the template used to update (ticket #148).
+ * Use a more explicit error message if no option or argument (command) is
+ passed to pybabel (ticket #81).
+ * Keep the PO-Revision-Date if it is not the default value (ticket #148).
+ * Make --no-wrap work by reworking --width's default and mimic xgettext's
+ behaviour of always wrapping comments (ticket #145).
+ * Fixed negative offset handling of Catalog._set_mime_headers (ticket #165).
+ * Add --project and --version options for commandline (ticket #173).
+ * Add a __ne__() method to the Local class.
+ * Explicitly sort instead of using sorted() and don't assume ordering
+ (Python 2.3 and Jython compatibility).
+ * Removed ValueError raising for string formatting message checkers if the
+ string does not contain any string formattings (ticket #150).
+ * Fix Serbian plural forms (ticket #213).
+ * Small speed improvement in format_date() (ticket #216).
+ * Fix number formatting for locales where CLDR specifies alt or draft
+ items (ticket #217)
+ * Fix bad check in format_time (ticket #257, reported with patch and tests by
+ jomae)
+ * Fix so frontend.CommandLineInterface.run does not accumulate logging
+ handlers (#227, reported with initial patch by dfraser)
+ * Fix exception if environment contains an invalid locale setting (#200)
+
+
Version 0.9.5
http://svn.edgewall.org/repos/babel/tags/0.9.5/
(Apr 6 2010, from branches/stable/0.9.x)
|
[-]
[+]
|
Changed |
Babel-0.9.6.tar.bz2/INSTALL.txt
^
|
@@ -6,7 +6,8 @@
* Python 2.3 or later (2.4 or later is recommended)
* Optional: setuptools 0.6b1 or later
- * Optional: pytz (strongly recommended for real time-zone support)
+ * Optional: pytz (strongly recommended for real time-zone support, mandatory
+ to run the automated test suite)
Installation
|
[-]
[+]
|
Changed |
Babel-0.9.6.tar.bz2/PKG-INFO
^
|
@@ -1,6 +1,6 @@
Metadata-Version: 1.0
Name: Babel
-Version: 0.9.5
+Version: 0.9.6
Summary: Internationalization utilities
Home-page: http://babel.edgewall.org/
Author: Edgewall Software
|
[-]
[+]
|
Changed |
Babel-0.9.6.tar.bz2/babel/core.py
^
|
@@ -216,6 +216,9 @@
def __eq__(self, other):
return str(self) == str(other)
+ def __ne__(self, other):
+ return not self.__eq__(other)
+
def __repr__(self):
return '<Locale "%s">' % str(self)
@@ -639,7 +642,10 @@
locale = 'en_US_POSIX'
elif aliases and locale in aliases:
locale = aliases[locale]
- return '_'.join(filter(None, parse_locale(locale)))
+ try:
+ return '_'.join(filter(None, parse_locale(locale)))
+ except ValueError:
+ pass
def negotiate_locale(preferred, available, sep='_', aliases=LOCALE_ALIASES):
"""Find the best match between available and requested locale strings.
|
[-]
[+]
|
Changed |
Babel-0.9.6.tar.bz2/babel/dates.py
^
|
@@ -220,7 +220,7 @@
"""Return a representation of the given timezone using "location format".
The result depends on both the local display name of the country and the
- city assocaited with the time zone:
+ city associated with the time zone:
>>> from pytz import timezone
>>> tz = timezone('America/St_Johns')
@@ -340,7 +340,7 @@
The `uncommon` parameter can be set to `True` to enable the use of timezone
representations that are not commonly used by the requested locale. For
- example, while in frensh the central europian timezone is usually
+ example, while in French the central European timezone is usually
abbreviated as "HEC", in Canadian French, this abbreviation is not in
common use, so a generic name would be chosen by default:
@@ -456,7 +456,7 @@
if format in ('full', 'long', 'medium', 'short'):
format = get_date_format(format, locale=locale)
pattern = parse_pattern(format)
- return parse_pattern(format).apply(date, locale)
+ return pattern.apply(date, locale)
def format_datetime(datetime=None, format='medium', tzinfo=None,
locale=LC_TIME):
@@ -578,7 +578,7 @@
if isinstance(time, datetime):
if tzinfo is not None:
time = time.astimezone(tzinfo)
- if hasattr(tzinfo, 'localize'): # pytz
+ if hasattr(tzinfo, 'normalize'): # pytz
time = tzinfo.normalize(time)
time = time.timetz()
elif tzinfo is not None:
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/global.dat
^
|
[-]
[+]
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata.py
^
|
@@ -120,8 +120,8 @@
>>> d = {1: 'foo', 3: 'baz'}
>>> merge(d, {1: 'Foo', 2: 'Bar'})
- >>> d
- {1: 'Foo', 2: 'Bar', 3: 'baz'}
+ >>> items = d.items(); items.sort(); items
+ [(1, 'Foo'), (2, 'Bar'), (3, 'baz')]
:param dict1: the dictionary to merge into
:param dict2: the dictionary containing the data that should be merged
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/am.dat
^
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/ar.dat
^
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/ar_LB.dat
^
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/ar_TN.dat
^
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/az.dat
^
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/bg.dat
^
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/bn.dat
^
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/bn_IN.dat
^
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/bs.dat
^
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/cs.dat
^
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/da.dat
^
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/de.dat
^
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/dv.dat
^
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/dz.dat
^
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/el.dat
^
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/el_POLYTON.dat
^
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/en.dat
^
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/en_NZ.dat
^
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/es.dat
^
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/et.dat
^
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/fa.dat
^
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/fi.dat
^
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/fil.dat
^
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/fo.dat
^
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/fr.dat
^
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/fur.dat
^
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/ga.dat
^
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/gez.dat
^
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/gl.dat
^
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/he.dat
^
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/hu.dat
^
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/ia.dat
^
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/id.dat
^
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/is.dat
^
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/it.dat
^
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/ja.dat
^
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/ka.dat
^
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/kn.dat
^
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/ko.dat
^
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/ky.dat
^
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/ln.dat
^
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/lt.dat
^
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/lv.dat
^
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/ml.dat
^
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/mn.dat
^
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/mt.dat
^
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/my.dat
^
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/nb.dat
^
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/ne.dat
^
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/nl.dat
^
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/nn.dat
^
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/pl.dat
^
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/pt.dat
^
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/pt_PT.dat
^
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/ru.dat
^
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/rw.dat
^
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/sa.dat
^
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/se.dat
^
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/sk.dat
^
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/sl.dat
^
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/sr.dat
^
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/sv.dat
^
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/th.dat
^
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/to.dat
^
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/tr.dat
^
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/trv.dat
^
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/tt.dat
^
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/uk.dat
^
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/ur.dat
^
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/uz.dat
^
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/vi.dat
^
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/wal.dat
^
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/zh.dat
^
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/zh_Hant.dat
^
|
|
Changed |
Babel-0.9.6.tar.bz2/babel/localedata/zh_Hant_HK.dat
^
|
[-]
[+]
|
Changed |
Babel-0.9.6.tar.bz2/babel/messages/catalog.py
^
|
@@ -19,17 +19,13 @@
from email import message_from_string
from copy import copy
import re
-try:
- set
-except NameError:
- from sets import Set as set
import time
from babel import __version__ as VERSION
from babel.core import Locale
from babel.dates import format_datetime
from babel.messages.plurals import get_plural
-from babel.util import odict, distinct, LOCALTZ, UTC, FixedOffsetTimezone
+from babel.util import odict, distinct, set, LOCALTZ, UTC, FixedOffsetTimezone
__all__ = ['Message', 'Catalog', 'TranslationError']
__docformat__ = 'restructuredtext en'
@@ -351,13 +347,61 @@
elif name == 'pot-creation-date':
# FIXME: this should use dates.parse_datetime as soon as that
# is ready
- value, tzoffset, _ = re.split('[+-](\d{4})$', value, 1)
+ value, tzoffset, _ = re.split('([+-]\d{4})$', value, 1)
+
tt = time.strptime(value, '%Y-%m-%d %H:%M')
ts = time.mktime(tt)
- tzoffset = FixedOffsetTimezone(int(tzoffset[:2]) * 60 +
- int(tzoffset[2:]))
+
+ # Separate the offset into a sign component, hours, and minutes
+ plus_minus_s, rest = tzoffset[0], tzoffset[1:]
+ hours_offset_s, mins_offset_s = rest[:2], rest[2:]
+
+ # Make them all integers
+ plus_minus = int(plus_minus_s + '1')
+ hours_offset = int(hours_offset_s)
+ mins_offset = int(mins_offset_s)
+
+ # Calculate net offset
+ net_mins_offset = hours_offset * 60
+ net_mins_offset += mins_offset
+ net_mins_offset *= plus_minus
+
+ # Create an offset object
+ tzoffset = FixedOffsetTimezone(net_mins_offset)
+
+ # Store the offset in a datetime object
dt = datetime.fromtimestamp(ts)
self.creation_date = dt.replace(tzinfo=tzoffset)
+ elif name == 'po-revision-date':
+ # Keep the value if it's not the default one
+ if 'YEAR' not in value:
+ # FIXME: this should use dates.parse_datetime as soon as
+ # that is ready
+ value, tzoffset, _ = re.split('([+-]\d{4})$', value, 1)
+ tt = time.strptime(value, '%Y-%m-%d %H:%M')
+ ts = time.mktime(tt)
+
+ # Separate the offset into a sign component, hours, and
+ # minutes
+ plus_minus_s, rest = tzoffset[0], tzoffset[1:]
+ hours_offset_s, mins_offset_s = rest[:2], rest[2:]
+
+ # Make them all integers
+ plus_minus = int(plus_minus_s + '1')
+ hours_offset = int(hours_offset_s)
+ mins_offset = int(mins_offset_s)
+
+ # Calculate net offset
+ net_mins_offset = hours_offset * 60
+ net_mins_offset += mins_offset
+ net_mins_offset *= plus_minus
+
+ # Create an offset object
+ tzoffset = FixedOffsetTimezone(net_mins_offset)
+
+ # Store the offset in a datetime object
+ dt = datetime.fromtimestamp(ts)
+ self.revision_date = dt.replace(tzinfo=tzoffset)
mime_headers = property(_get_mime_headers, _set_mime_headers, doc="""\
The MIME headers of the catalog, used for the special ``msgid ""`` entry.
@@ -710,6 +754,9 @@
for msgid in remaining:
if no_fuzzy_matching or msgid not in fuzzy_matches:
self.obsolete[msgid] = remaining[msgid]
+ # Make updated catalog's POT-Creation-Date equal to the template
+ # used to update the catalog
+ self.creation_date = template.creation_date
def _key_for(self, id):
"""The key for a message is just the singular ID even for pluralizable
|
[-]
[+]
|
Changed |
Babel-0.9.6.tar.bz2/babel/messages/checkers.py
^
|
@@ -18,6 +18,7 @@
from itertools import izip
from babel.messages.catalog import TranslationError, PYTHON_FORMAT
+from babel.util import set
#: list of format chars that are compatible to each other
_string_format_compatibilities = [
@@ -69,7 +70,8 @@
arguments are not interchangeable as `alternative` may contain less
placeholders if `format` uses named placeholders.
- If `format` does not use string formatting a `ValueError` is raised.
+ The behavior of this function is undefined if the string does not use
+ string formattings.
If the string formatting of `alternative` is compatible to `format` the
function returns `None`, otherwise a `TranslationError` is raised.
@@ -125,13 +127,6 @@
a, b = map(_parse, (format, alternative))
- # if a does not use string formattings, we are dealing with invalid
- # input data. This function only works if the first string provided
- # does contain string format chars
- if not a:
- raise ValueError('original string provided does not use string '
- 'formatting.')
-
# now check if both strings are positional or named
a_positional, b_positional = map(_check_positional, (a, b))
if a_positional and not b_positional and not b:
|
[-]
[+]
|
Changed |
Babel-0.9.6.tar.bz2/babel/messages/frontend.py
^
|
@@ -243,7 +243,7 @@
self.omit_header = False
self.output_file = None
self.input_dirs = None
- self.width = 76
+ self.width = None
self.no_wrap = False
self.sort_output = False
self.sort_by_file = False
@@ -267,9 +267,9 @@
if self.no_wrap and self.width:
raise DistutilsOptionError("'--no-wrap' and '--width' are mutually "
"exclusive")
- if self.no_wrap:
- self.width = None
- else:
+ if not self.no_wrap and not self.width:
+ self.width = 76
+ elif self.width is not None:
self.width = int(self.width)
if self.sort_output and self.sort_by_file:
@@ -626,20 +626,13 @@
options, args = self.parser.parse_args(argv[1:])
- # Configure logging
- self.log = logging.getLogger('babel')
- self.log.setLevel(options.loglevel)
- handler = logging.StreamHandler()
- handler.setLevel(options.loglevel)
- formatter = logging.Formatter('%(message)s')
- handler.setFormatter(formatter)
- self.log.addHandler(handler)
-
+ self._configure_logging(options.loglevel)
if options.list_locales:
identifiers = localedata.list()
longest = max([len(identifier) for identifier in identifiers])
+ identifiers.sort()
format = u'%%-%ds %%s' % (longest + 1)
- for identifier in localedata.list():
+ for identifier in identifiers:
locale = Locale.parse(identifier)
output = format % (identifier, locale.english_name)
print output.encode(sys.stdout.encoding or
@@ -648,7 +641,8 @@
return 0
if not args:
- self.parser.error('incorrect number of arguments')
+ self.parser.error('no valid command or option passed. '
+ 'Try the -h/--help option for more information.')
cmdname = args[0]
if cmdname not in self.commands:
@@ -656,6 +650,21 @@
return getattr(self, cmdname)(args[1:])
+ def _configure_logging(self, loglevel):
+ self.log = logging.getLogger('babel')
+ self.log.setLevel(loglevel)
+ # Don't add a new handler for every instance initialization (#227), this
+ # would cause duplicated output when the CommandLineInterface as an
+ # normal Python class.
+ if self.log.handlers:
+ handler = self.log.handlers[0]
+ else:
+ handler = logging.StreamHandler()
+ self.log.addHandler(handler)
+ handler.setLevel(loglevel)
+ formatter = logging.Formatter('%(message)s')
+ handler.setFormatter(formatter)
+
def _help(self):
print self.parser.format_help()
print "commands:"
@@ -803,7 +812,7 @@
parser.add_option('-o', '--output', dest='output',
help='path to the output POT file')
parser.add_option('-w', '--width', dest='width', type='int',
- help="set output line width (default %default)")
+ help="set output line width (default 76)")
parser.add_option('--no-wrap', dest='no_wrap', action = 'store_true',
help='do not break long message lines, longer than '
'the output line width, into several lines')
@@ -818,6 +827,10 @@
help='set report address for msgid')
parser.add_option('--copyright-holder', dest='copyright_holder',
help='set copyright holder in output')
+ parser.add_option('--project', dest='project',
+ help='set project name in output')
+ parser.add_option('--version', dest='version',
+ help='set project version in output')
parser.add_option('--add-comments', '-c', dest='comment_tags',
metavar='TAG', action='append',
help='place comment block with TAG (or those '
@@ -829,7 +842,7 @@
parser.set_defaults(charset='utf-8', keywords=[],
no_default_keywords=False, no_location=False,
- omit_header = False, width=76, no_wrap=False,
+ omit_header = False, width=None, no_wrap=False,
sort_output=False, sort_by_file=False,
comment_tags=[], strip_comment_tags=False)
options, args = parser.parse_args(argv)
@@ -864,15 +877,15 @@
parser.error("'--no-wrap' and '--width' are mutually exclusive.")
elif not options.width and not options.no_wrap:
options.width = 76
- elif not options.width and options.no_wrap:
- options.width = 0
if options.sort_output and options.sort_by_file:
parser.error("'--sort-output' and '--sort-by-file' are mutually "
"exclusive")
try:
- catalog = Catalog(msgid_bugs_address=options.msgid_bugs_address,
+ catalog = Catalog(project=options.project,
+ version=options.version,
+ msgid_bugs_address=options.msgid_bugs_address,
copyright_holder=options.copyright_holder,
charset=options.charset)
@@ -1000,13 +1013,13 @@
parser.add_option('--ignore-obsolete', dest='ignore_obsolete',
action='store_true',
help='do not include obsolete messages in the output '
- '(default %default)'),
+ '(default %default)')
parser.add_option('--no-fuzzy-matching', '-N', dest='no_fuzzy_matching',
action='store_true',
- help='do not use fuzzy matching (default %default)'),
+ help='do not use fuzzy matching (default %default)')
parser.add_option('--previous', dest='previous', action='store_true',
help='keep previous msgids of translated messages '
- '(default %default)'),
+ '(default %default)')
parser.set_defaults(domain='messages', ignore_obsolete=False,
no_fuzzy_matching=False, previous=False)
@@ -1017,7 +1030,7 @@
if not options.output_file and not options.output_dir:
parser.error('you must specify the output file or directory')
if options.output_file and not options.locale:
- parser.error('you must specify the loicale')
+ parser.error('you must specify the locale')
if options.no_fuzzy_matching and options.previous:
options.previous = False
@@ -1170,8 +1183,9 @@
def parse_keywords(strings=[]):
"""Parse keywords specifications from the given list of strings.
- >>> kw = parse_keywords(['_', 'dgettext:2', 'dngettext:2,3'])
- >>> for keyword, indices in sorted(kw.items()):
+ >>> kw = parse_keywords(['_', 'dgettext:2', 'dngettext:2,3']).items()
+ >>> kw.sort()
+ >>> for keyword, indices in kw:
... print (keyword, indices)
('_', None)
('dgettext', (2,))
|
[-]
[+]
|
Changed |
Babel-0.9.6.tar.bz2/babel/messages/jslexer.py
^
|
@@ -16,7 +16,8 @@
"""
import re
-from operator import itemgetter
+
+from babel.util import itemgetter
operators = [
|
[-]
[+]
|
Changed |
Babel-0.9.6.tar.bz2/babel/messages/plurals.py
^
|
@@ -13,9 +13,8 @@
"""Plural form definitions."""
-
-from operator import itemgetter
from babel.core import default_locale, Locale
+from babel.util import itemgetter
LC_CTYPE = default_locale('LC_CTYPE')
@@ -177,7 +176,7 @@
# Slovenian
'sl': (4, '(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3)'),
# Serbian - From Pootle's PO's
- 'sr': (3, '(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10< =4 && (n%100<10 || n%100>=20) ? 1 : 2)'),
+ 'sr': (3, '(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)'),
# Southern Sotho - From Pootle's PO's
'st': (2, '(n != 1)'),
# Swedish
|
[-]
[+]
|
Changed |
Babel-0.9.6.tar.bz2/babel/messages/pofile.py
^
|
@@ -21,14 +21,10 @@
from datetime import date, datetime
import os
import re
-try:
- set
-except NameError:
- from sets import Set as set
from babel import __version__ as VERSION
from babel.messages.catalog import Catalog, Message
-from babel.util import wraptext, LOCALTZ
+from babel.util import set, wraptext, LOCALTZ
__all__ = ['read_po', 'write_po']
__docformat__ = 'restructuredtext en'
@@ -195,7 +191,9 @@
translations[-1][1] += u'\n' + line.rstrip()
for lineno, line in enumerate(fileobj.readlines()):
- line = line.strip().decode(catalog.charset)
+ line = line.strip()
+ if not isinstance(line, unicode):
+ line = line.decode(catalog.charset)
if line.startswith('#'):
in_msgid[0] = in_msgstr[0] = False
if messages and translations:
@@ -378,10 +376,13 @@
fileobj.write(text)
def _write_comment(comment, prefix=''):
- lines = comment
+ # xgettext always wraps comments even if --no-wrap is passed;
+ # provide the same behaviour
if width and width > 0:
- lines = wraptext(comment, width)
- for line in lines:
+ _width = width
+ else:
+ _width = 76
+ for line in wraptext(comment, _width):
_write('#%s %s\n' % (prefix, line.strip()))
def _write_message(message, prefix=''):
|
[-]
[+]
|
Changed |
Babel-0.9.6.tar.bz2/babel/messages/tests/catalog.py
^
|
@@ -12,6 +12,7 @@
# history and logs, available at http://babel.edgewall.org/log/.
import copy
+import datetime
import doctest
import unittest
@@ -208,10 +209,53 @@
self.assertEqual(None, cat2['foo'].string)
self.assertEqual(False, cat2['foo'].fuzzy)
+
+ def test_update_po_updates_pot_creation_date(self):
+ template = catalog.Catalog()
+ localized_catalog = copy.deepcopy(template)
+ localized_catalog.locale = 'de_DE'
+ self.assertNotEqual(template.mime_headers,
+ localized_catalog.mime_headers)
+ self.assertEqual(template.creation_date,
+ localized_catalog.creation_date)
+ template.creation_date = datetime.datetime.now() - \
+ datetime.timedelta(minutes=5)
+ localized_catalog.update(template)
+ self.assertEqual(template.creation_date,
+ localized_catalog.creation_date)
+
+ def test_update_po_keeps_po_revision_date(self):
+ template = catalog.Catalog()
+ localized_catalog = copy.deepcopy(template)
+ localized_catalog.locale = 'de_DE'
+ fake_rev_date = datetime.datetime.now() - datetime.timedelta(days=5)
+ localized_catalog.revision_date = fake_rev_date
+ self.assertNotEqual(template.mime_headers,
+ localized_catalog.mime_headers)
+ self.assertEqual(template.creation_date,
+ localized_catalog.creation_date)
+ template.creation_date = datetime.datetime.now() - \
+ datetime.timedelta(minutes=5)
+ localized_catalog.update(template)
+ self.assertEqual(localized_catalog.revision_date, fake_rev_date)
+
+ def test_stores_datetime_correctly(self):
+ localized = catalog.Catalog()
+ localized.locale = 'de_DE'
+ localized[''] = catalog.Message('',
+ "POT-Creation-Date: 2009-03-09 15:47-0700\n" +
+ "PO-Revision-Date: 2009-03-09 15:47-0700\n")
+ for key, value in localized.mime_headers:
+ if key in ('POT-Creation-Date', 'PO-Revision-Date'):
+ self.assertEqual(value, '2009-03-09 15:47-0700')
def suite():
suite = unittest.TestSuite()
- suite.addTest(doctest.DocTestSuite(catalog, optionflags=doctest.ELLIPSIS))
+ if hasattr(doctest, 'ELLIPSIS'):
+ suite.addTest(doctest.DocTestSuite(catalog, optionflags=doctest.ELLIPSIS))
+ else:
+ # Python 2.3 has no doctest.ELLIPSIS option, it's implicit
+ suite.addTest(doctest.DocTestSuite(catalog))
suite.addTest(unittest.makeSuite(MessageTestCase))
suite.addTest(unittest.makeSuite(CatalogTestCase))
return suite
|
[-]
[+]
|
Changed |
Babel-0.9.6.tar.bz2/babel/messages/tests/checkers.py
^
|
@@ -98,7 +98,7 @@
locale = Locale(_locale)
date = format_datetime(datetime.now(LOCALTZ),
'yyyy-MM-dd HH:mmZ',
- tzinfo=LOCALTZ, locale=_locale),
+ tzinfo=LOCALTZ, locale=_locale)
except UnknownLocaleError:
# Just an alias? Not what we're testing here, let's continue
continue
|
[-]
[+]
|
Changed |
Babel-0.9.6.tar.bz2/babel/messages/tests/data/setup.py
^
|
@@ -2,12 +2,12 @@
# -*- coding: utf-8 -*-
# vim: sw=4 ts=4 fenc=utf-8
# =============================================================================
-# $Id: setup.py 114 2007-06-14 21:17:14Z palgarvio $
+# $Id: setup.py 596 2011-03-17 14:05:55Z fschwarz $
# =============================================================================
-# $URL: http://svn.edgewall.org/repos/babel/tags/0.9.5/babel/messages/tests/data/setup.py $
-# $LastChangedDate: 2007-06-14 23:17:14 +0200 (do, 14 jun 2007) $
-# $Rev: 114 $
-# $LastChangedBy: palgarvio $
+# $URL: http://svn.edgewall.org/repos/babel/tags/0.9.6/babel/messages/tests/data/setup.py $
+# $LastChangedDate: 2011-03-17 15:05:55 +0100 (Do, 17. Mär 2011) $
+# $Rev: 596 $
+# $LastChangedBy: fschwarz $
# =============================================================================
# Copyright (C) 2006 Ufsoft.org - Pedro Algarvio <ufs@ufsoft.org>
#
|
[-]
[+]
|
Changed |
Babel-0.9.6.tar.bz2/babel/messages/tests/frontend.py
^
|
@@ -16,6 +16,7 @@
from distutils.errors import DistutilsOptionError
from distutils.log import _global_log
import doctest
+import logging
import os
import shutil
from StringIO import StringIO
@@ -503,15 +504,26 @@
def setUp(self):
self.datadir = os.path.join(os.path.dirname(__file__), 'data')
+ self.orig_working_dir = os.getcwd()
self.orig_argv = sys.argv
self.orig_stdout = sys.stdout
self.orig_stderr = sys.stderr
sys.argv = ['pybabel']
sys.stdout = StringIO()
sys.stderr = StringIO()
+ os.chdir(self.datadir)
+
+ # Logging handlers will be reused if possible (#227). This breaks the
+ # implicit assumption that our newly created StringIO for sys.stderr
+ # contains the console output. Removing the old handler ensures that a
+ # new handler with our new StringIO instance will be used.
+ log = logging.getLogger('babel')
+ for handler in log.handlers:
+ log.removeHandler(handler)
self.cli = frontend.CommandLineInterface()
def tearDown(self):
+ os.chdir(self.orig_working_dir)
sys.argv = self.orig_argv
sys.stdout = self.orig_stdout
sys.stderr = self.orig_stderr
@@ -525,12 +537,46 @@
self.cli.run(sys.argv)
self.fail('Expected SystemExit')
except SystemExit, e:
- self.assertEqual(2, e.code)
+ stderr = sys.stderr.getvalue()
+ if isinstance(e.code, int):
+ self.assertEqual(2, e.code)
+ else:
+ # OptionParser in Python 2.3 does not set the exit code.
+ # Instead the 'code' contains the custom error message from the
+ # frontend
+ stderr = stderr + e.code + '\n'
self.assertEqual("""\
usage: pybabel command [options] [args]
-pybabel: error: incorrect number of arguments
-""", sys.stderr.getvalue().lower())
+pybabel: error: no valid command or option passed. try the -h/--help option for more information.
+""", stderr.lower())
+
+ def _run_init_catalog(self):
+ i18n_dir = os.path.join(self.datadir, 'project', 'i18n')
+ pot_path = os.path.join(self.datadir, 'project', 'i18n', 'messages.pot')
+ init_argv = sys.argv + ['init', '--locale', 'en_US', '-d', i18n_dir,
+ '-i', pot_path]
+ self.cli.run(init_argv)
+
+ def test_no_duplicated_output_for_multiple_runs(self):
+ self._run_init_catalog()
+ first_output = sys.stderr.getvalue()
+ self._run_init_catalog()
+ second_output = sys.stderr.getvalue()[len(first_output):]
+
+ # in case the log message is not duplicated we should get the same
+ # output as before
+ self.assertEqual(first_output, second_output)
+
+ def test_frontend_can_log_to_predefined_handler(self):
+ custom_stream = StringIO()
+ log = logging.getLogger('babel')
+ log.addHandler(logging.StreamHandler(custom_stream))
+
+ self._run_init_catalog()
+ self.assertNotEqual(id(sys.stderr), id(custom_stream))
+ self.assertEqual('', sys.stderr.getvalue())
+ assert len(custom_stream.getvalue()) > 0
def test_help(self):
try:
@@ -557,16 +603,14 @@
def test_extract_with_default_mapping(self):
pot_file = os.path.join(self.datadir, 'project', 'i18n', 'temp.pot')
- try:
- self.cli.run(sys.argv + ['extract',
- '--copyright-holder', 'FooBar, Inc.',
- '--msgid-bugs-address', 'bugs.address@email.tld',
- '-c', 'TRANSLATOR', '-c', 'TRANSLATORS:',
- '-o', pot_file, os.path.join(self.datadir, 'project')])
- except SystemExit, e:
- self.assertEqual(0, e.code)
- assert os.path.isfile(pot_file)
- self.assertEqual(
+ self.cli.run(sys.argv + ['extract',
+ '--copyright-holder', 'FooBar, Inc.',
+ '--project', 'TestProject', '--version', '0.1',
+ '--msgid-bugs-address', 'bugs.address@email.tld',
+ '-c', 'TRANSLATOR', '-c', 'TRANSLATORS:',
+ '-o', pot_file, 'project'])
+ assert os.path.isfile(pot_file)
+ self.assertEqual(
r"""# Translations template for TestProject.
# Copyright (C) %(year)s FooBar, Inc.
# This file is distributed under the same license as the TestProject
@@ -587,7 +631,7 @@
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel %(version)s\n"
-#. This will be a translator coment,
+#. TRANSLATOR: This will be a translator coment,
#. that will include several lines
#: project/file1.py:8
msgid "bar"
@@ -613,17 +657,15 @@
def test_extract_with_mapping_file(self):
pot_file = os.path.join(self.datadir, 'project', 'i18n', 'temp.pot')
- try:
- self.cli.run(sys.argv + ['extract',
- '--copyright-holder', 'FooBar, Inc.',
- '--msgid-bugs-address', 'bugs.address@email.tld',
- '--mapping', os.path.join(self.datadir, 'mapping.cfg'),
- '-c', 'TRANSLATOR', '-c', 'TRANSLATORS:',
- '-o', pot_file, os.path.join(self.datadir, 'project')])
- except SystemExit, e:
- self.assertEqual(0, e.code)
- assert os.path.isfile(pot_file)
- self.assertEqual(
+ self.cli.run(sys.argv + ['extract',
+ '--copyright-holder', 'FooBar, Inc.',
+ '--project', 'TestProject', '--version', '0.1',
+ '--msgid-bugs-address', 'bugs.address@email.tld',
+ '--mapping', os.path.join(self.datadir, 'mapping.cfg'),
+ '-c', 'TRANSLATOR', '-c', 'TRANSLATORS:',
+ '-o', pot_file, 'project'])
+ assert os.path.isfile(pot_file)
+ self.assertEqual(
r"""# Translations template for TestProject.
# Copyright (C) %(year)s FooBar, Inc.
# This file is distributed under the same license as the TestProject
@@ -644,7 +686,7 @@
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel %(version)s\n"
-#. This will be a translator coment,
+#. TRANSLATOR: This will be a translator coment,
#. that will include several lines
#: project/file1.py:8
msgid "bar"
@@ -665,16 +707,12 @@
def test_init_with_output_dir(self):
po_file = os.path.join(self.datadir, 'project', 'i18n', 'en_US',
'LC_MESSAGES', 'messages.po')
- try:
- self.cli.run(sys.argv + ['init',
- '--locale', 'en_US',
- '-d', os.path.join(self.datadir, 'project', 'i18n'),
- '-i', os.path.join(self.datadir, 'project', 'i18n',
- 'messages.pot')])
- except SystemExit, e:
- self.assertEqual(0, e.code)
- assert os.path.isfile(po_file)
- self.assertEqual(
+ self.cli.run(sys.argv + ['init',
+ '--locale', 'en_US',
+ '-d', os.path.join(self.datadir, 'project', 'i18n'),
+ '-i', os.path.join(self.datadir, 'project', 'i18n', 'messages.pot')])
+ assert os.path.isfile(po_file)
+ self.assertEqual(
r"""# English (United States) translations for TestProject.
# Copyright (C) 2007 FooBar, Inc.
# This file is distributed under the same license as the TestProject
@@ -716,14 +754,11 @@
def test_init_singular_plural_forms(self):
po_file = os.path.join(self.datadir, 'project', 'i18n', 'ja_JP',
'LC_MESSAGES', 'messages.po')
- try:
- self.cli.run(sys.argv + ['init',
- '--locale', 'ja_JP',
- '-d', os.path.join(self.datadir, 'project', 'i18n'),
- '-i', os.path.join(self.datadir, 'project', 'i18n',
- 'messages.pot')])
- except SystemExit, e:
- self.assertEqual(0, e.code)
+ self.cli.run(sys.argv + ['init',
+ '--locale', 'ja_JP',
+ '-d', os.path.join(self.datadir, 'project', 'i18n'),
+ '-i', os.path.join(self.datadir, 'project', 'i18n',
+ 'messages.pot')])
assert os.path.isfile(po_file)
self.assertEqual(
r"""# Japanese (Japan) translations for TestProject.
@@ -766,14 +801,11 @@
def test_init_more_than_2_plural_forms(self):
po_file = os.path.join(self.datadir, 'project', 'i18n', 'lv_LV',
'LC_MESSAGES', 'messages.po')
- try:
- self.cli.run(sys.argv + ['init',
- '--locale', 'lv_LV',
- '-d', os.path.join(self.datadir, 'project', 'i18n'),
- '-i', os.path.join(self.datadir, 'project', 'i18n',
- 'messages.pot')])
- except SystemExit, e:
- self.assertEqual(0, e.code)
+ self.cli.run(sys.argv + ['init',
+ '--locale', 'lv_LV',
+ '-d', os.path.join(self.datadir, 'project', 'i18n'),
+ '-i', os.path.join(self.datadir, 'project', 'i18n',
+ 'messages.pot')])
assert os.path.isfile(po_file)
self.assertEqual(
r"""# Latvian (Latvia) translations for TestProject.
|
[-]
[+]
|
Changed |
Babel-0.9.6.tar.bz2/babel/messages/tests/pofile.py
^
|
@@ -15,6 +15,7 @@
import doctest
from StringIO import StringIO
import unittest
+import sys
from babel.messages.catalog import Catalog, Message
from babel.messages import pofile
@@ -143,29 +144,39 @@
self.assertEqual(1, len(catalog))
self.assertEqual(0, len(catalog.obsolete))
- def test_singlular_plural_form(self):
+ def test_single_plural_form(self):
buf = StringIO(r'''msgid "foo"
-msgid_plural "foo"
-msgstr[0] "Voh"
-msgstr[1] "Vohs"''') # This is a bad po, ja_JP only uses msgstr[0]
+msgid_plural "foos"
+msgstr[0] "Voh"''')
catalog = pofile.read_po(buf, locale='ja_JP')
self.assertEqual(1, len(catalog))
self.assertEqual(1, catalog.num_plurals)
message = catalog['foo']
self.assertEqual(1, len(message.string))
-
+
+ def test_singular_plural_form(self):
+ buf = StringIO(r'''msgid "foo"
+msgid_plural "foos"
+msgstr[0] "Voh"
+msgstr[1] "Vohs"''')
+ catalog = pofile.read_po(buf, locale='nl_NL')
+ self.assertEqual(1, len(catalog))
+ self.assertEqual(2, catalog.num_plurals)
+ message = catalog['foo']
+ self.assertEqual(2, len(message.string))
+
def test_more_than_two_plural_forms(self):
buf = StringIO(r'''msgid "foo"
-msgid_plural "foo"
+msgid_plural "foos"
msgstr[0] "Voh"
-msgstr[1] "Vohs"''') # last translation form is missing
-#msgstr[2] "Vohss"''')
+msgstr[1] "Vohs"
+msgstr[2] "Vohss"''')
catalog = pofile.read_po(buf, locale='lv_LV')
self.assertEqual(1, len(catalog))
self.assertEqual(3, catalog.num_plurals)
message = catalog['foo']
self.assertEqual(3, len(message.string))
- self.assertEqual('', message.string[2])
+ self.assertEqual(u'Vohss', message.string[2])
def test_plural_with_square_brackets(self):
buf = StringIO(r'''msgid "foo"
@@ -269,6 +280,37 @@
#: doupy/templates/job-offers/helpers.html:22
msgid "foo"
msgstr ""''', buf.getvalue().strip())
+
+ def test_no_wrap_and_width_behaviour_on_comments(self):
+ catalog = Catalog()
+ catalog.add("Pretty dam long message id, which must really be big "
+ "to test this wrap behaviour, if not it won't work.",
+ locations=[("fake.py", n) for n in range(1, 30)])
+ buf = StringIO()
+ pofile.write_po(buf, catalog, width=None, omit_header=True)
+ self.assertEqual("""\
+#: fake.py:1 fake.py:2 fake.py:3 fake.py:4 fake.py:5 fake.py:6 fake.py:7
+#: fake.py:8 fake.py:9 fake.py:10 fake.py:11 fake.py:12 fake.py:13 fake.py:14
+#: fake.py:15 fake.py:16 fake.py:17 fake.py:18 fake.py:19 fake.py:20 fake.py:21
+#: fake.py:22 fake.py:23 fake.py:24 fake.py:25 fake.py:26 fake.py:27 fake.py:28
+#: fake.py:29
+msgid "pretty dam long message id, which must really be big to test this wrap behaviour, if not it won't work."
+msgstr ""
+
+""", buf.getvalue().lower())
+ buf = StringIO()
+ pofile.write_po(buf, catalog, width=100, omit_header=True)
+ self.assertEqual("""\
+#: fake.py:1 fake.py:2 fake.py:3 fake.py:4 fake.py:5 fake.py:6 fake.py:7 fake.py:8 fake.py:9 fake.py:10
+#: fake.py:11 fake.py:12 fake.py:13 fake.py:14 fake.py:15 fake.py:16 fake.py:17 fake.py:18 fake.py:19
+#: fake.py:20 fake.py:21 fake.py:22 fake.py:23 fake.py:24 fake.py:25 fake.py:26 fake.py:27 fake.py:28
+#: fake.py:29
+msgid ""
+"pretty dam long message id, which must really be big to test this wrap behaviour, if not it won't"
+" work."
+msgstr ""
+
+""", buf.getvalue().lower())
def test_pot_with_translator_comments(self):
catalog = Catalog()
@@ -410,7 +452,9 @@
def suite():
suite = unittest.TestSuite()
- suite.addTest(doctest.DocTestSuite(pofile))
+ is_py23 = sys.version_info[0:2] == (2, 3)
+ if not is_py23:
+ suite.addTest(doctest.DocTestSuite(pofile))
suite.addTest(unittest.makeSuite(ReadPoTestCase))
suite.addTest(unittest.makeSuite(WritePoTestCase))
return suite
|
[-]
[+]
|
Changed |
Babel-0.9.6.tar.bz2/babel/numbers.py
^
|
@@ -32,6 +32,7 @@
have_decimal = False
from babel.core import default_locale, Locale
+from babel.util import rsplit
__all__ = ['format_number', 'format_decimal', 'format_currency',
'format_percent', 'format_scientific', 'parse_number',
@@ -391,7 +392,7 @@
raise ValueError('Significant digit patterns can not contain '
'"@" or "0"')
if '.' in number:
- integer, fraction = number.rsplit('.', 1)
+ integer, fraction = rsplit(number, '.', 1)
else:
integer = number
fraction = ''
|
[-]
[+]
|
Changed |
Babel-0.9.6.tar.bz2/babel/support.py
^
|
@@ -20,16 +20,11 @@
from datetime import date, datetime, time
import gettext
-try:
- set
-except NameError:
- from sets import set
-
from babel.core import Locale
from babel.dates import format_date, format_datetime, format_time, LC_TIME
from babel.numbers import format_number, format_decimal, format_currency, \
format_percent, format_scientific, LC_NUMERIC
-from babel.util import UTC
+from babel.util import set, UTC
__all__ = ['Format', 'LazyProxy', 'Translations']
__docformat__ = 'restructuredtext en'
|
[-]
[+]
|
Changed |
Babel-0.9.6.tar.bz2/babel/tests/core.py
^
|
@@ -12,13 +12,41 @@
# history and logs, available at http://babel.edgewall.org/log/.
import doctest
+import os
import unittest
from babel import core
+from babel.core import default_locale
+
+class DefaultLocaleTest(unittest.TestCase):
+
+ def setUp(self):
+ self._old_locale_settings = self._current_locale_settings()
+
+ def tearDown(self):
+ self._set_locale_settings(self._old_locale_settings)
+
+ def _current_locale_settings(self):
+ settings = {}
+ for name in ('LANGUAGE', 'LC_ALL', 'LC_CTYPE', 'LANG'):
+ settings[name] = os.environ[name]
+ return settings
+
+ def _set_locale_settings(self, settings):
+ for name, value in settings.items():
+ os.environ[name] = value
+
+ def test_ignore_invalid_locales_in_lc_ctype(self):
+ # This is a regression test specifically for a bad LC_CTYPE setting on
+ # MacOS X 10.6 (#200)
+ os.environ['LC_CTYPE'] = 'UTF-8'
+ # must not throw an exception
+ default_locale('LC_CTYPE')
def suite():
suite = unittest.TestSuite()
suite.addTest(doctest.DocTestSuite(core))
+ suite.addTest(unittest.makeSuite(DefaultLocaleTest))
return suite
if __name__ == '__main__':
|
[-]
[+]
|
Changed |
Babel-0.9.6.tar.bz2/babel/tests/dates.py
^
|
@@ -13,11 +13,13 @@
from datetime import date, datetime, time
import doctest
+import new
import unittest
from pytz import timezone
from babel import dates
+from babel.util import FixedOffsetTimezone
class DateTimeFormatTestCase(unittest.TestCase):
@@ -247,12 +249,31 @@
"yyyy-MM-dd HH:mm", locale='en_US')
+class TimeZoneAdjustTestCase(unittest.TestCase):
+ def _utc(self):
+ UTC = FixedOffsetTimezone(0, 'UTC')
+ def fake_localize(self, dt, is_dst=False):
+ raise NotImplementedError()
+ UTC.localize = new.instancemethod(fake_localize, UTC, UTC.__class__)
+ # This is important to trigger the actual bug (#257)
+ self.assertEqual(False, hasattr(UTC, 'normalize'))
+ return UTC
+
+ def test_can_format_time_with_non_pytz_timezone(self):
+ # regression test for #257
+ utc = self._utc()
+ t = datetime(2007, 4, 1, 15, 30, tzinfo=utc)
+ formatted_time = dates.format_time(t, 'long', tzinfo=utc, locale='en')
+ self.assertEqual('3:30:00 PM +0000', formatted_time)
+
+
def suite():
suite = unittest.TestSuite()
suite.addTest(doctest.DocTestSuite(dates))
suite.addTest(unittest.makeSuite(DateTimeFormatTestCase))
suite.addTest(unittest.makeSuite(FormatDateTestCase))
suite.addTest(unittest.makeSuite(FormatTimeTestCase))
+ suite.addTest(unittest.makeSuite(TimeZoneAdjustTestCase))
return suite
if __name__ == '__main__':
|
[-]
[+]
|
Changed |
Babel-0.9.6.tar.bz2/babel/util.py
^
|
@@ -18,7 +18,7 @@
import os
import re
try:
- set
+ set = set
except NameError:
from sets import Set as set
import textwrap
@@ -269,6 +269,28 @@
rel_list = [os.path.pardir] * (len(start_list) - i) + path_list[i:]
return os.path.join(*rel_list)
+try:
+ from operator import attrgetter, itemgetter
+except ImportError:
+ def itemgetter(name):
+ def _getitem(obj):
+ return obj[name]
+ return _getitem
+
+try:
+ ''.rsplit
+ def rsplit(a_string, sep=None, maxsplit=None):
+ return a_string.rsplit(sep, maxsplit)
+except AttributeError:
+ def rsplit(a_string, sep=None, maxsplit=None):
+ parts = a_string.split(sep)
+ if maxsplit is None or len(parts) <= maxsplit:
+ return parts
+ maxsplit_index = len(parts) - maxsplit
+ non_splitted_part = sep.join(parts[:maxsplit_index])
+ splitted = parts[maxsplit_index:]
+ return [non_splitted_part] + splitted
+
ZERO = timedelta(0)
|
[-]
[+]
|
Changed |
Babel-0.9.6.tar.bz2/doc/api/api-objects.txt
^
|
@@ -144,6 +144,7 @@
babel.numbers.format_decimal babel.numbers-module.html#format_decimal
babel.numbers.get_plus_sign_symbol babel.numbers-module.html#get_plus_sign_symbol
babel.numbers.NUMBER_TOKEN babel.numbers-module.html#NUMBER_TOKEN
+babel.numbers.rsplit babel.util-module.html#rsplit
babel.numbers.PREFIX_PATTERN babel.numbers-module.html#PREFIX_PATTERN
babel.numbers.parse_number babel.numbers-module.html#parse_number
babel.numbers.format_currency babel.numbers-module.html#format_currency
@@ -173,7 +174,9 @@
babel.util.missing babel.util-module.html#missing
babel.util.STDOFFSET babel.util-module.html#STDOFFSET
babel.util.ZERO babel.util-module.html#ZERO
+babel.util.rsplit babel.util-module.html#rsplit
babel.core.Locale babel.core.Locale-class.html
+babel.core.Locale.date_formats babel.core.Locale-class.html#date_formats
babel.core.Locale.weekend_start babel.core.Locale-class.html#weekend_start
babel.core.Locale.__str__ babel.core.Locale-class.html#__str__
babel.core.Locale.zone_formats babel.core.Locale-class.html#zone_formats
@@ -192,7 +195,7 @@
babel.core.Locale.territories babel.core.Locale-class.html#territories
babel.core.Locale.first_week_day babel.core.Locale-class.html#first_week_day
babel.core.Locale.decimal_formats babel.core.Locale-class.html#decimal_formats
-babel.core.Locale.date_formats babel.core.Locale-class.html#date_formats
+babel.core.Locale.__ne__ babel.core.Locale-class.html#__ne__
babel.core.Locale.currencies babel.core.Locale-class.html#currencies
babel.core.Locale.negotiate babel.core.Locale-class.html#negotiate
babel.core.Locale.min_week_days babel.core.Locale-class.html#min_week_days
@@ -258,11 +261,12 @@
babel.messages.catalog.Message.__repr__ babel.messages.catalog.Message-class.html#__repr__
babel.messages.catalog.TranslationError babel.messages.catalog.TranslationError-class.html
babel.messages.frontend.CommandLineInterface babel.messages.frontend.CommandLineInterface-class.html
+babel.messages.frontend.CommandLineInterface._configure_logging babel.messages.frontend.CommandLineInterface-class.html#_configure_logging
babel.messages.frontend.CommandLineInterface.extract babel.messages.frontend.CommandLineInterface-class.html#extract
babel.messages.frontend.CommandLineInterface.init babel.messages.frontend.CommandLineInterface-class.html#init
+babel.messages.frontend.CommandLineInterface._help babel.messages.frontend.CommandLineInterface-class.html#_help
babel.messages.frontend.CommandLineInterface.version babel.messages.frontend.CommandLineInterface-class.html#version
babel.messages.frontend.CommandLineInterface.usage babel.messages.frontend.CommandLineInterface-class.html#usage
-babel.messages.frontend.CommandLineInterface._help babel.messages.frontend.CommandLineInterface-class.html#_help
babel.messages.frontend.CommandLineInterface.run babel.messages.frontend.CommandLineInterface-class.html#run
babel.messages.frontend.CommandLineInterface.update babel.messages.frontend.CommandLineInterface-class.html#update
babel.messages.frontend.CommandLineInterface.commands babel.messages.frontend.CommandLineInterface-class.html#commands
|
[-]
[+]
|
Changed |
Babel-0.9.6.tar.bz2/doc/api/babel-module.html
^
|
@@ -59,7 +59,7 @@
<p>This package is basically composed of two major parts:</p>
<blockquote>
<ul class="rst-simple">
-<li>tools to build and work with <tt class="rst-docutils literal"><span class="pre">gettext</span></tt> message catalogs</li>
+<li>tools to build and work with <tt class="rst-docutils literal">gettext</tt> message catalogs</li>
<li>a Python interface to the CLDR (Common Locale Data Repository), providing
access to various locale display names, localized number and date
formatting, etc.</li>
@@ -75,7 +75,7 @@
</dd>
</dl>
<p><strong>Version:</strong>
- 1.0dev-r482
+ 0.9.5
</p>
</div><!-- ==================== SUBMODULES ==================== -->
<a name="section-Submodules"></a>
@@ -90,7 +90,7 @@
<li> <strong class="uidlink"><a href="babel.core-module.html">babel.core</a></strong>: <em class="summary">Core locale representation and locale data access.</em> </li>
<li> <strong class="uidlink"><a href="babel.dates-module.html">babel.dates</a></strong>: <em class="summary">Locale dependent formatting and parsing of dates and times.</em> </li>
<li> <strong class="uidlink"><a href="babel.localedata-module.html">babel.localedata</a></strong>: <em class="summary">Low-level locale data access.</em> </li>
- <li> <strong class="uidlink"><a href="babel.messages-module.html">babel.messages</a></strong>: <em class="summary">Support for <tt class="rst-rst-docutils literal rst-docutils literal"><span class="pre">gettext</span></tt> message catalogs.</em>
+ <li> <strong class="uidlink"><a href="babel.messages-module.html">babel.messages</a></strong>: <em class="summary">Support for <tt class="rst-rst-docutils literal rst-docutils literal">gettext</tt> message catalogs.</em>
<ul>
<li> <strong class="uidlink"><a href="babel.messages.catalog-module.html">babel.messages.catalog</a></strong>: <em class="summary">Data structures for message catalogs.</em> </li>
<li> <strong class="uidlink"><a href="babel.messages.checkers-module.html">babel.messages.checkers</a></strong>: <em class="summary">Various routines that help with validation of translations.</em> </li>
@@ -98,9 +98,9 @@
<li> <strong class="uidlink"><a href="babel.messages.frontend-module.html">babel.messages.frontend</a></strong>: <em class="summary">Frontends for the message extraction functionality.</em> </li>
<li> <strong class="uidlink"><a href="babel.messages.jslexer-module.html">babel.messages.jslexer</a></strong>: <em class="summary">A simple JavaScript 1.5 lexer which is used for the JavaScript
extractor.</em> </li>
- <li> <strong class="uidlink"><a href="babel.messages.mofile-module.html">babel.messages.mofile</a></strong>: <em class="summary">Writing of files in the <tt class="rst-rst-docutils literal rst-docutils literal"><span class="pre">gettext</span></tt> MO (machine object) format.</em> </li>
+ <li> <strong class="uidlink"><a href="babel.messages.mofile-module.html">babel.messages.mofile</a></strong>: <em class="summary">Writing of files in the <tt class="rst-rst-docutils literal rst-docutils literal">gettext</tt> MO (machine object) format.</em> </li>
<li> <strong class="uidlink"><a href="babel.messages.plurals-module.html">babel.messages.plurals</a></strong>: <em class="summary">Plural form definitions.</em> </li>
- <li> <strong class="uidlink"><a href="babel.messages.pofile-module.html">babel.messages.pofile</a></strong>: <em class="summary">Reading and writing of files in the <tt class="rst-rst-docutils literal rst-docutils literal"><span class="pre">gettext</span></tt> PO (portable object)
+ <li> <strong class="uidlink"><a href="babel.messages.pofile-module.html">babel.messages.pofile</a></strong>: <em class="summary">Reading and writing of files in the <tt class="rst-rst-docutils literal rst-docutils literal">gettext</tt> PO (portable object)
format.</em> </li>
</ul>
</li>
@@ -159,7 +159,7 @@
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
- Generated by Epydoc 3.0.1 on Wed Apr 7 09:54:55 2010
+ Generated by Epydoc 3.0.1 on Thu Mar 17 15:12:44 2011
</td>
<td align="right" class="footer">
<a target="mainFrame" href="http://epydoc.sourceforge.net"
|
[-]
[+]
|
Changed |
Babel-0.9.6.tar.bz2/doc/api/babel.core-module.html
^
|
@@ -190,12 +190,12 @@
<dl class="fields">
<dt>Parameters:</dt>
<dd><ul class="nomargin-top">
- <li><strong class="pname"><code>category</code></strong> - one of the <tt class="rst-docutils literal"><span class="pre">LC_XXX</span></tt> environment variable names</li>
+ <li><strong class="pname"><code>category</code></strong> - one of the <tt class="rst-docutils literal">LC_XXX</tt> environment variable names</li>
<li><strong class="pname"><code>aliases</code></strong> - a dictionary of aliases for locale identifiers</li>
</ul></dd>
<dt>Returns: <code class="link">str</code></dt>
- <dd>the value of the variable, or any of the fallbacks (<tt class="rst-docutils literal"><span class="pre">LANGUAGE</span></tt>,
-<tt class="rst-docutils literal"><span class="pre">LC_ALL</span></tt>, <tt class="rst-docutils literal"><span class="pre">LC_CTYPE</span></tt>, and <tt class="rst-docutils literal"><span class="pre">LANG</span></tt>)</dd>
+ <dd>the value of the variable, or any of the fallbacks (<tt class="rst-docutils literal">LANGUAGE</tt>,
+<tt class="rst-docutils literal">LC_ALL</tt>, <tt class="rst-docutils literal">LC_CTYPE</tt>, and <tt class="rst-docutils literal">LANG</tt>)</dd>
</dl>
</td></tr></table>
</div>
@@ -317,7 +317,7 @@
identifier</li>
</ul></dd>
<dt>Returns: <code class="link">tuple</code></dt>
- <dd>the <tt class="rst-docutils literal"><span class="pre">(language,</span> <span class="pre">territory,</span> <span class="pre">script,</span> <span class="pre">variant)</span></tt> tuple</dd>
+ <dd>the <tt class="rst-docutils literal">(language, territory, script, variant)</tt> tuple</dd>
<dt>Raises:</dt>
<dd><ul class="nomargin-top">
<li><code><strong class='fraise'>ValueError</strong></code> - if the string does not appear to be a valid locale
@@ -361,7 +361,7 @@
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
- Generated by Epydoc 3.0.1 on Wed Apr 7 09:54:55 2010
+ Generated by Epydoc 3.0.1 on Thu Mar 17 15:12:44 2011
</td>
<td align="right" class="footer">
<a target="mainFrame" href="http://epydoc.sourceforge.net"
|
[-]
[+]
|
Changed |
Babel-0.9.6.tar.bz2/doc/api/babel.core.Locale-class.html
^
|
@@ -144,6 +144,23 @@
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
+ <td><span class="summary-sig"><a name="__ne__"></a><span class="summary-sig-name">__ne__</span>(<span class="summary-sig-arg">self</span>,
+ <span class="summary-sig-arg">other</span>)</span></td>
+ <td align="right" valign="top">
+
+
+ </td>
+ </tr>
+ </table>
+
+ </td>
+ </tr>
+<tr>
+ <td width="15%" align="right" valign="top" class="summary">
+ <span class="summary-type"> </span>
+ </td><td class="summary">
+ <table width="100%" cellpadding="0" cellspacing="0" border="0">
+ <tr>
<td><span class="summary-sig"><a href="babel.core.Locale-class.html#__repr__" class="summary-sig-name">__repr__</a>(<span class="summary-sig-arg">self</span>)</span><br />
repr(x)</td>
<td align="right" valign="top">
@@ -606,12 +623,12 @@
<dl class="fields">
<dt>Parameters:</dt>
<dd><ul class="nomargin-top">
- <li><strong class="pname"><code>category</code></strong> - one of the <tt class="rst-docutils literal"><span class="pre">LC_XXX</span></tt> environment variable names</li>
+ <li><strong class="pname"><code>category</code></strong> - one of the <tt class="rst-docutils literal">LC_XXX</tt> environment variable names</li>
<li><strong class="pname"><code>aliases</code></strong> - a dictionary of aliases for locale identifiers</li>
</ul></dd>
<dt>Returns: <a href="babel.core.Locale-class.html" class="link">Locale</a></dt>
<dd>the value of the variable, or any of the fallbacks
-(<tt class="rst-docutils literal"><span class="pre">LANGUAGE</span></tt>, <tt class="rst-docutils literal"><span class="pre">LC_ALL</span></tt>, <tt class="rst-docutils literal"><span class="pre">LC_CTYPE</span></tt>, and <tt class="rst-docutils literal"><span class="pre">LANG</span></tt>)</dd>
+(<tt class="rst-docutils literal">LANGUAGE</tt>, <tt class="rst-docutils literal">LC_ALL</tt>, <tt class="rst-docutils literal">LC_CTYPE</tt>, and <tt class="rst-docutils literal">LANG</tt>)</dd>
</dl>
<div class="fields"> <p><strong>See Also:</strong>
<a href="babel.core-module.html#default_locale" class="link">default_locale</a>
@@ -1411,7 +1428,7 @@
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
- Generated by Epydoc 3.0.1 on Wed Apr 7 09:54:56 2010
+ Generated by Epydoc 3.0.1 on Thu Mar 17 15:12:44 2011
</td>
<td align="right" class="footer">
<a target="mainFrame" href="http://epydoc.sourceforge.net"
|
[-]
[+]
|
Changed |
Babel-0.9.6.tar.bz2/doc/api/babel.core.UnknownLocaleError-class.html
^
|
@@ -212,7 +212,7 @@
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
- Generated by Epydoc 3.0.1 on Wed Apr 7 09:54:56 2010
+ Generated by Epydoc 3.0.1 on Thu Mar 17 15:12:44 2011
</td>
<td align="right" class="footer">
<a target="mainFrame" href="http://epydoc.sourceforge.net"
|
[-]
[+]
|
Changed |
Babel-0.9.6.tar.bz2/doc/api/babel.dates-module.html
^
|
@@ -60,9 +60,9 @@
following environment variables, in that order:</p>
<blockquote>
<ul class="rst-simple">
-<li><tt class="rst-docutils literal"><span class="pre">LC_TIME</span></tt>,</li>
-<li><tt class="rst-docutils literal"><span class="pre">LC_ALL</span></tt>, and</li>
-<li><tt class="rst-docutils literal"><span class="pre">LANG</span></tt></li>
+<li><tt class="rst-docutils literal">LC_TIME</tt>,</li>
+<li><tt class="rst-docutils literal">LC_ALL</tt>, and</li>
+<li><tt class="rst-docutils literal">LANG</tt></li>
</ul>
</blockquote>
@@ -83,7 +83,7 @@
<td><span class="summary-sig"><a href="babel.dates-module.html#get_timezone_name" class="summary-sig-name">get_timezone_name</a>(<span class="summary-sig-arg">dt_or_tzinfo</span>=<span class="summary-sig-default">None</span>,
<span class="summary-sig-arg">width</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string">long</code><code class="variable-quote">'</code></span>,
<span class="summary-sig-arg">uncommon</span>=<span class="summary-sig-default">False</span>,
- <span class="summary-sig-arg">locale</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string">nl_NL</code><code class="variable-quote">'</code></span>)</span><br />
+ <span class="summary-sig-arg">locale</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string">de_DE</code><code class="variable-quote">'</code></span>)</span><br />
Return the localized display name for the given timezone.</td>
<td align="right" valign="top">
@@ -102,7 +102,7 @@
<tr>
<td><span class="summary-sig"><a href="babel.dates-module.html#format_date" class="summary-sig-name">format_date</a>(<span class="summary-sig-arg">date</span>=<span class="summary-sig-default">None</span>,
<span class="summary-sig-arg">format</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string">medium</code><code class="variable-quote">'</code></span>,
- <span class="summary-sig-arg">locale</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string">nl_NL</code><code class="variable-quote">'</code></span>)</span><br />
+ <span class="summary-sig-arg">locale</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string">de_DE</code><code class="variable-quote">'</code></span>)</span><br />
Return a date formatted according to the given pattern.</td>
<td align="right" valign="top">
@@ -122,7 +122,7 @@
<td><span class="summary-sig"><a href="babel.dates-module.html#format_datetime" class="summary-sig-name">format_datetime</a>(<span class="summary-sig-arg">datetime</span>=<span class="summary-sig-default">None</span>,
<span class="summary-sig-arg">format</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string">medium</code><code class="variable-quote">'</code></span>,
<span class="summary-sig-arg">tzinfo</span>=<span class="summary-sig-default">None</span>,
- <span class="summary-sig-arg">locale</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string">nl_NL</code><code class="variable-quote">'</code></span>)</span><br />
+ <span class="summary-sig-arg">locale</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string">de_DE</code><code class="variable-quote">'</code></span>)</span><br />
Return a date formatted according to the given pattern.</td>
<td align="right" valign="top">
@@ -142,7 +142,7 @@
<td><span class="summary-sig"><a href="babel.dates-module.html#format_time" class="summary-sig-name">format_time</a>(<span class="summary-sig-arg">time</span>=<span class="summary-sig-default">None</span>,
<span class="summary-sig-arg">format</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string">medium</code><code class="variable-quote">'</code></span>,
<span class="summary-sig-arg">tzinfo</span>=<span class="summary-sig-default">None</span>,
- <span class="summary-sig-arg">locale</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string">nl_NL</code><code class="variable-quote">'</code></span>)</span><br />
+ <span class="summary-sig-arg">locale</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string">de_DE</code><code class="variable-quote">'</code></span>)</span><br />
Return a time formatted according to the given pattern.</td>
<td align="right" valign="top">
@@ -160,7 +160,7 @@
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a href="babel.dates-module.html#parse_date" class="summary-sig-name">parse_date</a>(<span class="summary-sig-arg">string</span>,
- <span class="summary-sig-arg">locale</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string">nl_NL</code><code class="variable-quote">'</code></span>)</span><br />
+ <span class="summary-sig-arg">locale</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string">de_DE</code><code class="variable-quote">'</code></span>)</span><br />
Parse a date from a string.</td>
<td align="right" valign="top">
@@ -178,7 +178,7 @@
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a href="babel.dates-module.html#parse_datetime" class="summary-sig-name">parse_datetime</a>(<span class="summary-sig-arg">string</span>,
- <span class="summary-sig-arg">locale</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string">nl_NL</code><code class="variable-quote">'</code></span>)</span><br />
+ <span class="summary-sig-arg">locale</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string">de_DE</code><code class="variable-quote">'</code></span>)</span><br />
Parse a date and time from a string.</td>
<td align="right" valign="top">
@@ -196,7 +196,7 @@
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a href="babel.dates-module.html#parse_time" class="summary-sig-name">parse_time</a>(<span class="summary-sig-arg">string</span>,
- <span class="summary-sig-arg">locale</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string">nl_NL</code><code class="variable-quote">'</code></span>)</span><br />
+ <span class="summary-sig-arg">locale</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string">de_DE</code><code class="variable-quote">'</code></span>)</span><br />
Parse a time from a string.</td>
<td align="right" valign="top">
@@ -227,7 +227,7 @@
<h3 class="epydoc"><span class="sig"><span class="sig-name">get_timezone_name</span>(<span class="sig-arg">dt_or_tzinfo</span>=<span class="sig-default">None</span>,
<span class="sig-arg">width</span>=<span class="sig-default"><code class="variable-quote">'</code><code class="variable-string">long</code><code class="variable-quote">'</code></span>,
<span class="sig-arg">uncommon</span>=<span class="sig-default">False</span>,
- <span class="sig-arg">locale</span>=<span class="sig-default"><code class="variable-quote">'</code><code class="variable-string">nl_NL</code><code class="variable-quote">'</code></span>)</span>
+ <span class="sig-arg">locale</span>=<span class="sig-default"><code class="variable-quote">'</code><code class="variable-string">de_DE</code><code class="variable-quote">'</code></span>)</span>
</h3>
</td><td align="right" valign="top"
>
@@ -235,7 +235,7 @@
</tr></table>
<p>Return the localized display name for the given timezone. The timezone
-may be specified using a <tt class="rst-docutils literal"><span class="pre">datetime</span></tt> or tzinfo object.</p>
+may be specified using a <tt class="rst-docutils literal">datetime</tt> or tzinfo object.</p>
<pre class="py-doctest">
<span class="py-prompt">>>> </span><span class="py-keyword">from</span> pytz <span class="py-keyword">import</span> timezone
<span class="py-prompt">>>> </span>dt = time(15, 30, tzinfo=timezone(<span class="py-string">'America/Los_Angeles'</span>))
@@ -270,7 +270,7 @@
<span class="py-output">u"Kanada (St. John's)"</span></pre>
<p>The <code class="link">uncommon</code> parameter can be set to <code class="link">True</code> to enable the use of timezone
representations that are not commonly used by the requested locale. For
-example, while in frensh the central europian timezone is usually
+example, while in French the central European timezone is usually
abbreviated as "HEC", in Canadian French, this abbreviation is not in
common use, so a generic name would be chosen by default:</p>
<pre class="py-doctest">
@@ -282,8 +282,8 @@
<dl class="fields">
<dt>Parameters:</dt>
<dd><ul class="nomargin-top">
- <li><strong class="pname"><code>dt_or_tzinfo</code></strong> - the <tt class="rst-docutils literal"><span class="pre">datetime</span></tt> or <tt class="rst-docutils literal"><span class="pre">tzinfo</span></tt> object that determines
-the timezone; if a <tt class="rst-docutils literal"><span class="pre">tzinfo</span></tt> object is used, the
+ <li><strong class="pname"><code>dt_or_tzinfo</code></strong> - the <tt class="rst-docutils literal">datetime</tt> or <tt class="rst-docutils literal">tzinfo</tt> object that determines
+the timezone; if a <tt class="rst-docutils literal">tzinfo</tt> object is used, the
resulting display name will be generic, i.e.
independent of daylight savings time; if <code class="link">None</code>, the
current date in UTC is assumed</li>
@@ -311,7 +311,7 @@
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">format_date</span>(<span class="sig-arg">date</span>=<span class="sig-default">None</span>,
<span class="sig-arg">format</span>=<span class="sig-default"><code class="variable-quote">'</code><code class="variable-string">medium</code><code class="variable-quote">'</code></span>,
- <span class="sig-arg">locale</span>=<span class="sig-default"><code class="variable-quote">'</code><code class="variable-string">nl_NL</code><code class="variable-quote">'</code></span>)</span>
+ <span class="sig-arg">locale</span>=<span class="sig-default"><code class="variable-quote">'</code><code class="variable-string">de_DE</code><code class="variable-quote">'</code></span>)</span>
</h3>
</td><td align="right" valign="top"
>
@@ -333,7 +333,7 @@
<dl class="fields">
<dt>Parameters:</dt>
<dd><ul class="nomargin-top">
- <li><strong class="pname"><code>date</code></strong> - the <tt class="rst-docutils literal"><span class="pre">date</span></tt> or <tt class="rst-docutils literal"><span class="pre">datetime</span></tt> object; if <code class="link">None</code>, the current
+ <li><strong class="pname"><code>date</code></strong> - the <tt class="rst-docutils literal">date</tt> or <tt class="rst-docutils literal">datetime</tt> object; if <code class="link">None</code>, the current
date is used</li>
<li><strong class="pname"><code>format</code></strong> - one of "full", "long", "medium", or "short", or a custom
date/time pattern</li>
@@ -344,8 +344,8 @@
<div class="fields"> <p><strong>Note:</strong>
If the pattern contains time fields, an <code class="link">AttributeError</code> will be
raised when trying to apply the formatting. This is also true if
-the value of <tt class="rst-docutils literal"><span class="pre">date</span></tt> parameter is actually a <tt class="rst-docutils literal"><span class="pre">datetime</span></tt> object,
-as this function automatically converts that to a <tt class="rst-docutils literal"><span class="pre">date</span></tt>.
+the value of <tt class="rst-docutils literal">date</tt> parameter is actually a <tt class="rst-docutils literal">datetime</tt> object,
+as this function automatically converts that to a <tt class="rst-docutils literal">date</tt>.
</p>
</div></td></tr></table>
</div>
@@ -359,7 +359,7 @@
<h3 class="epydoc"><span class="sig"><span class="sig-name">format_datetime</span>(<span class="sig-arg">datetime</span>=<span class="sig-default">None</span>,
<span class="sig-arg">format</span>=<span class="sig-default"><code class="variable-quote">'</code><code class="variable-string">medium</code><code class="variable-quote">'</code></span>,
<span class="sig-arg">tzinfo</span>=<span class="sig-default">None</span>,
- <span class="sig-arg">locale</span>=<span class="sig-default"><code class="variable-quote">'</code><code class="variable-string">nl_NL</code><code class="variable-quote">'</code></span>)</span>
+ <span class="sig-arg">locale</span>=<span class="sig-default"><code class="variable-quote">'</code><code class="variable-string">de_DE</code><code class="variable-quote">'</code></span>)</span>
</h3>
</td><td align="right" valign="top"
>
@@ -372,7 +372,7 @@
<span class="py-prompt">>>> </span>format_datetime(dt, locale=<span class="py-string">'en_US'</span>)
<span class="py-output">u'Apr 1, 2007 3:30:00 PM'</span></pre>
<p>For any pattern requiring the display of the time-zone, the third-party
-<tt class="rst-docutils literal"><span class="pre">pytz</span></tt> package is needed to explicitly specify the time-zone:</p>
+<tt class="rst-docutils literal">pytz</tt> package is needed to explicitly specify the time-zone:</p>
<pre class="py-doctest">
<span class="py-prompt">>>> </span><span class="py-keyword">from</span> pytz <span class="py-keyword">import</span> timezone
<span class="py-prompt">>>> </span>format_datetime(dt, <span class="py-string">'full'</span>, tzinfo=timezone(<span class="py-string">'Europe/Paris'</span>),
@@ -405,7 +405,7 @@
<h3 class="epydoc"><span class="sig"><span class="sig-name">format_time</span>(<span class="sig-arg">time</span>=<span class="sig-default">None</span>,
<span class="sig-arg">format</span>=<span class="sig-default"><code class="variable-quote">'</code><code class="variable-string">medium</code><code class="variable-quote">'</code></span>,
<span class="sig-arg">tzinfo</span>=<span class="sig-default">None</span>,
- <span class="sig-arg">locale</span>=<span class="sig-default"><code class="variable-quote">'</code><code class="variable-string">nl_NL</code><code class="variable-quote">'</code></span>)</span>
+ <span class="sig-arg">locale</span>=<span class="sig-default"><code class="variable-quote">'</code><code class="variable-string">de_DE</code><code class="variable-quote">'</code></span>)</span>
</h3>
</td><td align="right" valign="top"
>
@@ -425,7 +425,7 @@
<span class="py-prompt">>>> </span>format_time(t, <span class="py-string">"hh 'o''clock' a"</span>, locale=<span class="py-string">'en'</span>)
<span class="py-output">u"03 o'clock PM"</span></pre>
<p>For any pattern requiring the display of the time-zone, the third-party
-<tt class="rst-docutils literal"><span class="pre">pytz</span></tt> package is needed to explicitly specify the time-zone:</p>
+<tt class="rst-docutils literal">pytz</tt> package is needed to explicitly specify the time-zone:</p>
<pre class="py-doctest">
<span class="py-prompt">>>> </span><span class="py-keyword">from</span> pytz <span class="py-keyword">import</span> timezone
<span class="py-prompt">>>> </span>t = datetime(2007, 4, 1, 15, 30)
@@ -437,12 +437,12 @@
<span class="py-more">... </span> locale=<span class="py-string">'en'</span>)
<span class="py-output">u"09 o'clock AM, Eastern Daylight Time"</span></pre>
<p>As that example shows, when this function gets passed a
-<tt class="rst-docutils literal"><span class="pre">datetime.datetime</span></tt> value, the actual time in the formatted string is
+<tt class="rst-docutils literal">datetime.datetime</tt> value, the actual time in the formatted string is
adjusted to the timezone specified by the tzinfo parameter. If the
-<tt class="rst-docutils literal"><span class="pre">datetime</span></tt> is "naive" (i.e. it has no associated timezone information),
+<tt class="rst-docutils literal">datetime</tt> is "naive" (i.e. it has no associated timezone information),
it is assumed to be in UTC.</p>
<p>These timezone calculations are <strong>not</strong> performed if the value is of type
-<tt class="rst-docutils literal"><span class="pre">datetime.time</span></tt>, as without date information there's no way to determine
+<tt class="rst-docutils literal">datetime.time</tt>, as without date information there's no way to determine
what a given time would translate to in a different timezone without
information about whether daylight savings time is in effect or not. This
means that time values are left as-is, and the value of the tzinfo
@@ -458,7 +458,7 @@
<dl class="fields">
<dt>Parameters:</dt>
<dd><ul class="nomargin-top">
- <li><strong class="pname"><code>time</code></strong> - the <tt class="rst-docutils literal"><span class="pre">time</span></tt> or <tt class="rst-docutils literal"><span class="pre">datetime</span></tt> object; if <code class="link">None</code>, the current
+ <li><strong class="pname"><code>time</code></strong> - the <tt class="rst-docutils literal">time</tt> or <tt class="rst-docutils literal">datetime</tt> object; if <code class="link">None</code>, the current
time in UTC is used</li>
<li><strong class="pname"><code>format</code></strong> - one of "full", "long", "medium", or "short", or a custom
date/time pattern</li>
@@ -470,8 +470,8 @@
<div class="fields"> <p><strong>Note:</strong>
If the pattern contains date fields, an <code class="link">AttributeError</code> will be
raised when trying to apply the formatting. This is also true if
-the value of <tt class="rst-docutils literal"><span class="pre">time</span></tt> parameter is actually a <tt class="rst-docutils literal"><span class="pre">datetime</span></tt> object,
-as this function automatically converts that to a <tt class="rst-docutils literal"><span class="pre">time</span></tt>.
+the value of <tt class="rst-docutils literal">time</tt> parameter is actually a <tt class="rst-docutils literal">datetime</tt> object,
+as this function automatically converts that to a <tt class="rst-docutils literal">time</tt>.
</p>
</div></td></tr></table>
</div>
@@ -483,7 +483,7 @@
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">parse_date</span>(<span class="sig-arg">string</span>,
- <span class="sig-arg">locale</span>=<span class="sig-default"><code class="variable-quote">'</code><code class="variable-string">nl_NL</code><code class="variable-quote">'</code></span>)</span>
+ <span class="sig-arg">locale</span>=<span class="sig-default"><code class="variable-quote">'</code><code class="variable-string">de_DE</code><code class="variable-quote">'</code></span>)</span>
</h3>
</td><td align="right" valign="top"
>
@@ -517,7 +517,7 @@
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">parse_datetime</span>(<span class="sig-arg">string</span>,
- <span class="sig-arg">locale</span>=<span class="sig-default"><code class="variable-quote">'</code><code class="variable-string">nl_NL</code><code class="variable-quote">'</code></span>)</span>
+ <span class="sig-arg">locale</span>=<span class="sig-default"><code class="variable-quote">'</code><code class="variable-string">de_DE</code><code class="variable-quote">'</code></span>)</span>
</h3>
</td><td align="right" valign="top"
>
@@ -546,7 +546,7 @@
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">parse_time</span>(<span class="sig-arg">string</span>,
- <span class="sig-arg">locale</span>=<span class="sig-default"><code class="variable-quote">'</code><code class="variable-string">nl_NL</code><code class="variable-quote">'</code></span>)</span>
+ <span class="sig-arg">locale</span>=<span class="sig-default"><code class="variable-quote">'</code><code class="variable-string">de_DE</code><code class="variable-quote">'</code></span>)</span>
</h3>
</td><td align="right" valign="top"
>
@@ -602,7 +602,7 @@
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
- Generated by Epydoc 3.0.1 on Wed Apr 7 09:54:55 2010
+ Generated by Epydoc 3.0.1 on Thu Mar 17 15:12:44 2011
</td>
<td align="right" class="footer">
<a target="mainFrame" href="http://epydoc.sourceforge.net"
|
[-]
[+]
|
Changed |
Babel-0.9.6.tar.bz2/doc/api/babel.localedata-module.html
^
|
@@ -201,7 +201,7 @@
<p>Load the locale data for the given locale.</p>
<p>The locale data is a dictionary that contains much of the data defined by
the Common Locale Data Repository (CLDR). This data is stored as a
-collection of pickle files inside the <tt class="rst-docutils literal"><span class="pre">babel</span></tt> package.</p>
+collection of pickle files inside the <tt class="rst-docutils literal">babel</tt> package.</p>
<pre class="py-doctest">
<span class="py-prompt">>>> </span>d = load(<span class="py-string">'en_US'</span>)
<span class="py-prompt">>>> </span>d[<span class="py-string">'languages'</span>][<span class="py-string">'sv'</span>]
@@ -262,7 +262,7 @@
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
- Generated by Epydoc 3.0.1 on Wed Apr 7 09:54:55 2010
+ Generated by Epydoc 3.0.1 on Thu Mar 17 15:12:44 2011
</td>
<td align="right" class="footer">
<a target="mainFrame" href="http://epydoc.sourceforge.net"
|
[-]
[+]
|
Changed |
Babel-0.9.6.tar.bz2/doc/api/babel.messages-module.html
^
|
@@ -55,7 +55,7 @@
</table>
<!-- ==================== PACKAGE DESCRIPTION ==================== -->
<h1 class="epydoc">Package messages</h1><p class="nomargin-top"></p>
-Support for <tt class="rst-rst-rst-docutils literal rst-rst-docutils literal rst-docutils literal"><span class="pre">gettext</span></tt> message catalogs.
+Support for <tt class="rst-rst-rst-docutils literal rst-rst-docutils literal rst-docutils literal">gettext</tt> message catalogs.
<!-- ==================== SUBMODULES ==================== -->
<a name="section-Submodules"></a>
@@ -73,9 +73,9 @@
<li> <strong class="uidlink"><a href="babel.messages.frontend-module.html">babel.messages.frontend</a></strong>: <em class="summary">Frontends for the message extraction functionality.</em> </li>
<li> <strong class="uidlink"><a href="babel.messages.jslexer-module.html">babel.messages.jslexer</a></strong>: <em class="summary">A simple JavaScript 1.5 lexer which is used for the JavaScript
extractor.</em> </li>
- <li> <strong class="uidlink"><a href="babel.messages.mofile-module.html">babel.messages.mofile</a></strong>: <em class="summary">Writing of files in the <tt class="rst-rst-rst-docutils literal rst-rst-docutils literal rst-docutils literal"><span class="pre">gettext</span></tt> MO (machine object) format.</em> </li>
+ <li> <strong class="uidlink"><a href="babel.messages.mofile-module.html">babel.messages.mofile</a></strong>: <em class="summary">Writing of files in the <tt class="rst-rst-rst-docutils literal rst-rst-docutils literal rst-docutils literal">gettext</tt> MO (machine object) format.</em> </li>
<li> <strong class="uidlink"><a href="babel.messages.plurals-module.html">babel.messages.plurals</a></strong>: <em class="summary">Plural form definitions.</em> </li>
- <li> <strong class="uidlink"><a href="babel.messages.pofile-module.html">babel.messages.pofile</a></strong>: <em class="summary">Reading and writing of files in the <tt class="rst-rst-rst-docutils literal rst-rst-docutils literal rst-docutils literal"><span class="pre">gettext</span></tt> PO (portable object)
+ <li> <strong class="uidlink"><a href="babel.messages.pofile-module.html">babel.messages.pofile</a></strong>: <em class="summary">Reading and writing of files in the <tt class="rst-rst-rst-docutils literal rst-rst-docutils literal rst-docutils literal">gettext</tt> PO (portable object)
format.</em> </li>
</ul></td></tr>
</table>
@@ -128,7 +128,7 @@
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
- Generated by Epydoc 3.0.1 on Wed Apr 7 09:54:55 2010
+ Generated by Epydoc 3.0.1 on Thu Mar 17 15:12:44 2011
</td>
<td align="right" class="footer">
<a target="mainFrame" href="http://epydoc.sourceforge.net"
|
[-]
[+]
|
Changed |
Babel-0.9.6.tar.bz2/doc/api/babel.messages.catalog-module.html
^
|
@@ -123,7 +123,7 @@
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
- Generated by Epydoc 3.0.1 on Wed Apr 7 09:54:55 2010
+ Generated by Epydoc 3.0.1 on Thu Mar 17 15:12:44 2011
</td>
<td align="right" class="footer">
<a target="mainFrame" href="http://epydoc.sourceforge.net"
|
[-]
[+]
|
Changed |
Babel-0.9.6.tar.bz2/doc/api/babel.messages.catalog.Catalog-class.html
^
|
@@ -141,7 +141,7 @@
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
- <span class="summary-type"><tt class="rst-docutils literal"><span class="pre">iterator</span></tt></span>
+ <span class="summary-type"><tt class="rst-docutils literal">iterator</tt></span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
@@ -256,7 +256,7 @@
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
- <span class="summary-type"><tt class="rst-docutils literal"><span class="pre">iterator</span></tt></span>
+ <span class="summary-type"><tt class="rst-docutils literal">iterator</tt></span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
@@ -418,7 +418,7 @@
<span class="summary-type"><code class="link">list</code></span>
</td><td class="summary">
<a href="babel.messages.catalog.Catalog-class.html#mime_headers" class="summary-name">mime_headers</a><br />
- The MIME headers of the catalog, used for the special <tt class="rst-docutils literal"><span class="pre">msgid</span> <span class="pre">""</span></tt> entry.
+ The MIME headers of the catalog, used for the special <tt class="rst-docutils literal">msgid ""</tt> entry.
</td>
</tr>
<tr>
@@ -534,7 +534,7 @@
</tr></table>
<p>The number of messages in the catalog.</p>
-<p>This does not include the special <tt class="rst-docutils literal"><span class="pre">msgid</span> <span class="pre">""</span></tt> entry.</p>
+<p>This does not include the special <tt class="rst-docutils literal">msgid ""</tt> entry.</p>
<dl class="fields">
</dl>
</td></tr></table>
@@ -666,15 +666,15 @@
<dl class="fields">
<dt>Parameters:</dt>
<dd><ul class="nomargin-top">
- <li><strong class="pname"><code>id</code></strong> - the message ID, or a <tt class="rst-docutils literal"><span class="pre">(singular,</span> <span class="pre">plural)</span></tt> tuple for
+ <li><strong class="pname"><code>id</code></strong> - the message ID, or a <tt class="rst-docutils literal">(singular, plural)</tt> tuple for
pluralizable messages</li>
<li><strong class="pname"><code>string</code></strong> - the translated message string, or a
-<tt class="rst-docutils literal"><span class="pre">(singular,</span> <span class="pre">plural)</span></tt> tuple for pluralizable messages</li>
- <li><strong class="pname"><code>locations</code></strong> - a sequence of <tt class="rst-docutils literal"><span class="pre">(filenname,</span> <span class="pre">lineno)</span></tt> tuples</li>
+<tt class="rst-docutils literal">(singular, plural)</tt> tuple for pluralizable messages</li>
+ <li><strong class="pname"><code>locations</code></strong> - a sequence of <tt class="rst-docutils literal">(filenname, lineno)</tt> tuples</li>
<li><strong class="pname"><code>flags</code></strong> - a set or sequence of flags</li>
<li><strong class="pname"><code>auto_comments</code></strong> - a sequence of automatic comments</li>
<li><strong class="pname"><code>user_comments</code></strong> - a sequence of user comments</li>
- <li><strong class="pname"><code>previous_id</code></strong> - the previous message ID, or a <tt class="rst-docutils literal"><span class="pre">(singular,</span> <span class="pre">plural)</span></tt>
+ <li><strong class="pname"><code>previous_id</code></strong> - the previous message ID, or a <tt class="rst-docutils literal">(singular, plural)</tt>
tuple for pluralizable messages</li>
<li><strong class="pname"><code>lineno</code></strong> - the line number on which the msgid line was found in the
PO file, if any</li>
@@ -698,10 +698,10 @@
<p>Run various validation checks on the translations in the catalog.</p>
<p>For every message which fails validation, this method yield a
-<tt class="rst-docutils literal"><span class="pre">(message,</span> <span class="pre">errors)</span></tt> tuple, where <tt class="rst-docutils literal"><span class="pre">message</span></tt> is the <a href="babel.messages.catalog.Message-class.html" class="link">Message</a> object
-and <tt class="rst-docutils literal"><span class="pre">errors</span></tt> is a sequence of <a href="babel.messages.catalog.TranslationError-class.html" class="link">TranslationError</a> objects.</p>
+<tt class="rst-docutils literal">(message, errors)</tt> tuple, where <tt class="rst-docutils literal">message</tt> is the <a href="babel.messages.catalog.Message-class.html" class="link">Message</a> object
+and <tt class="rst-docutils literal">errors</tt> is a sequence of <a href="babel.messages.catalog.TranslationError-class.html" class="link">TranslationError</a> objects.</p>
<dl class="fields">
- <dt>Returns: <tt class="rst-rst-docutils literal rst-docutils literal"><span class="pre">iterator</span></tt></dt>
+ <dt>Returns: <tt class="rst-rst-docutils literal rst-docutils literal">iterator</tt></dt>
</dl>
</td></tr></table>
</div>
@@ -833,7 +833,7 @@
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<h3 class="epydoc">mime_headers</h3>
- <p>The MIME headers of the catalog, used for the special <tt class="rst-rst-docutils literal rst-docutils literal"><span class="pre">msgid</span> <span class="pre">""</span></tt> entry.</p>
+ <p>The MIME headers of the catalog, used for the special <tt class="rst-rst-docutils literal rst-docutils literal">msgid ""</tt> entry.</p>
<p>The behavior of this property changes slightly depending on whether a locale
is set or not, the latter indicating that the catalog is actually a template
for actual translations.</p>
@@ -982,7 +982,7 @@
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
- Generated by Epydoc 3.0.1 on Wed Apr 7 09:54:56 2010
+ Generated by Epydoc 3.0.1 on Thu Mar 17 15:12:44 2011
</td>
<td align="right" class="footer">
<a target="mainFrame" href="http://epydoc.sourceforge.net"
|
[-]
[+]
|
Changed |
Babel-0.9.6.tar.bz2/doc/api/babel.messages.catalog.Message-class.html
^
|
@@ -152,7 +152,7 @@
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
- <span class="summary-type"><tt class="rst-docutils literal"><span class="pre">iterator</span></tt></span>
+ <span class="summary-type"><tt class="rst-docutils literal">iterator</tt></span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
@@ -287,15 +287,15 @@
<dl class="fields">
<dt>Parameters:</dt>
<dd><ul class="nomargin-top">
- <li><strong class="pname"><code>id</code></strong> - the message ID, or a <tt class="rst-docutils literal"><span class="pre">(singular,</span> <span class="pre">plural)</span></tt> tuple for
+ <li><strong class="pname"><code>id</code></strong> - the message ID, or a <tt class="rst-docutils literal">(singular, plural)</tt> tuple for
pluralizable messages</li>
<li><strong class="pname"><code>string</code></strong> - the translated message string, or a
-<tt class="rst-docutils literal"><span class="pre">(singular,</span> <span class="pre">plural)</span></tt> tuple for pluralizable messages</li>
- <li><strong class="pname"><code>locations</code></strong> - a sequence of <tt class="rst-docutils literal"><span class="pre">(filenname,</span> <span class="pre">lineno)</span></tt> tuples</li>
+<tt class="rst-docutils literal">(singular, plural)</tt> tuple for pluralizable messages</li>
+ <li><strong class="pname"><code>locations</code></strong> - a sequence of <tt class="rst-docutils literal">(filenname, lineno)</tt> tuples</li>
<li><strong class="pname"><code>flags</code></strong> - a set or sequence of flags</li>
<li><strong class="pname"><code>auto_comments</code></strong> - a sequence of automatic comments for the message</li>
<li><strong class="pname"><code>user_comments</code></strong> - a sequence of user comments for the message</li>
- <li><strong class="pname"><code>previous_id</code></strong> - the previous message ID, or a <tt class="rst-docutils literal"><span class="pre">(singular,</span> <span class="pre">plural)</span></tt>
+ <li><strong class="pname"><code>previous_id</code></strong> - the previous message ID, or a <tt class="rst-docutils literal">(singular, plural)</tt>
tuple for pluralizable messages</li>
<li><strong class="pname"><code>lineno</code></strong> - the line number on which the msgid line was found in the
PO file, if any</li>
@@ -353,7 +353,7 @@
<dd><ul class="nomargin-top">
<li><strong class="pname"><code>catalog</code></strong> - A catalog instance that is passed to the checkers</li>
</ul></dd>
- <dt>Returns: <tt class="rst-rst-docutils literal rst-docutils literal"><span class="pre">iterator</span></tt></dt>
+ <dt>Returns: <tt class="rst-rst-docutils literal rst-docutils literal">iterator</tt></dt>
</dl>
<div class="fields"> <p><strong>See Also:</strong>
<a href="babel.messages.catalog.Catalog-class.html#check" class="link">Catalog.check</a> for a way to perform checks for all messages
@@ -469,7 +469,7 @@
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
- Generated by Epydoc 3.0.1 on Wed Apr 7 09:54:56 2010
+ Generated by Epydoc 3.0.1 on Thu Mar 17 15:12:44 2011
</td>
<td align="right" class="footer">
<a target="mainFrame" href="http://epydoc.sourceforge.net"
|
[-]
[+]
|
Changed |
Babel-0.9.6.tar.bz2/doc/api/babel.messages.catalog.TranslationError-class.html
^
|
@@ -158,7 +158,7 @@
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
- Generated by Epydoc 3.0.1 on Wed Apr 7 09:54:56 2010
+ Generated by Epydoc 3.0.1 on Thu Mar 17 15:12:44 2011
</td>
<td align="right" class="footer">
<a target="mainFrame" href="http://epydoc.sourceforge.net"
|
[-]
[+]
|
Changed |
Babel-0.9.6.tar.bz2/doc/api/babel.messages.checkers-module.html
^
|
@@ -161,7 +161,7 @@
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
- Generated by Epydoc 3.0.1 on Wed Apr 7 09:54:55 2010
+ Generated by Epydoc 3.0.1 on Thu Mar 17 15:12:44 2011
</td>
<td align="right" class="footer">
<a target="mainFrame" href="http://epydoc.sourceforge.net"
|
[-]
[+]
|
Changed |
Babel-0.9.6.tar.bz2/doc/api/babel.messages.frontend-module.html
^
|
@@ -71,7 +71,7 @@
<span class="summary-type"> </span>
</td><td class="summary">
<a href="babel.messages.frontend.compile_catalog-class.html" class="summary-name">compile_catalog</a><br />
- Catalog compilation command for use in <tt class="rst-rst-docutils literal rst-docutils literal"><span class="pre">setup.py</span></tt> scripts.
+ Catalog compilation command for use in <tt class="rst-rst-docutils literal rst-docutils literal">setup.py</tt> scripts.
</td>
</tr>
<tr>
@@ -79,7 +79,7 @@
<span class="summary-type"> </span>
</td><td class="summary">
<a href="babel.messages.frontend.extract_messages-class.html" class="summary-name">extract_messages</a><br />
- Message extraction command for use in <tt class="rst-rst-docutils literal rst-docutils literal"><span class="pre">setup.py</span></tt> scripts.
+ Message extraction command for use in <tt class="rst-rst-docutils literal rst-docutils literal">setup.py</tt> scripts.
</td>
</tr>
<tr>
@@ -87,7 +87,7 @@
<span class="summary-type"> </span>
</td><td class="summary">
<a href="babel.messages.frontend.init_catalog-class.html" class="summary-name">init_catalog</a><br />
- New catalog initialization command for use in <tt class="rst-rst-docutils literal rst-docutils literal"><span class="pre">setup.py</span></tt> scripts.
+ New catalog initialization command for use in <tt class="rst-rst-docutils literal rst-docutils literal">setup.py</tt> scripts.
</td>
</tr>
<tr>
@@ -95,7 +95,7 @@
<span class="summary-type"> </span>
</td><td class="summary">
<a href="babel.messages.frontend.update_catalog-class.html" class="summary-name">update_catalog</a><br />
- Catalog merging command for use in <tt class="rst-rst-docutils literal rst-docutils literal"><span class="pre">setup.py</span></tt> scripts.
+ Catalog merging command for use in <tt class="rst-rst-docutils literal rst-docutils literal">setup.py</tt> scripts.
</td>
</tr>
<tr>
@@ -124,7 +124,7 @@
<td><span class="summary-sig"><a href="babel.messages.frontend-module.html#check_message_extractors" class="summary-sig-name">check_message_extractors</a>(<span class="summary-sig-arg">dist</span>,
<span class="summary-sig-arg">name</span>,
<span class="summary-sig-arg">value</span>)</span><br />
- Validate the <tt class="rst-docutils literal"><span class="pre">message_extractors</span></tt> keyword argument to <tt class="rst-docutils literal"><span class="pre">setup()</span></tt>.</td>
+ Validate the <tt class="rst-docutils literal">message_extractors</tt> keyword argument to <tt class="rst-docutils literal">setup()</tt>.</td>
<td align="right" valign="top">
@@ -160,11 +160,11 @@
</td>
</tr></table>
- Validate the <tt class="rst-rst-docutils literal rst-docutils literal"><span class="pre">message_extractors</span></tt> keyword argument to <tt class="rst-rst-docutils literal rst-docutils literal"><span class="pre">setup()</span></tt>.
+ Validate the <tt class="rst-rst-docutils literal rst-docutils literal">message_extractors</tt> keyword argument to <tt class="rst-rst-docutils literal rst-docutils literal">setup()</tt>.
<dl class="fields">
<dt>Parameters:</dt>
<dd><ul class="nomargin-top">
- <li><strong class="pname"><code>dist</code></strong> - the distutils/setuptools <tt class="rst-docutils literal"><span class="pre">Distribution</span></tt> object</li>
+ <li><strong class="pname"><code>dist</code></strong> - the distutils/setuptools <tt class="rst-docutils literal">Distribution</tt> object</li>
<li><strong class="pname"><code>name</code></strong> - the name of the keyword argument (should always be
"message_extractors")</li>
<li><strong class="pname"><code>value</code></strong> - the value of the keyword argument</li>
@@ -211,7 +211,7 @@
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
- Generated by Epydoc 3.0.1 on Wed Apr 7 09:54:55 2010
+ Generated by Epydoc 3.0.1 on Thu Mar 17 15:12:44 2011
</td>
<td align="right" class="footer">
<a target="mainFrame" href="http://epydoc.sourceforge.net"
|
[-]
[+]
|
Changed |
Babel-0.9.6.tar.bz2/doc/api/babel.messages.frontend.CommandLineInterface-class.html
^
|
@@ -206,7 +206,7 @@
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
- <a name="version"></a><span class="summary-name">version</span> = <code title="'%prog 1.0dev-r482'"><code class="variable-quote">'</code><code class="variable-string">%prog 1.0dev-r482</code><code class="variable-quote">'</code></code>
+ <a name="version"></a><span class="summary-name">version</span> = <code title="'%prog 0.9.5'"><code class="variable-quote">'</code><code class="variable-string">%prog 0.9.5</code><code class="variable-quote">'</code></code>
</td>
</tr>
<tr>
@@ -437,7 +437,7 @@
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
- Generated by Epydoc 3.0.1 on Wed Apr 7 09:54:56 2010
+ Generated by Epydoc 3.0.1 on Thu Mar 17 15:12:44 2011
</td>
<td align="right" class="footer">
<a target="mainFrame" href="http://epydoc.sourceforge.net"
|
[-]
[+]
|
Changed |
Babel-0.9.6.tar.bz2/doc/api/babel.messages.frontend.compile_catalog-class.html
^
|
@@ -64,10 +64,10 @@
</pre>
<hr />
-<p>Catalog compilation command for use in <tt class="rst-rst-rst-docutils literal rst-rst-docutils literal rst-docutils literal"><span class="pre">setup.py</span></tt> scripts.</p>
+<p>Catalog compilation command for use in <tt class="rst-rst-rst-docutils literal rst-rst-docutils literal rst-docutils literal">setup.py</tt> scripts.</p>
<p>If correctly installed, this command is available to Setuptools-using
-setup scripts automatically. For projects using plain old <tt class="rst-docutils literal"><span class="pre">distutils</span></tt>,
-the command needs to be registered explicitly in <tt class="rst-docutils literal"><span class="pre">setup.py</span></tt>:</p>
+setup scripts automatically. For projects using plain old <tt class="rst-docutils literal">distutils</tt>,
+the command needs to be registered explicitly in <tt class="rst-docutils literal">setup.py</tt>:</p>
<pre class="rst-literal-block">
from babel.messages.frontend import compile_catalog
@@ -393,7 +393,7 @@
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
- Generated by Epydoc 3.0.1 on Wed Apr 7 09:54:56 2010
+ Generated by Epydoc 3.0.1 on Thu Mar 17 15:12:44 2011
</td>
<td align="right" class="footer">
<a target="mainFrame" href="http://epydoc.sourceforge.net"
|
[-]
[+]
|
Changed |
Babel-0.9.6.tar.bz2/doc/api/babel.messages.frontend.init_catalog-class.html
^
|
@@ -64,10 +64,10 @@
</pre>
<hr />
-<p>New catalog initialization command for use in <tt class="rst-rst-rst-docutils literal rst-rst-docutils literal rst-docutils literal"><span class="pre">setup.py</span></tt> scripts.</p>
+<p>New catalog initialization command for use in <tt class="rst-rst-rst-docutils literal rst-rst-docutils literal rst-docutils literal">setup.py</tt> scripts.</p>
<p>If correctly installed, this command is available to Setuptools-using
-setup scripts automatically. For projects using plain old <tt class="rst-docutils literal"><span class="pre">distutils</span></tt>,
-the command needs to be registered explicitly in <tt class="rst-docutils literal"><span class="pre">setup.py</span></tt>:</p>
+setup scripts automatically. For projects using plain old <tt class="rst-docutils literal">distutils</tt>,
+the command needs to be registered explicitly in <tt class="rst-docutils literal">setup.py</tt>:</p>
<pre class="rst-literal-block">
from babel.messages.frontend import init_catalog
@@ -381,7 +381,7 @@
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
- Generated by Epydoc 3.0.1 on Wed Apr 7 09:54:56 2010
+ Generated by Epydoc 3.0.1 on Thu Mar 17 15:12:44 2011
</td>
<td align="right" class="footer">
<a target="mainFrame" href="http://epydoc.sourceforge.net"
|
[-]
[+]
|
Changed |
Babel-0.9.6.tar.bz2/doc/api/babel.messages.frontend.update_catalog-class.html
^
|
@@ -64,10 +64,10 @@
</pre>
<hr />
-<p>Catalog merging command for use in <tt class="rst-rst-rst-docutils literal rst-rst-docutils literal rst-docutils literal"><span class="pre">setup.py</span></tt> scripts.</p>
+<p>Catalog merging command for use in <tt class="rst-rst-rst-docutils literal rst-rst-docutils literal rst-docutils literal">setup.py</tt> scripts.</p>
<p>If correctly installed, this command is available to Setuptools-using
-setup scripts automatically. For projects using plain old <tt class="rst-docutils literal"><span class="pre">distutils</span></tt>,
-the command needs to be registered explicitly in <tt class="rst-docutils literal"><span class="pre">setup.py</span></tt>:</p>
+setup scripts automatically. For projects using plain old <tt class="rst-docutils literal">distutils</tt>,
+the command needs to be registered explicitly in <tt class="rst-docutils literal">setup.py</tt>:</p>
<pre class="rst-literal-block">
from babel.messages.frontend import update_catalog
@@ -411,7 +411,7 @@
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
- Generated by Epydoc 3.0.1 on Wed Apr 7 09:54:57 2010
+ Generated by Epydoc 3.0.1 on Thu Mar 17 15:12:45 2011
</td>
<td align="right" class="footer">
<a target="mainFrame" href="http://epydoc.sourceforge.net"
|
[-]
[+]
|
Changed |
Babel-0.9.6.tar.bz2/doc/api/babel.messages.jslexer-module.html
^
|
@@ -249,7 +249,7 @@
</tr></table>
Unquote a string with JavaScript rules. The string has to start with
-string delimiters (<tt class="rst-docutils literal"><span class="pre">'</span></tt> or <tt class="rst-docutils literal"><span class="pre">"</span></tt>.)
+string delimiters (<tt class="rst-docutils literal">'</tt> or <tt class="rst-docutils literal">"</tt>.)
<dl class="fields">
<dt>Returns:</dt>
<dd>a string</dd>
@@ -407,7 +407,7 @@
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
- Generated by Epydoc 3.0.1 on Wed Apr 7 09:54:55 2010
+ Generated by Epydoc 3.0.1 on Thu Mar 17 15:12:44 2011
</td>
<td align="right" class="footer">
<a target="mainFrame" href="http://epydoc.sourceforge.net"
|
[-]
[+]
|
Changed |
Babel-0.9.6.tar.bz2/doc/api/babel.messages.jslexer.Token-class.html
^
|
@@ -242,7 +242,7 @@
<dl class="fields">
<dt>Get Method:</dt>
<dd class="value"><table><tr><td><pre class="variable">
-<operator.itemgetter object at 0x29569b4c>
+<operator.itemgetter object at 0x2b74550>
</pre></td></tr></table>
</dd>
@@ -262,7 +262,7 @@
<dl class="fields">
<dt>Get Method:</dt>
<dd class="value"><table><tr><td><pre class="variable">
-<operator.itemgetter object at 0x2956936c>
+<operator.itemgetter object at 0x2b74590>
</pre></td></tr></table>
</dd>
@@ -282,7 +282,7 @@
<dl class="fields">
<dt>Get Method:</dt>
<dd class="value"><table><tr><td><pre class="variable">
-<operator.itemgetter object at 0x29569fac>
+<operator.itemgetter object at 0x2b745d0>
</pre></td></tr></table>
</dd>
@@ -321,7 +321,7 @@
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
- Generated by Epydoc 3.0.1 on Wed Apr 7 09:54:57 2010
+ Generated by Epydoc 3.0.1 on Thu Mar 17 15:12:45 2011
</td>
<td align="right" class="footer">
<a target="mainFrame" href="http://epydoc.sourceforge.net"
|
[-]
[+]
|
Changed |
Babel-0.9.6.tar.bz2/doc/api/babel.messages.mofile-module.html
^
|
@@ -56,7 +56,7 @@
</table>
<!-- ==================== MODULE DESCRIPTION ==================== -->
<h1 class="epydoc">Module mofile</h1><p class="nomargin-top"></p>
-Writing of files in the <tt class="rst-rst-rst-rst-docutils literal rst-rst-rst-docutils literal rst-rst-docutils literal rst-docutils literal"><span class="pre">gettext</span></tt> MO (machine object) format.
+Writing of files in the <tt class="rst-rst-rst-rst-docutils literal rst-rst-rst-docutils literal rst-rst-docutils literal rst-docutils literal">gettext</tt> MO (machine object) format.
<hr />
<div class="fields"> <p><strong>Since:</strong>
@@ -194,7 +194,7 @@
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
- Generated by Epydoc 3.0.1 on Wed Apr 7 09:54:55 2010
+ Generated by Epydoc 3.0.1 on Thu Mar 17 15:12:44 2011
</td>
<td align="right" class="footer">
<a target="mainFrame" href="http://epydoc.sourceforge.net"
|
[-]
[+]
|
Changed |
Babel-0.9.6.tar.bz2/doc/api/babel.messages.plurals-module.html
^
|
@@ -72,7 +72,7 @@
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
- <td><span class="summary-sig"><a href="babel.messages.plurals-module.html#get_plural" class="summary-sig-name">get_plural</a>(<span class="summary-sig-arg">locale</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string">en_US</code><code class="variable-quote">'</code></span>)</span><br />
+ <td><span class="summary-sig"><a href="babel.messages.plurals-module.html#get_plural" class="summary-sig-name">get_plural</a>(<span class="summary-sig-arg">locale</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string">de_DE</code><code class="variable-quote">'</code></span>)</span><br />
A tuple with the information catalogs need to perform proper
pluralization.</td>
<td align="right" valign="top">
@@ -97,7 +97,7 @@
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
- <a name="LC_CTYPE"></a><span class="summary-name">LC_CTYPE</span> = <code title="'en_US'"><code class="variable-quote">'</code><code class="variable-string">en_US</code><code class="variable-quote">'</code></code>
+ <a name="LC_CTYPE"></a><span class="summary-name">LC_CTYPE</span> = <code title="'de_DE'"><code class="variable-quote">'</code><code class="variable-string">de_DE</code><code class="variable-quote">'</code></code>
</td>
</tr>
<tr>
@@ -146,7 +146,7 @@
<tr><td>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td>
- <h3 class="epydoc"><span class="sig"><span class="sig-name">get_plural</span>(<span class="sig-arg">locale</span>=<span class="sig-default"><code class="variable-quote">'</code><code class="variable-string">en_US</code><code class="variable-quote">'</code></span>)</span>
+ <h3 class="epydoc"><span class="sig"><span class="sig-name">get_plural</span>(<span class="sig-arg">locale</span>=<span class="sig-default"><code class="variable-quote">'</code><code class="variable-string">de_DE</code><code class="variable-quote">'</code></span>)</span>
</h3>
</td><td align="right" valign="top"
>
@@ -247,7 +247,7 @@
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
- Generated by Epydoc 3.0.1 on Wed Apr 7 09:54:55 2010
+ Generated by Epydoc 3.0.1 on Thu Mar 17 15:12:44 2011
</td>
<td align="right" class="footer">
<a target="mainFrame" href="http://epydoc.sourceforge.net"
|
[-]
[+]
|
Changed |
Babel-0.9.6.tar.bz2/doc/api/babel.messages.pofile-module.html
^
|
@@ -56,7 +56,7 @@
</table>
<!-- ==================== MODULE DESCRIPTION ==================== -->
<h1 class="epydoc">Module pofile</h1><p class="nomargin-top"></p>
-Reading and writing of files in the <tt class="rst-rst-rst-rst-docutils literal rst-rst-rst-docutils literal rst-rst-docutils literal rst-docutils literal"><span class="pre">gettext</span></tt> PO (portable object)
+Reading and writing of files in the <tt class="rst-rst-rst-rst-docutils literal rst-rst-rst-docutils literal rst-rst-docutils literal rst-docutils literal">gettext</tt> PO (portable object)
format.
<hr />
@@ -73,7 +73,7 @@
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
- <span class="summary-type"><tt class="rst-docutils literal"><span class="pre">iterator</span></tt></span>
+ <span class="summary-type"><tt class="rst-docutils literal">iterator</tt></span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
@@ -81,7 +81,7 @@
<span class="summary-sig-arg">locale</span>=<span class="summary-sig-default">None</span>,
<span class="summary-sig-arg">domain</span>=<span class="summary-sig-default">None</span>,
<span class="summary-sig-arg">ignore_obsolete</span>=<span class="summary-sig-default">False</span>)</span><br />
- Read messages from a <tt class="rst-docutils literal"><span class="pre">gettext</span></tt> PO (portable object) file from the given
+ Read messages from a <tt class="rst-docutils literal">gettext</tt> PO (portable object) file from the given
file-like object and return a <a href="babel.messages.catalog.Catalog-class.html" class="link">Catalog</a>.</td>
<td align="right" valign="top">
@@ -107,7 +107,7 @@
<span class="summary-sig-arg">sort_by_file</span>=<span class="summary-sig-default">False</span>,
<span class="summary-sig-arg">ignore_obsolete</span>=<span class="summary-sig-default">False</span>,
<span class="summary-sig-arg">include_previous</span>=<span class="summary-sig-default">False</span>)</span><br />
- Write a <tt class="rst-docutils literal"><span class="pre">gettext</span></tt> PO (portable object) template file for a given
+ Write a <tt class="rst-docutils literal">gettext</tt> PO (portable object) template file for a given
message catalog to the provided file-like object.</td>
<td align="right" valign="top">
@@ -145,7 +145,7 @@
</td>
</tr></table>
- <p>Read messages from a <tt class="rst-rst-docutils literal rst-docutils literal"><span class="pre">gettext</span></tt> PO (portable object) file from the given
+ <p>Read messages from a <tt class="rst-rst-docutils literal rst-docutils literal">gettext</tt> PO (portable object) file from the given
file-like object and return a <a href="babel.messages.catalog.Catalog-class.html" class="link">Catalog</a>.</p>
<pre class="py-doctest">
<span class="py-prompt">>>> </span><span class="py-keyword">from</span> StringIO <span class="py-keyword">import</span> StringIO
@@ -187,8 +187,8 @@
<li><strong class="pname"><code>domain</code></strong> - the message domain</li>
<li><strong class="pname"><code>ignore_obsolete</code></strong> - whether to ignore obsolete messages in the input</li>
</ul></dd>
- <dt>Returns: <tt class="rst-rst-docutils literal rst-docutils literal"><span class="pre">iterator</span></tt></dt>
- <dd>an iterator over <tt class="rst-docutils literal"><span class="pre">(message,</span> <span class="pre">translation,</span> <span class="pre">location)</span></tt> tuples</dd>
+ <dt>Returns: <tt class="rst-rst-docutils literal rst-docutils literal">iterator</tt></dt>
+ <dd>an iterator over <tt class="rst-docutils literal">(message, translation, location)</tt> tuples</dd>
</dl>
</td></tr></table>
</div>
@@ -214,7 +214,7 @@
</td>
</tr></table>
- <p>Write a <tt class="rst-rst-docutils literal rst-docutils literal"><span class="pre">gettext</span></tt> PO (portable object) template file for a given
+ <p>Write a <tt class="rst-rst-docutils literal rst-docutils literal">gettext</tt> PO (portable object) template file for a given
message catalog to the provided file-like object.</p>
<pre class="py-doctest">
<span class="py-prompt">>>> </span>catalog = Catalog()
@@ -245,7 +245,7 @@
<li><strong class="pname"><code>width</code></strong> - the maximum line width for the generated output; use <code class="link">None</code>,
0, or a negative number to completely disable line wrapping</li>
<li><strong class="pname"><code>no_location</code></strong> - do not emit a location comment for every message</li>
- <li><strong class="pname"><code>omit_header</code></strong> - do not include the <tt class="rst-docutils literal"><span class="pre">msgid</span> <span class="pre">""</span></tt> entry at the top of the
+ <li><strong class="pname"><code>omit_header</code></strong> - do not include the <tt class="rst-docutils literal">msgid ""</tt> entry at the top of the
output</li>
<li><strong class="pname"><code>sort_output</code></strong> - whether to sort the messages in the output by msgid</li>
<li><strong class="pname"><code>sort_by_file</code></strong> - whether to sort the messages in the output by their
@@ -291,7 +291,7 @@
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
- Generated by Epydoc 3.0.1 on Wed Apr 7 09:54:55 2010
+ Generated by Epydoc 3.0.1 on Thu Mar 17 15:12:44 2011
</td>
<td align="right" class="footer">
<a target="mainFrame" href="http://epydoc.sourceforge.net"
|
[-]
[+]
|
Changed |
Babel-0.9.6.tar.bz2/doc/api/babel.numbers-module.html
^
|
@@ -60,9 +60,9 @@
following environment variables, in that order:</p>
<blockquote>
<ul class="rst-simple">
-<li><tt class="rst-docutils literal"><span class="pre">LC_NUMERIC</span></tt>,</li>
-<li><tt class="rst-docutils literal"><span class="pre">LC_ALL</span></tt>, and</li>
-<li><tt class="rst-docutils literal"><span class="pre">LANG</span></tt></li>
+<li><tt class="rst-docutils literal">LC_NUMERIC</tt>,</li>
+<li><tt class="rst-docutils literal">LC_ALL</tt>, and</li>
+<li><tt class="rst-docutils literal">LANG</tt></li>
</ul>
</blockquote>
@@ -98,7 +98,7 @@
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a href="babel.numbers-module.html#format_number" class="summary-sig-name">format_number</a>(<span class="summary-sig-arg">number</span>,
- <span class="summary-sig-arg">locale</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string">nl_NL</code><code class="variable-quote">'</code></span>)</span><br />
+ <span class="summary-sig-arg">locale</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string">de_DE</code><code class="variable-quote">'</code></span>)</span><br />
Return the given number formatted for a specific locale.</td>
<td align="right" valign="top">
@@ -117,7 +117,7 @@
<tr>
<td><span class="summary-sig"><a href="babel.numbers-module.html#format_decimal" class="summary-sig-name">format_decimal</a>(<span class="summary-sig-arg">number</span>,
<span class="summary-sig-arg">format</span>=<span class="summary-sig-default">None</span>,
- <span class="summary-sig-arg">locale</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string">nl_NL</code><code class="variable-quote">'</code></span>)</span><br />
+ <span class="summary-sig-arg">locale</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string">de_DE</code><code class="variable-quote">'</code></span>)</span><br />
Return the given decimal number formatted for a specific locale.</td>
<td align="right" valign="top">
@@ -137,7 +137,7 @@
<td><span class="summary-sig"><a href="babel.numbers-module.html#format_currency" class="summary-sig-name">format_currency</a>(<span class="summary-sig-arg">number</span>,
<span class="summary-sig-arg">currency</span>,
<span class="summary-sig-arg">format</span>=<span class="summary-sig-default">None</span>,
- <span class="summary-sig-arg">locale</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string">nl_NL</code><code class="variable-quote">'</code></span>)</span><br />
+ <span class="summary-sig-arg">locale</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string">de_DE</code><code class="variable-quote">'</code></span>)</span><br />
Return formatted currency value.</td>
<td align="right" valign="top">
@@ -156,7 +156,7 @@
<tr>
<td><span class="summary-sig"><a href="babel.numbers-module.html#format_percent" class="summary-sig-name">format_percent</a>(<span class="summary-sig-arg">number</span>,
<span class="summary-sig-arg">format</span>=<span class="summary-sig-default">None</span>,
- <span class="summary-sig-arg">locale</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string">nl_NL</code><code class="variable-quote">'</code></span>)</span><br />
+ <span class="summary-sig-arg">locale</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string">de_DE</code><code class="variable-quote">'</code></span>)</span><br />
Return formatted percent value for a specific locale.</td>
<td align="right" valign="top">
@@ -175,7 +175,7 @@
<tr>
<td><span class="summary-sig"><a href="babel.numbers-module.html#format_scientific" class="summary-sig-name">format_scientific</a>(<span class="summary-sig-arg">number</span>,
<span class="summary-sig-arg">format</span>=<span class="summary-sig-default">None</span>,
- <span class="summary-sig-arg">locale</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string">nl_NL</code><code class="variable-quote">'</code></span>)</span><br />
+ <span class="summary-sig-arg">locale</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string">de_DE</code><code class="variable-quote">'</code></span>)</span><br />
Return value formatted in scientific notation for a specific locale.</td>
<td align="right" valign="top">
@@ -193,7 +193,7 @@
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a href="babel.numbers-module.html#parse_number" class="summary-sig-name">parse_number</a>(<span class="summary-sig-arg">string</span>,
- <span class="summary-sig-arg">locale</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string">nl_NL</code><code class="variable-quote">'</code></span>)</span><br />
+ <span class="summary-sig-arg">locale</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string">de_DE</code><code class="variable-quote">'</code></span>)</span><br />
Parse localized number string into a long integer.</td>
<td align="right" valign="top">
@@ -211,7 +211,7 @@
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a href="babel.numbers-module.html#parse_decimal" class="summary-sig-name">parse_decimal</a>(<span class="summary-sig-arg">string</span>,
- <span class="summary-sig-arg">locale</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string">nl_NL</code><code class="variable-quote">'</code></span>)</span><br />
+ <span class="summary-sig-arg">locale</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string">de_DE</code><code class="variable-quote">'</code></span>)</span><br />
Parse localized decimal string into a float.</td>
<td align="right" valign="top">
@@ -240,7 +240,7 @@
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">format_number</span>(<span class="sig-arg">number</span>,
- <span class="sig-arg">locale</span>=<span class="sig-default"><code class="variable-quote">'</code><code class="variable-string">nl_NL</code><code class="variable-quote">'</code></span>)</span>
+ <span class="sig-arg">locale</span>=<span class="sig-default"><code class="variable-quote">'</code><code class="variable-string">de_DE</code><code class="variable-quote">'</code></span>)</span>
</h3>
</td><td align="right" valign="top"
>
@@ -271,7 +271,7 @@
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">format_decimal</span>(<span class="sig-arg">number</span>,
<span class="sig-arg">format</span>=<span class="sig-default">None</span>,
- <span class="sig-arg">locale</span>=<span class="sig-default"><code class="variable-quote">'</code><code class="variable-string">nl_NL</code><code class="variable-quote">'</code></span>)</span>
+ <span class="sig-arg">locale</span>=<span class="sig-default"><code class="variable-quote">'</code><code class="variable-string">de_DE</code><code class="variable-quote">'</code></span>)</span>
</h3>
</td><td align="right" valign="top"
>
@@ -317,7 +317,7 @@
<h3 class="epydoc"><span class="sig"><span class="sig-name">format_currency</span>(<span class="sig-arg">number</span>,
<span class="sig-arg">currency</span>,
<span class="sig-arg">format</span>=<span class="sig-default">None</span>,
- <span class="sig-arg">locale</span>=<span class="sig-default"><code class="variable-quote">'</code><code class="variable-string">nl_NL</code><code class="variable-quote">'</code></span>)</span>
+ <span class="sig-arg">locale</span>=<span class="sig-default"><code class="variable-quote">'</code><code class="variable-string">de_DE</code><code class="variable-quote">'</code></span>)</span>
</h3>
</td><td align="right" valign="top"
>
@@ -357,7 +357,7 @@
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">format_percent</span>(<span class="sig-arg">number</span>,
<span class="sig-arg">format</span>=<span class="sig-default">None</span>,
- <span class="sig-arg">locale</span>=<span class="sig-default"><code class="variable-quote">'</code><code class="variable-string">nl_NL</code><code class="variable-quote">'</code></span>)</span>
+ <span class="sig-arg">locale</span>=<span class="sig-default"><code class="variable-quote">'</code><code class="variable-string">de_DE</code><code class="variable-quote">'</code></span>)</span>
</h3>
</td><td align="right" valign="top"
>
@@ -397,7 +397,7 @@
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">format_scientific</span>(<span class="sig-arg">number</span>,
<span class="sig-arg">format</span>=<span class="sig-default">None</span>,
- <span class="sig-arg">locale</span>=<span class="sig-default"><code class="variable-quote">'</code><code class="variable-string">nl_NL</code><code class="variable-quote">'</code></span>)</span>
+ <span class="sig-arg">locale</span>=<span class="sig-default"><code class="variable-quote">'</code><code class="variable-string">de_DE</code><code class="variable-quote">'</code></span>)</span>
</h3>
</td><td align="right" valign="top"
>
@@ -432,7 +432,7 @@
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">parse_number</span>(<span class="sig-arg">string</span>,
- <span class="sig-arg">locale</span>=<span class="sig-default"><code class="variable-quote">'</code><code class="variable-string">nl_NL</code><code class="variable-quote">'</code></span>)</span>
+ <span class="sig-arg">locale</span>=<span class="sig-default"><code class="variable-quote">'</code><code class="variable-string">de_DE</code><code class="variable-quote">'</code></span>)</span>
</h3>
</td><td align="right" valign="top"
>
@@ -474,7 +474,7 @@
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">parse_decimal</span>(<span class="sig-arg">string</span>,
- <span class="sig-arg">locale</span>=<span class="sig-default"><code class="variable-quote">'</code><code class="variable-string">nl_NL</code><code class="variable-quote">'</code></span>)</span>
+ <span class="sig-arg">locale</span>=<span class="sig-default"><code class="variable-quote">'</code><code class="variable-string">de_DE</code><code class="variable-quote">'</code></span>)</span>
</h3>
</td><td align="right" valign="top"
>
@@ -541,7 +541,7 @@
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
- Generated by Epydoc 3.0.1 on Wed Apr 7 09:54:56 2010
+ Generated by Epydoc 3.0.1 on Thu Mar 17 15:12:44 2011
</td>
<td align="right" class="footer">
<a target="mainFrame" href="http://epydoc.sourceforge.net"
|
[-]
[+]
|
Changed |
Babel-0.9.6.tar.bz2/doc/api/babel.numbers.NumberFormatError-class.html
^
|
@@ -160,7 +160,7 @@
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
- Generated by Epydoc 3.0.1 on Wed Apr 7 09:54:57 2010
+ Generated by Epydoc 3.0.1 on Thu Mar 17 15:12:45 2011
</td>
<td align="right" class="footer">
<a target="mainFrame" href="http://epydoc.sourceforge.net"
|
[-]
[+]
|
Changed |
Babel-0.9.6.tar.bz2/doc/api/babel.support-module.html
^
|
@@ -125,7 +125,7 @@
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
- Generated by Epydoc 3.0.1 on Wed Apr 7 09:54:56 2010
+ Generated by Epydoc 3.0.1 on Thu Mar 17 15:12:44 2011
</td>
<td align="right" class="footer">
<a target="mainFrame" href="http://epydoc.sourceforge.net"
|
[-]
[+]
|
Changed |
Babel-0.9.6.tar.bz2/doc/api/babel.support.Format-class.html
^
|
@@ -571,7 +571,7 @@
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
- Generated by Epydoc 3.0.1 on Wed Apr 7 09:54:57 2010
+ Generated by Epydoc 3.0.1 on Thu Mar 17 15:12:45 2011
</td>
<td align="right" class="footer">
<a target="mainFrame" href="http://epydoc.sourceforge.net"
|
[-]
[+]
|
Changed |
Babel-0.9.6.tar.bz2/doc/api/babel.support.LazyProxy-class.html
^
|
@@ -769,7 +769,7 @@
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
- Generated by Epydoc 3.0.1 on Wed Apr 7 09:54:57 2010
+ Generated by Epydoc 3.0.1 on Thu Mar 17 15:12:45 2011
</td>
<td align="right" class="footer">
<a target="mainFrame" href="http://epydoc.sourceforge.net"
|
[-]
[+]
|
Changed |
Babel-0.9.6.tar.bz2/doc/api/babel.support.Translations-class.html
^
|
@@ -159,7 +159,7 @@
<td><span class="summary-sig"><a name="dgettext"></a><span class="summary-sig-name">dgettext</span>(<span class="summary-sig-arg">self</span>,
<span class="summary-sig-arg">domain</span>,
<span class="summary-sig-arg">message</span>)</span><br />
- Like <tt class="rst-docutils literal"><span class="pre">gettext()</span></tt>, but look the message up in the specified
+ Like <tt class="rst-docutils literal">gettext()</tt>, but look the message up in the specified
domain.</td>
<td align="right" valign="top">
@@ -179,7 +179,7 @@
<td><span class="summary-sig"><a name="ldgettext"></a><span class="summary-sig-name">ldgettext</span>(<span class="summary-sig-arg">self</span>,
<span class="summary-sig-arg">domain</span>,
<span class="summary-sig-arg">message</span>)</span><br />
- Like <tt class="rst-docutils literal"><span class="pre">lgettext()</span></tt>, but look the message up in the specified
+ Like <tt class="rst-docutils literal">lgettext()</tt>, but look the message up in the specified
domain.</td>
<td align="right" valign="top">
@@ -199,7 +199,7 @@
<td><span class="summary-sig"><a name="dugettext"></a><span class="summary-sig-name">dugettext</span>(<span class="summary-sig-arg">self</span>,
<span class="summary-sig-arg">domain</span>,
<span class="summary-sig-arg">message</span>)</span><br />
- Like <tt class="rst-docutils literal"><span class="pre">ugettext()</span></tt>, but look the message up in the specified
+ Like <tt class="rst-docutils literal">ugettext()</tt>, but look the message up in the specified
domain.</td>
<td align="right" valign="top">
@@ -221,7 +221,7 @@
<span class="summary-sig-arg">singular</span>,
<span class="summary-sig-arg">plural</span>,
<span class="summary-sig-arg">num</span>)</span><br />
- Like <tt class="rst-docutils literal"><span class="pre">ngettext()</span></tt>, but look the message up in the specified
+ Like <tt class="rst-docutils literal">ngettext()</tt>, but look the message up in the specified
domain.</td>
<td align="right" valign="top">
@@ -243,7 +243,7 @@
<span class="summary-sig-arg">singular</span>,
<span class="summary-sig-arg">plural</span>,
<span class="summary-sig-arg">num</span>)</span><br />
- Like <tt class="rst-docutils literal"><span class="pre">lngettext()</span></tt>, but look the message up in the specified
+ Like <tt class="rst-docutils literal">lngettext()</tt>, but look the message up in the specified
domain.</td>
<td align="right" valign="top">
@@ -265,7 +265,7 @@
<span class="summary-sig-arg">singular</span>,
<span class="summary-sig-arg">plural</span>,
<span class="summary-sig-arg">num</span>)</span><br />
- Like <tt class="rst-docutils literal"><span class="pre">ungettext()</span></tt> but look the message up in the specified
+ Like <tt class="rst-docutils literal">ungettext()</tt> but look the message up in the specified
domain.</td>
<td align="right" valign="top">
@@ -440,14 +440,14 @@
<dl class="fields">
<dt>Parameters:</dt>
<dd><ul class="nomargin-top">
- <li><strong class="pname"><code>dirname</code></strong> - the directory containing the <tt class="rst-docutils literal"><span class="pre">MO</span></tt> files</li>
+ <li><strong class="pname"><code>dirname</code></strong> - the directory containing the <tt class="rst-docutils literal">MO</tt> files</li>
<li><strong class="pname"><code>locales</code></strong> - the list of locales in order of preference (items in
this list can be either <a href="babel.core.Locale-class.html" class="link">Locale</a> objects or locale
strings)</li>
<li><strong class="pname"><code>domain</code></strong> - the message domain</li>
</ul></dd>
<dt>Returns: <a href="babel.support.Translations-class.html" class="link">Translations</a></dt>
- <dd>the loaded catalog, or a <tt class="rst-docutils literal"><span class="pre">NullTranslations</span></tt> instance if no
+ <dd>the loaded catalog, or a <tt class="rst-docutils literal">NullTranslations</tt> instance if no
matching translations were found</dd>
</dl>
</td></tr></table>
@@ -495,7 +495,7 @@
<p>Add the given translations to the catalog.</p>
<p>If the domain of the translations is different than that of the
current catalog, they are added as a catalog that is only accessible
-by the various <tt class="rst-docutils literal"><span class="pre">d*gettext</span></tt> functions.</p>
+by the various <tt class="rst-docutils literal">d*gettext</tt> functions.</p>
<dl class="fields">
<dt>Parameters:</dt>
<dd><ul class="nomargin-top">
@@ -506,7 +506,7 @@
translations</li>
</ul></dd>
<dt>Returns: <a href="babel.support.Translations-class.html" class="link">Translations</a></dt>
- <dd>the <a href="babel.support.Translations-class.html" class="link">Translations</a> instance (<tt class="rst-docutils literal"><span class="pre">self</span></tt>) so that <a href="babel.support.Translations-class.html#merge" class="link">merge</a> calls
+ <dd>the <a href="babel.support.Translations-class.html" class="link">Translations</a> instance (<tt class="rst-docutils literal">self</tt>) so that <a href="babel.support.Translations-class.html#merge" class="link">merge</a> calls
can be easily chained</dd>
</dl>
</td></tr></table>
@@ -536,7 +536,7 @@
merge</li>
</ul></dd>
<dt>Returns: <a href="babel.support.Translations-class.html" class="link">Translations</a></dt>
- <dd>the <a href="babel.support.Translations-class.html" class="link">Translations</a> instance (<tt class="rst-docutils literal"><span class="pre">self</span></tt>) so that <a href="babel.support.Translations-class.html#merge" class="link">merge</a> calls
+ <dd>the <a href="babel.support.Translations-class.html" class="link">Translations</a> instance (<tt class="rst-docutils literal">self</tt>) so that <a href="babel.support.Translations-class.html#merge" class="link">merge</a> calls
can be easily chained</dd>
</dl>
</td></tr></table>
@@ -573,7 +573,7 @@
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
- Generated by Epydoc 3.0.1 on Wed Apr 7 09:54:57 2010
+ Generated by Epydoc 3.0.1 on Thu Mar 17 15:12:45 2011
</td>
<td align="right" class="footer">
<a target="mainFrame" href="http://epydoc.sourceforge.net"
|
[-]
[+]
|
Changed |
Babel-0.9.6.tar.bz2/doc/api/babel.util-module.html
^
|
@@ -84,7 +84,7 @@
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
- <span class="summary-type"><tt class="rst-docutils literal"><span class="pre">iterator</span></tt></span>
+ <span class="summary-type"><tt class="rst-docutils literal">iterator</tt></span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
@@ -127,7 +127,7 @@
<span class="summary-sig-arg">width</span>=<span class="summary-sig-default">70</span>,
<span class="summary-sig-arg">initial_indent</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string"></code><code class="variable-quote">'</code></span>,
<span class="summary-sig-arg">subsequent_indent</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string"></code><code class="variable-quote">'</code></span>)</span><br />
- Simple wrapper around the <tt class="rst-docutils literal"><span class="pre">textwrap.wrap</span></tt> function in the standard
+ Simple wrapper around the <tt class="rst-docutils literal">textwrap.wrap</tt> function in the standard
library.</td>
<td align="right" valign="top">
@@ -218,7 +218,7 @@
<dd><ul class="nomargin-top">
<li><strong class="pname"><code>iterable</code></strong> - the iterable collection providing the data</li>
</ul></dd>
- <dt>Returns: <tt class="rst-rst-docutils literal rst-docutils literal"><span class="pre">iterator</span></tt></dt>
+ <dt>Returns: <tt class="rst-rst-docutils literal rst-docutils literal">iterator</tt></dt>
<dd>the distinct items in the collection</dd>
</dl>
</td></tr></table>
@@ -239,7 +239,7 @@
</tr></table>
<p>Extended pathname pattern matching.</p>
-<p>This function is similar to what is provided by the <tt class="rst-docutils literal"><span class="pre">fnmatch</span></tt> module in
+<p>This function is similar to what is provided by the <tt class="rst-docutils literal">fnmatch</tt> module in
the Python standard library, but:</p>
<blockquote>
<ul class="rst-simple">
@@ -290,7 +290,7 @@
</td>
</tr></table>
- Simple wrapper around the <tt class="rst-rst-docutils literal rst-docutils literal"><span class="pre">textwrap.wrap</span></tt> function in the standard
+ Simple wrapper around the <tt class="rst-rst-docutils literal rst-docutils literal">textwrap.wrap</tt> function in the standard
library. This version does not wrap lines on hyphens in words.
<dl class="fields">
<dt>Parameters:</dt>
@@ -339,7 +339,7 @@
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
- Generated by Epydoc 3.0.1 on Wed Apr 7 09:54:56 2010
+ Generated by Epydoc 3.0.1 on Thu Mar 17 15:12:44 2011
</td>
<td align="right" class="footer">
<a target="mainFrame" href="http://epydoc.sourceforge.net"
|
[-]
[+]
|
Changed |
Babel-0.9.6.tar.bz2/doc/api/babel.util.odict-class.html
^
|
@@ -376,7 +376,10 @@
<code>__sizeof__</code>,
<code>fromkeys</code>,
<code>get</code>,
- <code>has_key</code>
+ <code>has_key</code>,
+ <code>viewitems</code>,
+ <code>viewkeys</code>,
+ <code>viewvalues</code>
</p>
<p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
<code>__delattr__</code>,
@@ -864,7 +867,7 @@
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
- Generated by Epydoc 3.0.1 on Wed Apr 7 09:54:57 2010
+ Generated by Epydoc 3.0.1 on Thu Mar 17 15:12:45 2011
</td>
<td align="right" class="footer">
<a target="mainFrame" href="http://epydoc.sourceforge.net"
|
[-]
[+]
|
Changed |
Babel-0.9.6.tar.bz2/doc/api/class-tree.html
^
|
@@ -59,16 +59,16 @@
of the Distutils.</em>
<ul>
<li> <strong class="uidlink"><a href="babel.messages.frontend.compile_catalog-class.html">babel.messages.frontend.compile_catalog</a></strong>:
- <em class="summary">Catalog compilation command for use in <tt class="rst-docutils literal"><span class="pre">setup.py</span></tt> scripts.</em>
+ <em class="summary">Catalog compilation command for use in <tt class="rst-docutils literal">setup.py</tt> scripts.</em>
</li>
<li> <strong class="uidlink"><a href="babel.messages.frontend.extract_messages-class.html">babel.messages.frontend.extract_messages</a></strong>:
- <em class="summary">Message extraction command for use in <tt class="rst-docutils literal"><span class="pre">setup.py</span></tt> scripts.</em>
+ <em class="summary">Message extraction command for use in <tt class="rst-docutils literal">setup.py</tt> scripts.</em>
</li>
<li> <strong class="uidlink"><a href="babel.messages.frontend.init_catalog-class.html">babel.messages.frontend.init_catalog</a></strong>:
- <em class="summary">New catalog initialization command for use in <tt class="rst-docutils literal"><span class="pre">setup.py</span></tt> scripts.</em>
+ <em class="summary">New catalog initialization command for use in <tt class="rst-docutils literal">setup.py</tt> scripts.</em>
</li>
<li> <strong class="uidlink"><a href="babel.messages.frontend.update_catalog-class.html">babel.messages.frontend.update_catalog</a></strong>:
- <em class="summary">Catalog merging command for use in <tt class="rst-docutils literal"><span class="pre">setup.py</span></tt> scripts.</em>
+ <em class="summary">Catalog merging command for use in <tt class="rst-docutils literal">setup.py</tt> scripts.</em>
</li>
</ul>
</li>
@@ -142,7 +142,15 @@
<em class="summary">An extended translation catalog class.</em>
</li>
<li> <strong class="uidlink">dict</strong>:
- <em class="summary">dict() -> new empty dictionary.</em>
+ <em class="summary">dict() -> new empty dictionary
+dict(mapping) -> new dictionary initialized from a mapping object's
+ (key, value) pairs
+dict(iterable) -> new dictionary initialized as if via:
+ d = {}
+ for k, v in iterable:
+ d[k] = v
+dict(**kwargs) -> new dictionary initialized with the name=value pairs
+ in the keyword argument list.</em>
<ul>
<li> <strong class="uidlink"><a href="babel.util.odict-class.html">babel.util.odict</a></strong>:
<em class="summary">Ordered dict implementation.</em>
@@ -150,8 +158,8 @@
</ul>
</li>
<li> <strong class="uidlink">tuple</strong>:
- <em class="summary">tuple() -> an empty tuple
-tuple(sequence) -> tuple initialized from sequence's items</em>
+ <em class="summary">tuple() -> empty tuple
+tuple(iterable) -> tuple initialized from iterable's items</em>
<ul>
<li> <strong class="uidlink"><a href="babel.messages.jslexer.Token-class.html">babel.messages.jslexer.Token</a></strong>:
<em class="summary">Represents a token as returned by <a href="babel.messages.jslexer-module.html#tokenize" class="link">tokenize</a>.</em>
@@ -192,7 +200,7 @@
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
- Generated by Epydoc 3.0.1 on Wed Apr 7 09:54:55 2010
+ Generated by Epydoc 3.0.1 on Thu Mar 17 15:12:44 2011
</td>
<td align="right" class="footer">
<a target="mainFrame" href="http://epydoc.sourceforge.net"
|
[-]
[+]
|
Changed |
Babel-0.9.6.tar.bz2/doc/api/help.html
^
|
@@ -250,7 +250,7 @@
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
- Generated by Epydoc 3.0.1 on Wed Apr 7 09:54:55 2010
+ Generated by Epydoc 3.0.1 on Thu Mar 17 15:12:44 2011
</td>
<td align="right" class="footer">
<a target="mainFrame" href="http://epydoc.sourceforge.net"
|
[-]
[+]
|
Changed |
Babel-0.9.6.tar.bz2/doc/api/identifier-index.html
^
|
@@ -846,91 +846,99 @@
<span class="index-where">(in <a href="babel.support.LazyProxy-class.html">LazyProxy</a>)</span></td>
<td width="33%" class="link-index"><a href="babel.support.LazyProxy-class.html#__iter__">__iter__()</a><br />
<span class="index-where">(in <a href="babel.support.LazyProxy-class.html">LazyProxy</a>)</span></td>
-<td width="33%" class="link-index"><a href="babel.util-module.html#__package__">__package__</a><br />
-<span class="index-where">(in <a href="babel.util-module.html">babel.util</a>)</span></td>
+<td width="33%" class="link-index"><a href="babel.support-module.html#__package__">__package__</a><br />
+<span class="index-where">(in <a href="babel.support-module.html">babel.support</a>)</span></td>
</tr>
<tr>
<td width="33%" class="link-index"><a href="babel.support.LazyProxy-class.html#__call__">__call__()</a><br />
<span class="index-where">(in <a href="babel.support.LazyProxy-class.html">LazyProxy</a>)</span></td>
<td width="33%" class="link-index"><a href="babel.util.odict-class.html#__iter__">__iter__()</a><br />
<span class="index-where">(in <a href="babel.util.odict-class.html">odict</a>)</span></td>
-<td width="33%" class="link-index"><a href="babel.support.LazyProxy-class.html#__radd__">__radd__()</a><br />
-<span class="index-where">(in <a href="babel.support.LazyProxy-class.html">LazyProxy</a>)</span></td>
+<td width="33%" class="link-index"><a href="babel.util-module.html#__package__">__package__</a><br />
+<span class="index-where">(in <a href="babel.util-module.html">babel.util</a>)</span></td>
</tr>
<tr>
<td width="33%" class="link-index"><a href="babel.messages.catalog.Message-class.html#__cmp__">__cmp__()</a><br />
<span class="index-where">(in <a href="babel.messages.catalog.Message-class.html">Message</a>)</span></td>
<td width="33%" class="link-index"><a href="babel.support.LazyProxy-class.html#__le__">__le__()</a><br />
<span class="index-where">(in <a href="babel.support.LazyProxy-class.html">LazyProxy</a>)</span></td>
-<td width="33%" class="link-index"><a href="babel.core.Locale-class.html#__repr__">__repr__()</a><br />
-<span class="index-where">(in <a href="babel.core.Locale-class.html">Locale</a>)</span></td>
+<td width="33%" class="link-index"><a href="babel.support.LazyProxy-class.html#__radd__">__radd__()</a><br />
+<span class="index-where">(in <a href="babel.support.LazyProxy-class.html">LazyProxy</a>)</span></td>
</tr>
<tr>
<td width="33%" class="link-index"><a href="babel.messages.catalog.Catalog-class.html#__contains__">__contains__()</a><br />
<span class="index-where">(in <a href="babel.messages.catalog.Catalog-class.html">Catalog</a>)</span></td>
<td width="33%" class="link-index"><a href="babel.messages.catalog.Catalog-class.html#__len__">__len__()</a><br />
<span class="index-where">(in <a href="babel.messages.catalog.Catalog-class.html">Catalog</a>)</span></td>
-<td width="33%" class="link-index"><a href="babel.messages.catalog.Catalog-class.html#__repr__">__repr__()</a><br />
-<span class="index-where">(in <a href="babel.messages.catalog.Catalog-class.html">Catalog</a>)</span></td>
+<td width="33%" class="link-index"><a href="babel.core.Locale-class.html#__repr__">__repr__()</a><br />
+<span class="index-where">(in <a href="babel.core.Locale-class.html">Locale</a>)</span></td>
</tr>
<tr>
<td width="33%" class="link-index"><a href="babel.support.LazyProxy-class.html#__contains__">__contains__()</a><br />
<span class="index-where">(in <a href="babel.support.LazyProxy-class.html">LazyProxy</a>)</span></td>
<td width="33%" class="link-index"><a href="babel.support.LazyProxy-class.html#__len__">__len__()</a><br />
<span class="index-where">(in <a href="babel.support.LazyProxy-class.html">LazyProxy</a>)</span></td>
-<td width="33%" class="link-index"><a href="babel.messages.catalog.Message-class.html#__repr__">__repr__()</a><br />
-<span class="index-where">(in <a href="babel.messages.catalog.Message-class.html">Message</a>)</span></td>
+<td width="33%" class="link-index"><a href="babel.messages.catalog.Catalog-class.html#__repr__">__repr__()</a><br />
+<span class="index-where">(in <a href="babel.messages.catalog.Catalog-class.html">Catalog</a>)</span></td>
</tr>
<tr>
<td width="33%" class="link-index"><a href="babel.support.LazyProxy-class.html#__delattr__">__delattr__()</a><br />
<span class="index-where">(in <a href="babel.support.LazyProxy-class.html">LazyProxy</a>)</span></td>
<td width="33%" class="link-index"><a href="babel.support.LazyProxy-class.html#__lt__">__lt__()</a><br />
<span class="index-where">(in <a href="babel.support.LazyProxy-class.html">LazyProxy</a>)</span></td>
-<td width="33%" class="link-index"><a href="babel.support.Translations-class.html#__repr__">__repr__()</a><br />
-<span class="index-where">(in <a href="babel.support.Translations-class.html">Translations</a>)</span></td>
+<td width="33%" class="link-index"><a href="babel.messages.catalog.Message-class.html#__repr__">__repr__()</a><br />
+<span class="index-where">(in <a href="babel.messages.catalog.Message-class.html">Message</a>)</span></td>
</tr>
<tr>
<td width="33%" class="link-index"><a href="babel.messages.catalog.Catalog-class.html#__delitem__">__delitem__()</a><br />
<span class="index-where">(in <a href="babel.messages.catalog.Catalog-class.html">Catalog</a>)</span></td>
<td width="33%" class="link-index"><a href="babel.support.LazyProxy-class.html#__mod__">__mod__()</a><br />
<span class="index-where">(in <a href="babel.support.LazyProxy-class.html">LazyProxy</a>)</span></td>
-<td width="33%" class="link-index"><a href="babel.support.LazyProxy-class.html#__rmod__">__rmod__()</a><br />
-<span class="index-where">(in <a href="babel.support.LazyProxy-class.html">LazyProxy</a>)</span></td>
+<td width="33%" class="link-index"><a href="babel.support.Translations-class.html#__repr__">__repr__()</a><br />
+<span class="index-where">(in <a href="babel.support.Translations-class.html">Translations</a>)</span></td>
</tr>
<tr>
<td width="33%" class="link-index"><a href="babel.support.LazyProxy-class.html#__delitem__">__delitem__()</a><br />
<span class="index-where">(in <a href="babel.support.LazyProxy-class.html">LazyProxy</a>)</span></td>
<td width="33%" class="link-index"><a href="babel.support.LazyProxy-class.html#__mul__">__mul__()</a><br />
<span class="index-where">(in <a href="babel.support.LazyProxy-class.html">LazyProxy</a>)</span></td>
-<td width="33%" class="link-index"><a href="babel.support.LazyProxy-class.html#__rmul__">__rmul__()</a><br />
+<td width="33%" class="link-index"><a href="babel.support.LazyProxy-class.html#__rmod__">__rmod__()</a><br />
<span class="index-where">(in <a href="babel.support.LazyProxy-class.html">LazyProxy</a>)</span></td>
</tr>
<tr>
<td width="33%" class="link-index"><a href="babel.util.odict-class.html#__delitem__">__delitem__()</a><br />
<span class="index-where">(in <a href="babel.util.odict-class.html">odict</a>)</span></td>
+<td width="33%" class="link-index"><a href="babel.core.Locale-class.html#__ne__">__ne__()</a><br />
+<span class="index-where">(in <a href="babel.core.Locale-class.html">Locale</a>)</span></td>
+<td width="33%" class="link-index"><a href="babel.support.LazyProxy-class.html#__rmul__">__rmul__()</a><br />
+<span class="index-where">(in <a href="babel.support.LazyProxy-class.html">LazyProxy</a>)</span></td>
+</tr>
+<tr>
+<td width="33%" class="link-index"><a href="babel.support.LazyProxy-class.html#__dir__">__dir__()</a><br />
+<span class="index-where">(in <a href="babel.support.LazyProxy-class.html">LazyProxy</a>)</span></td>
<td width="33%" class="link-index"><a href="babel.support.LazyProxy-class.html#__ne__">__ne__()</a><br />
<span class="index-where">(in <a href="babel.support.LazyProxy-class.html">LazyProxy</a>)</span></td>
<td width="33%" class="link-index"><a href="babel.support.LazyProxy-class.html#__setattr__">__setattr__()</a><br />
<span class="index-where">(in <a href="babel.support.LazyProxy-class.html">LazyProxy</a>)</span></td>
</tr>
<tr>
-<td width="33%" class="link-index"><a href="babel.support.LazyProxy-class.html#__dir__">__dir__()</a><br />
-<span class="index-where">(in <a href="babel.support.LazyProxy-class.html">LazyProxy</a>)</span></td>
+<td width="33%" class="link-index"><a href="babel.core.Locale-class.html#__eq__">__eq__()</a><br />
+<span class="index-where">(in <a href="babel.core.Locale-class.html">Locale</a>)</span></td>
<td width="33%" class="link-index"><a href="babel.messages.jslexer.Token-class.html#__new__">__new__()</a><br />
<span class="index-where">(in <a href="babel.messages.jslexer.Token-class.html">Token</a>)</span></td>
<td width="33%" class="link-index"><a href="babel.messages.catalog.Catalog-class.html#__setitem__">__setitem__()</a><br />
<span class="index-where">(in <a href="babel.messages.catalog.Catalog-class.html">Catalog</a>)</span></td>
</tr>
<tr>
-<td width="33%" class="link-index"><a href="babel.core.Locale-class.html#__eq__">__eq__()</a><br />
-<span class="index-where">(in <a href="babel.core.Locale-class.html">Locale</a>)</span></td>
+<td width="33%" class="link-index"><a href="babel.support.LazyProxy-class.html#__eq__">__eq__()</a><br />
+<span class="index-where">(in <a href="babel.support.LazyProxy-class.html">LazyProxy</a>)</span></td>
<td width="33%" class="link-index"><a href="babel.support.LazyProxy-class.html#__nonzero__">__nonzero__()</a><br />
<span class="index-where">(in <a href="babel.support.LazyProxy-class.html">LazyProxy</a>)</span></td>
<td width="33%" class="link-index"><a href="babel.support.LazyProxy-class.html#__setitem__">__setitem__()</a><br />
<span class="index-where">(in <a href="babel.support.LazyProxy-class.html">LazyProxy</a>)</span></td>
</tr>
<tr>
-<td width="33%" class="link-index"><a href="babel.support.LazyProxy-class.html#__eq__">__eq__()</a><br />
+<td width="33%" class="link-index"><a href="babel.support.LazyProxy-class.html#__ge__">__ge__()</a><br />
<span class="index-where">(in <a href="babel.support.LazyProxy-class.html">LazyProxy</a>)</span></td>
<td width="33%" class="link-index"><a href="babel-module.html#__package__">__package__</a><br />
<span class="index-where">(in <a href="babel-module.html">babel</a>)</span></td>
@@ -938,7 +946,7 @@
<span class="index-where">(in <a href="babel.util.odict-class.html">odict</a>)</span></td>
</tr>
<tr>
-<td width="33%" class="link-index"><a href="babel.support.LazyProxy-class.html#__ge__">__ge__()</a><br />
+<td width="33%" class="link-index"><a href="babel.support.LazyProxy-class.html#__getattr__">__getattr__()</a><br />
<span class="index-where">(in <a href="babel.support.LazyProxy-class.html">LazyProxy</a>)</span></td>
<td width="33%" class="link-index"><a href="babel.core-module.html#__package__">__package__</a><br />
<span class="index-where">(in <a href="babel.core-module.html">babel.core</a>)</span></td>
@@ -946,23 +954,23 @@
<span class="index-where">(in <a href="babel.core.Locale-class.html">Locale</a>)</span></td>
</tr>
<tr>
-<td width="33%" class="link-index"><a href="babel.support.LazyProxy-class.html#__getattr__">__getattr__()</a><br />
-<span class="index-where">(in <a href="babel.support.LazyProxy-class.html">LazyProxy</a>)</span></td>
+<td width="33%" class="link-index"><a href="babel.messages.catalog.Catalog-class.html#__getitem__">__getitem__()</a><br />
+<span class="index-where">(in <a href="babel.messages.catalog.Catalog-class.html">Catalog</a>)</span></td>
<td width="33%" class="link-index"><a href="babel.dates-module.html#__package__">__package__</a><br />
<span class="index-where">(in <a href="babel.dates-module.html">babel.dates</a>)</span></td>
<td width="33%" class="link-index"><a href="babel.support.LazyProxy-class.html#__str__">__str__()</a><br />
<span class="index-where">(in <a href="babel.support.LazyProxy-class.html">LazyProxy</a>)</span></td>
</tr>
<tr>
-<td width="33%" class="link-index"><a href="babel.messages.catalog.Catalog-class.html#__getitem__">__getitem__()</a><br />
-<span class="index-where">(in <a href="babel.messages.catalog.Catalog-class.html">Catalog</a>)</span></td>
+<td width="33%" class="link-index"><a href="babel.support.LazyProxy-class.html#__getitem__">__getitem__()</a><br />
+<span class="index-where">(in <a href="babel.support.LazyProxy-class.html">LazyProxy</a>)</span></td>
<td width="33%" class="link-index"><a href="babel.localedata-module.html#__package__">__package__</a><br />
<span class="index-where">(in <a href="babel.localedata-module.html">babel.localedata</a>)</span></td>
<td width="33%" class="link-index"><a href="babel.support.LazyProxy-class.html#__unicode__">__unicode__()</a><br />
<span class="index-where">(in <a href="babel.support.LazyProxy-class.html">LazyProxy</a>)</span></td>
</tr>
<tr>
-<td width="33%" class="link-index"><a href="babel.support.LazyProxy-class.html#__getitem__">__getitem__()</a><br />
+<td width="33%" class="link-index"><a href="babel.support.LazyProxy-class.html#__gt__">__gt__()</a><br />
<span class="index-where">(in <a href="babel.support.LazyProxy-class.html">LazyProxy</a>)</span></td>
<td width="33%" class="link-index"><a href="babel.messages-module.html#__package__">__package__</a><br />
<span class="index-where">(in <a href="babel.messages-module.html">babel.messages</a>)</span></td>
@@ -970,84 +978,77 @@
<span class="index-where">(in <a href="babel.core-module.html">babel.core</a>)</span></td>
</tr>
<tr>
-<td width="33%" class="link-index"><a href="babel.support.LazyProxy-class.html#__gt__">__gt__()</a><br />
-<span class="index-where">(in <a href="babel.support.LazyProxy-class.html">LazyProxy</a>)</span></td>
+<td width="33%" class="link-index"><a href="babel.core.Locale-class.html#__init__">__init__()</a><br />
+<span class="index-where">(in <a href="babel.core.Locale-class.html">Locale</a>)</span></td>
<td width="33%" class="link-index"><a href="babel.messages.catalog-module.html#__package__">__package__</a><br />
<span class="index-where">(in <a href="babel.messages.catalog-module.html">babel.messages.catalog</a>)</span></td>
<td width="33%" class="link-index"><a href="babel.localedata-module.html#_cache">_cache</a><br />
<span class="index-where">(in <a href="babel.localedata-module.html">babel.localedata</a>)</span></td>
</tr>
<tr>
-<td width="33%" class="link-index"><a href="babel.core.Locale-class.html#__init__">__init__()</a><br />
-<span class="index-where">(in <a href="babel.core.Locale-class.html">Locale</a>)</span></td>
+<td width="33%" class="link-index"><a href="babel.core.UnknownLocaleError-class.html#__init__">__init__()</a><br />
+<span class="index-where">(in <a href="babel.core.UnknownLocaleError-class.html">UnknownLocaleError</a>)</span></td>
<td width="33%" class="link-index"><a href="babel.messages.checkers-module.html#__package__">__package__</a><br />
<span class="index-where">(in <a href="babel.messages.checkers-module.html">babel.messages.checkers</a>)</span></td>
<td width="33%" class="link-index"><a href="babel.localedata-module.html#_cache_lock">_cache_lock</a><br />
<span class="index-where">(in <a href="babel.localedata-module.html">babel.localedata</a>)</span></td>
</tr>
<tr>
-<td width="33%" class="link-index"><a href="babel.core.UnknownLocaleError-class.html#__init__">__init__()</a><br />
-<span class="index-where">(in <a href="babel.core.UnknownLocaleError-class.html">UnknownLocaleError</a>)</span></td>
+<td width="33%" class="link-index"><a href="babel.messages.catalog.Catalog-class.html#__init__">__init__()</a><br />
+<span class="index-where">(in <a href="babel.messages.catalog.Catalog-class.html">Catalog</a>)</span></td>
<td width="33%" class="link-index"><a href="babel.messages.extract-module.html#__package__">__package__</a><br />
<span class="index-where">(in <a href="babel.messages.extract-module.html">babel.messages.extract</a>)</span></td>
<td width="33%" class="link-index"><a href="babel.localedata-module.html#_dirname">_dirname</a><br />
<span class="index-where">(in <a href="babel.localedata-module.html">babel.localedata</a>)</span></td>
</tr>
<tr>
-<td width="33%" class="link-index"><a href="babel.messages.catalog.Catalog-class.html#__init__">__init__()</a><br />
-<span class="index-where">(in <a href="babel.messages.catalog.Catalog-class.html">Catalog</a>)</span></td>
+<td width="33%" class="link-index"><a href="babel.messages.catalog.Message-class.html#__init__">__init__()</a><br />
+<span class="index-where">(in <a href="babel.messages.catalog.Message-class.html">Message</a>)</span></td>
<td width="33%" class="link-index"><a href="babel.messages.frontend-module.html#__package__">__package__</a><br />
<span class="index-where">(in <a href="babel.messages.frontend-module.html">babel.messages.frontend</a>)</span></td>
<td width="33%" class="link-index"><a href="babel.messages.catalog.Catalog-class.html#_get_header_comment">_get_header_comment()</a><br />
<span class="index-where">(in <a href="babel.messages.catalog.Catalog-class.html">Catalog</a>)</span></td>
</tr>
<tr>
-<td width="33%" class="link-index"><a href="babel.messages.catalog.Message-class.html#__init__">__init__()</a><br />
-<span class="index-where">(in <a href="babel.messages.catalog.Message-class.html">Message</a>)</span></td>
+<td width="33%" class="link-index"><a href="babel.support.Format-class.html#__init__">__init__()</a><br />
+<span class="index-where">(in <a href="babel.support.Format-class.html">Format</a>)</span></td>
<td width="33%" class="link-index"><a href="babel.messages.jslexer-module.html#__package__">__package__</a><br />
<span class="index-where">(in <a href="babel.messages.jslexer-module.html">babel.messages.jslexer</a>)</span></td>
<td width="33%" class="link-index"><a href="babel.messages.catalog.Catalog-class.html#_get_mime_headers">_get_mime_headers()</a><br />
<span class="index-where">(in <a href="babel.messages.catalog.Catalog-class.html">Catalog</a>)</span></td>
</tr>
<tr>
-<td width="33%" class="link-index"><a href="babel.support.Format-class.html#__init__">__init__()</a><br />
-<span class="index-where">(in <a href="babel.support.Format-class.html">Format</a>)</span></td>
+<td width="33%" class="link-index"><a href="babel.support.LazyProxy-class.html#__init__">__init__()</a><br />
+<span class="index-where">(in <a href="babel.support.LazyProxy-class.html">LazyProxy</a>)</span></td>
<td width="33%" class="link-index"><a href="babel.messages.mofile-module.html#__package__">__package__</a><br />
<span class="index-where">(in <a href="babel.messages.mofile-module.html">babel.messages.mofile</a>)</span></td>
<td width="33%" class="link-index"><a href="babel.core-module.html#_global_data">_global_data</a><br />
<span class="index-where">(in <a href="babel.core-module.html">babel.core</a>)</span></td>
</tr>
<tr>
-<td width="33%" class="link-index"><a href="babel.support.LazyProxy-class.html#__init__">__init__()</a><br />
-<span class="index-where">(in <a href="babel.support.LazyProxy-class.html">LazyProxy</a>)</span></td>
+<td width="33%" class="link-index"><a href="babel.support.Translations-class.html#__init__">__init__()</a><br />
+<span class="index-where">(in <a href="babel.support.Translations-class.html">Translations</a>)</span></td>
<td width="33%" class="link-index"><a href="babel.messages.plurals-module.html#__package__">__package__</a><br />
<span class="index-where">(in <a href="babel.messages.plurals-module.html">babel.messages.plurals</a>)</span></td>
<td width="33%" class="link-index"><a href="babel.messages.catalog.Catalog-class.html#_set_header_comment">_set_header_comment()</a><br />
<span class="index-where">(in <a href="babel.messages.catalog.Catalog-class.html">Catalog</a>)</span></td>
</tr>
<tr>
-<td width="33%" class="link-index"><a href="babel.support.Translations-class.html#__init__">__init__()</a><br />
-<span class="index-where">(in <a href="babel.support.Translations-class.html">Translations</a>)</span></td>
+<td width="33%" class="link-index"><a href="babel.util.odict-class.html#__init__">__init__()</a><br />
+<span class="index-where">(in <a href="babel.util.odict-class.html">odict</a>)</span></td>
<td width="33%" class="link-index"><a href="babel.messages.pofile-module.html#__package__">__package__</a><br />
<span class="index-where">(in <a href="babel.messages.pofile-module.html">babel.messages.pofile</a>)</span></td>
<td width="33%" class="link-index"><a href="babel.messages.catalog.Catalog-class.html#_set_mime_headers">_set_mime_headers()</a><br />
<span class="index-where">(in <a href="babel.messages.catalog.Catalog-class.html">Catalog</a>)</span></td>
</tr>
<tr>
-<td width="33%" class="link-index"><a href="babel.util.odict-class.html#__init__">__init__()</a><br />
-<span class="index-where">(in <a href="babel.util.odict-class.html">odict</a>)</span></td>
+<td width="33%" class="link-index"><a href="babel.messages.catalog.Catalog-class.html#__iter__">__iter__()</a><br />
+<span class="index-where">(in <a href="babel.messages.catalog.Catalog-class.html">Catalog</a>)</span></td>
<td width="33%" class="link-index"><a href="babel.numbers-module.html#__package__">__package__</a><br />
<span class="index-where">(in <a href="babel.numbers-module.html">babel.numbers</a>)</span></td>
<td width="33%" class="link-index"><a href="babel.messages.checkers-module.html#_string_format_compatibilities">_string_format_compatibilities</a><br />
<span class="index-where">(in <a href="babel.messages.checkers-module.html">babel.messages.checkers</a>)</span></td>
</tr>
-<tr>
-<td width="33%" class="link-index"><a href="babel.messages.catalog.Catalog-class.html#__iter__">__iter__()</a><br />
-<span class="index-where">(in <a href="babel.messages.catalog.Catalog-class.html">Catalog</a>)</span></td>
-<td width="33%" class="link-index"><a href="babel.support-module.html#__package__">__package__</a><br />
-<span class="index-where">(in <a href="babel.support-module.html">babel.support</a>)</span></td>
-<td width="33%" class="link-index"> </td>
-</tr>
</table>
</td></tr>
</table>
@@ -1082,7 +1083,7 @@
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
- Generated by Epydoc 3.0.1 on Wed Apr 7 09:54:55 2010
+ Generated by Epydoc 3.0.1 on Thu Mar 17 15:12:44 2011
</td>
<td align="right" class="footer">
<a target="mainFrame" href="http://epydoc.sourceforge.net"
|
[-]
[+]
|
Changed |
Babel-0.9.6.tar.bz2/doc/api/index.html
^
|
@@ -59,7 +59,7 @@
<p>This package is basically composed of two major parts:</p>
<blockquote>
<ul class="rst-simple">
-<li>tools to build and work with <tt class="rst-docutils literal"><span class="pre">gettext</span></tt> message catalogs</li>
+<li>tools to build and work with <tt class="rst-docutils literal">gettext</tt> message catalogs</li>
<li>a Python interface to the CLDR (Common Locale Data Repository), providing
access to various locale display names, localized number and date
formatting, etc.</li>
@@ -75,7 +75,7 @@
</dd>
</dl>
<p><strong>Version:</strong>
- 1.0dev-r482
+ 0.9.5
</p>
</div><!-- ==================== SUBMODULES ==================== -->
<a name="section-Submodules"></a>
@@ -90,7 +90,7 @@
<li> <strong class="uidlink"><a href="babel.core-module.html">babel.core</a></strong>: <em class="summary">Core locale representation and locale data access.</em> </li>
<li> <strong class="uidlink"><a href="babel.dates-module.html">babel.dates</a></strong>: <em class="summary">Locale dependent formatting and parsing of dates and times.</em> </li>
<li> <strong class="uidlink"><a href="babel.localedata-module.html">babel.localedata</a></strong>: <em class="summary">Low-level locale data access.</em> </li>
- <li> <strong class="uidlink"><a href="babel.messages-module.html">babel.messages</a></strong>: <em class="summary">Support for <tt class="rst-rst-docutils literal rst-docutils literal"><span class="pre">gettext</span></tt> message catalogs.</em>
+ <li> <strong class="uidlink"><a href="babel.messages-module.html">babel.messages</a></strong>: <em class="summary">Support for <tt class="rst-rst-docutils literal rst-docutils literal">gettext</tt> message catalogs.</em>
<ul>
<li> <strong class="uidlink"><a href="babel.messages.catalog-module.html">babel.messages.catalog</a></strong>: <em class="summary">Data structures for message catalogs.</em> </li>
<li> <strong class="uidlink"><a href="babel.messages.checkers-module.html">babel.messages.checkers</a></strong>: <em class="summary">Various routines that help with validation of translations.</em> </li>
@@ -98,9 +98,9 @@
<li> <strong class="uidlink"><a href="babel.messages.frontend-module.html">babel.messages.frontend</a></strong>: <em class="summary">Frontends for the message extraction functionality.</em> </li>
<li> <strong class="uidlink"><a href="babel.messages.jslexer-module.html">babel.messages.jslexer</a></strong>: <em class="summary">A simple JavaScript 1.5 lexer which is used for the JavaScript
extractor.</em> </li>
- <li> <strong class="uidlink"><a href="babel.messages.mofile-module.html">babel.messages.mofile</a></strong>: <em class="summary">Writing of files in the <tt class="rst-rst-docutils literal rst-docutils literal"><span class="pre">gettext</span></tt> MO (machine object) format.</em> </li>
+ <li> <strong class="uidlink"><a href="babel.messages.mofile-module.html">babel.messages.mofile</a></strong>: <em class="summary">Writing of files in the <tt class="rst-rst-docutils literal rst-docutils literal">gettext</tt> MO (machine object) format.</em> </li>
<li> <strong class="uidlink"><a href="babel.messages.plurals-module.html">babel.messages.plurals</a></strong>: <em class="summary">Plural form definitions.</em> </li>
- <li> <strong class="uidlink"><a href="babel.messages.pofile-module.html">babel.messages.pofile</a></strong>: <em class="summary">Reading and writing of files in the <tt class="rst-rst-docutils literal rst-docutils literal"><span class="pre">gettext</span></tt> PO (portable object)
+ <li> <strong class="uidlink"><a href="babel.messages.pofile-module.html">babel.messages.pofile</a></strong>: <em class="summary">Reading and writing of files in the <tt class="rst-rst-docutils literal rst-docutils literal">gettext</tt> PO (portable object)
format.</em> </li>
</ul>
</li>
@@ -159,7 +159,7 @@
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
- Generated by Epydoc 3.0.1 on Wed Apr 7 09:54:55 2010
+ Generated by Epydoc 3.0.1 on Thu Mar 17 15:12:44 2011
</td>
<td align="right" class="footer">
<a target="mainFrame" href="http://epydoc.sourceforge.net"
|
[-]
[+]
|
Changed |
Babel-0.9.6.tar.bz2/doc/api/module-tree.html
^
|
@@ -60,7 +60,7 @@
<li> <strong class="uidlink"><a href="babel.core-module.html">babel.core</a></strong>: <em class="summary">Core locale representation and locale data access.</em> </li>
<li> <strong class="uidlink"><a href="babel.dates-module.html">babel.dates</a></strong>: <em class="summary">Locale dependent formatting and parsing of dates and times.</em> </li>
<li> <strong class="uidlink"><a href="babel.localedata-module.html">babel.localedata</a></strong>: <em class="summary">Low-level locale data access.</em> </li>
- <li> <strong class="uidlink"><a href="babel.messages-module.html">babel.messages</a></strong>: <em class="summary">Support for <tt class="rst-docutils literal"><span class="pre">gettext</span></tt> message catalogs.</em>
+ <li> <strong class="uidlink"><a href="babel.messages-module.html">babel.messages</a></strong>: <em class="summary">Support for <tt class="rst-docutils literal">gettext</tt> message catalogs.</em>
<ul>
<li> <strong class="uidlink"><a href="babel.messages.catalog-module.html">babel.messages.catalog</a></strong>: <em class="summary">Data structures for message catalogs.</em> </li>
<li> <strong class="uidlink"><a href="babel.messages.checkers-module.html">babel.messages.checkers</a></strong>: <em class="summary">Various routines that help with validation of translations.</em> </li>
@@ -68,9 +68,9 @@
<li> <strong class="uidlink"><a href="babel.messages.frontend-module.html">babel.messages.frontend</a></strong>: <em class="summary">Frontends for the message extraction functionality.</em> </li>
<li> <strong class="uidlink"><a href="babel.messages.jslexer-module.html">babel.messages.jslexer</a></strong>: <em class="summary">A simple JavaScript 1.5 lexer which is used for the JavaScript
extractor.</em> </li>
- <li> <strong class="uidlink"><a href="babel.messages.mofile-module.html">babel.messages.mofile</a></strong>: <em class="summary">Writing of files in the <tt class="rst-docutils literal"><span class="pre">gettext</span></tt> MO (machine object) format.</em> </li>
+ <li> <strong class="uidlink"><a href="babel.messages.mofile-module.html">babel.messages.mofile</a></strong>: <em class="summary">Writing of files in the <tt class="rst-docutils literal">gettext</tt> MO (machine object) format.</em> </li>
<li> <strong class="uidlink"><a href="babel.messages.plurals-module.html">babel.messages.plurals</a></strong>: <em class="summary">Plural form definitions.</em> </li>
- <li> <strong class="uidlink"><a href="babel.messages.pofile-module.html">babel.messages.pofile</a></strong>: <em class="summary">Reading and writing of files in the <tt class="rst-docutils literal"><span class="pre">gettext</span></tt> PO (portable object)
+ <li> <strong class="uidlink"><a href="babel.messages.pofile-module.html">babel.messages.pofile</a></strong>: <em class="summary">Reading and writing of files in the <tt class="rst-docutils literal">gettext</tt> PO (portable object)
format.</em> </li>
</ul>
</li>
@@ -112,7 +112,7 @@
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
- Generated by Epydoc 3.0.1 on Wed Apr 7 09:54:55 2010
+ Generated by Epydoc 3.0.1 on Thu Mar 17 15:12:44 2011
</td>
<td align="right" class="footer">
<a target="mainFrame" href="http://epydoc.sourceforge.net"
|
[-]
[+]
|
Changed |
Babel-0.9.6.tar.bz2/doc/api/since-index.html
^
|
@@ -135,7 +135,7 @@
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
- Generated by Epydoc 3.0.1 on Wed Apr 7 09:54:55 2010
+ Generated by Epydoc 3.0.1 on Thu Mar 17 15:12:44 2011
</td>
<td align="right" class="footer">
<a target="mainFrame" href="http://epydoc.sourceforge.net"
|
[-]
[+]
|
Changed |
Babel-0.9.6.tar.bz2/doc/cmdline.html
^
|
@@ -3,19 +3,19 @@
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<meta name="generator" content="Docutils 0.5: http://docutils.sourceforge.net/">
+<meta name="generator" content="Docutils 0.7: http://docutils.sourceforge.net/">
<title>Babel: Command-Line Interface</title>
<link rel="stylesheet" href="common/style/edgewall.css" type="text/css">
</head>
<body>
<div class="document" id="command-line-interface">
<div id="navigation">
- <span class="projinfo">Babel 0.9.5</span>
+ <span class="projinfo">Babel 0.9.6</span>
<a href="index.html">Documentation Index</a>
</div>
<h1 class="title">Command-Line Interface</h1>
<p>Babel includes a command-line interface for working with message catalogs,
-similar to the various GNU <tt class="docutils literal"><span class="pre">gettext</span></tt> tools commonly available on Linux/Unix
+similar to the various GNU <tt class="docutils literal">gettext</tt> tools commonly available on Linux/Unix
systems.</p>
<div class="contents topic" id="contents">
<p class="topic-title first">Contents</p>
@@ -26,7 +26,7 @@
<li><a class="reference internal" href="#update" id="id4">4 update</a></li>
</ul>
</div>
-<p>When properly installed, Babel provides a script called <tt class="docutils literal"><span class="pre">pybabel</span></tt>:</p>
+<p>When properly installed, Babel provides a script called <tt class="docutils literal">pybabel</tt>:</p>
<pre class="literal-block">
$ pybabel --help
usage: pybabel command [options] [args]
@@ -44,11 +44,11 @@
init create new message catalogs from a POT file
update update existing message catalogs from a POT file
</pre>
-<p>The <tt class="docutils literal"><span class="pre">pybabel</span></tt> script provides a number of sub-commands that do the actual
+<p>The <tt class="docutils literal">pybabel</tt> script provides a number of sub-commands that do the actual
work. Those sub-commands are described below.</p>
<div class="section" id="compile">
<h1>1 compile</h1>
-<p>The <tt class="docutils literal"><span class="pre">compile</span></tt> sub-command can be used to compile translation catalogs into
+<p>The <tt class="docutils literal">compile</tt> sub-command can be used to compile translation catalogs into
binary MO files:</p>
<pre class="literal-block">
$ pybabel compile --help
@@ -72,18 +72,18 @@
-f, --use-fuzzy also include fuzzy translations (default False)
--statistics print statistics about translations
</pre>
-<p>If <tt class="docutils literal"><span class="pre">directory</span></tt> is specified, but <tt class="docutils literal"><span class="pre">output-file</span></tt> is not, the default filename
+<p>If <tt class="docutils literal">directory</tt> is specified, but <tt class="docutils literal"><span class="pre">output-file</span></tt> is not, the default filename
of the output file will be:</p>
<pre class="literal-block">
<directory>/<locale>/LC_MESSAGES/<domain>.mo
</pre>
-<p>If neither the <tt class="docutils literal"><span class="pre">input_file</span></tt> nor the <tt class="docutils literal"><span class="pre">locale</span></tt> option is set, this command
+<p>If neither the <tt class="docutils literal">input_file</tt> nor the <tt class="docutils literal">locale</tt> option is set, this command
looks for all catalog files in the base directory that match the given domain,
and compiles each of them to MO files in the same directory.</p>
</div>
<div class="section" id="extract">
<h1>2 extract</h1>
-<p>The <tt class="docutils literal"><span class="pre">extract</span></tt> sub-command can be used to extract localizable messages from
+<p>The <tt class="docutils literal">extract</tt> sub-command can be used to extract localizable messages from
a collection of source files:</p>
<pre class="literal-block">
$ pybabel extract --help
@@ -177,12 +177,12 @@
--previous keep previous msgids of translated messages (default
False)
</pre>
-<p>If <tt class="docutils literal"><span class="pre">output_dir</span></tt> is specified, but <tt class="docutils literal"><span class="pre">output-file</span></tt> is not, the default
+<p>If <tt class="docutils literal">output_dir</tt> is specified, but <tt class="docutils literal"><span class="pre">output-file</span></tt> is not, the default
filename of the output file will be:</p>
<pre class="literal-block">
<directory>/<locale>/LC_MESSAGES/<domain>.mo
</pre>
-<p>If neither the <tt class="docutils literal"><span class="pre">output_file</span></tt> nor the <tt class="docutils literal"><span class="pre">locale</span></tt> option is set, this command
+<p>If neither the <tt class="docutils literal">output_file</tt> nor the <tt class="docutils literal">locale</tt> option is set, this command
looks for all catalog files in the base directory that match the given domain,
and updates each of them.</p>
</div>
|
[-]
[+]
|
Changed |
Babel-0.9.6.tar.bz2/doc/common/doctools.py
^
|
@@ -62,25 +62,25 @@
code_block.content = 1
rst.directives.register_directive('code-block', code_block)
except ImportError:
- print 'Pygments not installed, syntax highlighting disabled'
+ print('Pygments not installed, syntax highlighting disabled')
loader = TemplateLoader(['doc', 'doc/common'], variable_lookup='strict')
for source in glob('doc/*.txt'):
dest = os.path.splitext(source)[0] + '.html'
if self.force or not os.path.exists(dest) or \
os.path.getmtime(dest) < os.path.getmtime(source):
- print 'building documentation file %s' % dest
+ print('building documentation file %s' % dest)
publish_cmdline(writer_name='html',
argv=['--config=%s' % docutils_conf, source,
dest])
fileobj = open(dest)
try:
- html = HTMLParser(fileobj)
+ html = HTMLParser(fileobj, encoding='utf-8')
template = loader.load('template.html')
output = template.generate(
html=html,
project=self.distribution
- ).render('html')
+ ).render('html', encoding='utf-8')
finally:
fileobj.close()
fileobj = open(dest, 'w')
@@ -104,7 +104,7 @@
sys.argv[1:] = old_argv
except ImportError:
- print 'epydoc not installed, skipping API documentation.'
+ print('epydoc not installed, skipping API documentation.')
class test_doc(Command):
@@ -119,5 +119,5 @@
def run(self):
for filename in glob('doc/*.txt'):
- print 'testing documentation file %s' % filename
+ print('testing documentation file %s' % filename)
doctest.testfile(filename, False, optionflags=doctest.ELLIPSIS)
|
[-]
[+]
|
Changed |
Babel-0.9.6.tar.bz2/doc/dates.html
^
|
@@ -3,14 +3,14 @@
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<meta name="generator" content="Docutils 0.5: http://docutils.sourceforge.net/">
+<meta name="generator" content="Docutils 0.7: http://docutils.sourceforge.net/">
<title>Babel: Date Formatting</title>
<link rel="stylesheet" href="common/style/edgewall.css" type="text/css">
</head>
<body>
<div class="document" id="date-formatting">
<div id="navigation">
- <span class="projinfo">Babel 0.9.5</span>
+ <span class="projinfo">Babel 0.9.6</span>
<a href="index.html">Documentation Index</a>
</div>
<h1 class="title">Date Formatting</h1>
@@ -30,44 +30,61 @@
</ul>
</div>
<p>When working with date and time information in Python, you commonly use the
-classes <tt class="docutils literal"><span class="pre">date</span></tt>, <tt class="docutils literal"><span class="pre">datetime</span></tt> and/or <tt class="docutils literal"><span class="pre">time</span></tt> from the <a class="reference external" href="http://docs.python.org/lib/module-datetime.html">datetime</a> package.
+classes <tt class="docutils literal">date</tt>, <tt class="docutils literal">datetime</tt> and/or <tt class="docutils literal">time</tt> from the <a class="reference external" href="http://docs.python.org/lib/module-datetime.html">datetime</a> package.
Babel provides functions for locale-specific formatting of those objects in its
-<tt class="docutils literal"><span class="pre">dates</span></tt> module:</p>
-<div class="highlight"><pre><span class="gp">>>> </span><span class="kn">from</span> <span class="nn">datetime</span> <span class="kn">import</span> <span class="n">date</span><span class="p">,</span> <span class="n">datetime</span><span class="p">,</span> <span class="n">time</span>
-<span class="gp">>>> </span><span class="kn">from</span> <span class="nn">babel.dates</span> <span class="kn">import</span> <span class="n">format_date</span><span class="p">,</span> <span class="n">format_datetime</span><span class="p">,</span> <span class="n">format_time</span>
-
-<span class="gp">>>> </span><span class="n">d</span> <span class="o">=</span> <span class="n">date</span><span class="p">(</span><span class="mi">2007</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
-<span class="gp">>>> </span><span class="n">format_date</span><span class="p">(</span><span class="n">d</span><span class="p">,</span> <span class="n">locale</span><span class="o">=</span><span class="s">'en'</span><span class="p">)</span>
-<span class="go">u'Apr 1, 2007'</span>
-<span class="gp">>>> </span><span class="n">format_date</span><span class="p">(</span><span class="n">d</span><span class="p">,</span> <span class="n">locale</span><span class="o">=</span><span class="s">'de_DE'</span><span class="p">)</span>
-<span class="go">u'01.04.2007'</span>
-</pre></div>
+<tt class="docutils literal">dates</tt> module:</p>
+<div class="system-message">
+<p class="system-message-title">System Message: ERROR/3 (<tt class="docutils">doc/dates.txt</tt>, line 20)</p>
+<p>Unknown directive type "code-block".</p>
+<pre class="literal-block">
+.. code-block:: pycon
+
+ >>> from datetime import date, datetime, time
+ >>> from babel.dates import format_date, format_datetime, format_time
+
+ >>> d = date(2007, 4, 1)
+ >>> format_date(d, locale='en')
+ u'Apr 1, 2007'
+ >>> format_date(d, locale='de_DE')
+ u'01.04.2007'
+
+</pre>
+</div>
<p>As this example demonstrates, Babel will automatically choose a date format
that is appropriate for the requested locale.</p>
-<p>The <tt class="docutils literal"><span class="pre">format_*()</span></tt> functions also accept an optional <tt class="docutils literal"><span class="pre">format</span></tt> argument, which
+<p>The <tt class="docutils literal"><span class="pre">format_*()</span></tt> functions also accept an optional <tt class="docutils literal">format</tt> argument, which
allows you to choose between one of four format variations:</p>
<blockquote>
<ul class="simple">
-<li><tt class="docutils literal"><span class="pre">short</span></tt>,</li>
-<li><tt class="docutils literal"><span class="pre">medium</span></tt> (the default),</li>
-<li><tt class="docutils literal"><span class="pre">long</span></tt>, and</li>
-<li><tt class="docutils literal"><span class="pre">full</span></tt>.</li>
+<li><tt class="docutils literal">short</tt>,</li>
+<li><tt class="docutils literal">medium</tt> (the default),</li>
+<li><tt class="docutils literal">long</tt>, and</li>
+<li><tt class="docutils literal">full</tt>.</li>
</ul>
</blockquote>
<p>For example:</p>
-<div class="highlight"><pre><span class="gp">>>> </span><span class="n">format_date</span><span class="p">(</span><span class="n">d</span><span class="p">,</span> <span class="n">format</span><span class="o">=</span><span class="s">'short'</span><span class="p">,</span> <span class="n">locale</span><span class="o">=</span><span class="s">'en'</span><span class="p">)</span>
-<span class="go">u'4/1/07'</span>
-<span class="gp">>>> </span><span class="n">format_date</span><span class="p">(</span><span class="n">d</span><span class="p">,</span> <span class="n">format</span><span class="o">=</span><span class="s">'long'</span><span class="p">,</span> <span class="n">locale</span><span class="o">=</span><span class="s">'en'</span><span class="p">)</span>
-<span class="go">u'April 1, 2007'</span>
-<span class="gp">>>> </span><span class="n">format_date</span><span class="p">(</span><span class="n">d</span><span class="p">,</span> <span class="n">format</span><span class="o">=</span><span class="s">'full'</span><span class="p">,</span> <span class="n">locale</span><span class="o">=</span><span class="s">'en'</span><span class="p">)</span>
-<span class="go">u'Sunday, April 1, 2007'</span>
-</pre></div>
+<div class="system-message">
+<p class="system-message-title">System Message: ERROR/3 (<tt class="docutils">doc/dates.txt</tt>, line 44)</p>
+<p>Unknown directive type "code-block".</p>
+<pre class="literal-block">
+.. code-block:: pycon
+
+ >>> format_date(d, format='short', locale='en')
+ u'4/1/07'
+ >>> format_date(d, format='long', locale='en')
+ u'April 1, 2007'
+ >>> format_date(d, format='full', locale='en')
+ u'Sunday, April 1, 2007'
+
+
+</pre>
+</div>
<div class="section" id="pattern-syntax">
<h1>1 Pattern Syntax</h1>
<p>While Babel makes it simple to use the appropriate date/time format for a given
locale, you can also force it to use custom patterns. Note that Babel uses
different patterns for specifying number and date formats compared to the
-Python equivalents (such as <tt class="docutils literal"><span class="pre">time.strftime()</span></tt>), which have mostly been
+Python equivalents (such as <tt class="docutils literal">time.strftime()</tt>), which have mostly been
inherited from C and POSIX. The patterns used in Babel are based on the
<a class="reference external" href="http://unicode.org/reports/tr35/#Date_Format_Patterns">Locale Data Markup Language specification</a> (LDML), which defines them as
follows:</p>
@@ -75,10 +92,10 @@
<p>A date/time pattern is a string of characters, where specific strings of
characters are replaced with date and time data from a calendar when formatting
or used to generate data for a calendar when parsing. […]</p>
-<p>Characters may be used multiple times. For example, if <tt class="docutils literal"><span class="pre">y</span></tt> is used for the
-year, <tt class="docutils literal"><span class="pre">yy</span></tt> might produce "99", whereas <tt class="docutils literal"><span class="pre">yyyy</span></tt> produces "1999". For most
+<p>Characters may be used multiple times. For example, if <tt class="docutils literal">y</tt> is used for the
+year, <tt class="docutils literal">yy</tt> might produce "99", whereas <tt class="docutils literal">yyyy</tt> produces "1999". For most
numerical fields, the number of characters specifies the field width. For
-example, if <tt class="docutils literal"><span class="pre">h</span></tt> is the hour, <tt class="docutils literal"><span class="pre">h</span></tt> might produce "5", but <tt class="docutils literal"><span class="pre">hh</span></tt> produces
+example, if <tt class="docutils literal">h</tt> is the hour, <tt class="docutils literal">h</tt> might produce "5", but <tt class="docutils literal">hh</tt> produces
"05". For some characters, the count specifies whether an abbreviated or full
form should be used […]</p>
<p>Two single quotes represent a literal single quote, either inside or outside
@@ -86,22 +103,30 @@
for two adjacent single quotes).</p>
</blockquote>
<p>For example:</p>
-<div class="highlight"><pre><span class="gp">>>> </span><span class="n">d</span> <span class="o">=</span> <span class="n">date</span><span class="p">(</span><span class="mi">2007</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
-<span class="gp">>>> </span><span class="n">format_date</span><span class="p">(</span><span class="n">d</span><span class="p">,</span> <span class="s">"EEE, MMM d, ''yy"</span><span class="p">,</span> <span class="n">locale</span><span class="o">=</span><span class="s">'en'</span><span class="p">)</span>
-<span class="go">u"Sun, Apr 1, '07"</span>
-<span class="gp">>>> </span><span class="n">format_date</span><span class="p">(</span><span class="n">d</span><span class="p">,</span> <span class="s">"EEEE, d.M.yyyy"</span><span class="p">,</span> <span class="n">locale</span><span class="o">=</span><span class="s">'de'</span><span class="p">)</span>
-<span class="go">u'Sonntag, 1.4.2007'</span>
-
-<span class="gp">>>> </span><span class="n">t</span> <span class="o">=</span> <span class="n">time</span><span class="p">(</span><span class="mi">15</span><span class="p">,</span> <span class="mi">30</span><span class="p">)</span>
-<span class="gp">>>> </span><span class="n">format_time</span><span class="p">(</span><span class="n">t</span><span class="p">,</span> <span class="s">"hh 'o''clock' a"</span><span class="p">,</span> <span class="n">locale</span><span class="o">=</span><span class="s">'en'</span><span class="p">)</span>
-<span class="go">u"03 o'clock PM"</span>
-<span class="gp">>>> </span><span class="n">format_time</span><span class="p">(</span><span class="n">t</span><span class="p">,</span> <span class="s">'H:mm a'</span><span class="p">,</span> <span class="n">locale</span><span class="o">=</span><span class="s">'de'</span><span class="p">)</span>
-<span class="go">u'15:30 nachm.'</span>
-
-<span class="gp">>>> </span><span class="n">dt</span> <span class="o">=</span> <span class="n">datetime</span><span class="p">(</span><span class="mi">2007</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">15</span><span class="p">,</span> <span class="mi">30</span><span class="p">)</span>
-<span class="gp">>>> </span><span class="n">format_datetime</span><span class="p">(</span><span class="n">dt</span><span class="p">,</span> <span class="s">"yyyyy.MMMM.dd GGG hh:mm a"</span><span class="p">,</span> <span class="n">locale</span><span class="o">=</span><span class="s">'en'</span><span class="p">)</span>
-<span class="go">u'02007.April.01 AD 03:30 PM'</span>
-</pre></div>
+<div class="system-message">
+<p class="system-message-title">System Message: ERROR/3 (<tt class="docutils">doc/dates.txt</tt>, line 82)</p>
+<p>Unknown directive type "code-block".</p>
+<pre class="literal-block">
+.. code-block:: pycon
+
+ >>> d = date(2007, 4, 1)
+ >>> format_date(d, "EEE, MMM d, ''yy", locale='en')
+ u"Sun, Apr 1, '07"
+ >>> format_date(d, "EEEE, d.M.yyyy", locale='de')
+ u'Sonntag, 1.4.2007'
+
+ >>> t = time(15, 30)
+ >>> format_time(t, "hh 'o''clock' a", locale='en')
+ u"03 o'clock PM"
+ >>> format_time(t, 'H:mm a', locale='de')
+ u'15:30 nachm.'
+
+ >>> dt = datetime(2007, 4, 1, 15, 30)
+ >>> format_datetime(dt, "yyyyy.MMMM.dd GGG hh:mm a", locale='en')
+ u'02007.April.01 AD 03:30 PM'
+
+</pre>
+</div>
<p>The syntax for custom datetime format patterns is described in detail in the
the <a class="reference external" href="http://unicode.org/reports/tr35/#Date_Format_Patterns">Locale Data Markup Language specification</a>. The following table is just a
relatively brief overview.</p>
@@ -124,75 +149,75 @@
</thead>
<tbody valign="top">
<tr><td>Era</td>
-<td><tt class="docutils literal"><span class="pre">G</span></tt></td>
+<td><tt class="docutils literal">G</tt></td>
<td>Replaced with the era string for the current date. One
to three letters for the abbreviated form, four
lettersfor the long form, five for the narrow form</td>
</tr>
<tr><td rowspan="3">Year</td>
-<td><tt class="docutils literal"><span class="pre">y</span></tt></td>
+<td><tt class="docutils literal">y</tt></td>
<td>Replaced by the year. Normally the length specifies
the padding, but for two letters it also specifies the
maximum length.</td>
</tr>
-<tr><td><tt class="docutils literal"><span class="pre">Y</span></tt></td>
-<td>Same as <tt class="docutils literal"><span class="pre">y</span></tt> but uses the ISO year-week calendar.</td>
+<tr><td><tt class="docutils literal">Y</tt></td>
+<td>Same as <tt class="docutils literal">y</tt> but uses the ISO year-week calendar.</td>
</tr>
-<tr><td><tt class="docutils literal"><span class="pre">u</span></tt></td>
+<tr><td><tt class="docutils literal">u</tt></td>
<td>??</td>
</tr>
<tr><td rowspan="2">Quarter</td>
-<td><tt class="docutils literal"><span class="pre">Q</span></tt></td>
+<td><tt class="docutils literal">Q</tt></td>
<td>Use one or two for the numerical quarter, three for
the abbreviation, or four for the full name.</td>
</tr>
-<tr><td><tt class="docutils literal"><span class="pre">q</span></tt></td>
+<tr><td><tt class="docutils literal">q</tt></td>
<td>Use one or two for the numerical quarter, three for
the abbreviation, or four for the full name.</td>
</tr>
<tr><td rowspan="2">Month</td>
-<td><tt class="docutils literal"><span class="pre">M</span></tt></td>
+<td><tt class="docutils literal">M</tt></td>
<td>Use one or two for the numerical month, three for the
abbreviation, or four for the full name, or five for
the narrow name.</td>
</tr>
-<tr><td><tt class="docutils literal"><span class="pre">L</span></tt></td>
+<tr><td><tt class="docutils literal">L</tt></td>
<td>Use one or two for the numerical month, three for the
abbreviation, or four for the full name, or 5 for the
narrow name.</td>
</tr>
<tr><td rowspan="2">Week</td>
-<td><tt class="docutils literal"><span class="pre">w</span></tt></td>
+<td><tt class="docutils literal">w</tt></td>
<td>Week of year.</td>
</tr>
-<tr><td><tt class="docutils literal"><span class="pre">W</span></tt></td>
+<tr><td><tt class="docutils literal">W</tt></td>
<td>Week of month.</td>
</tr>
<tr><td rowspan="4">Day</td>
-<td><tt class="docutils literal"><span class="pre">d</span></tt></td>
+<td><tt class="docutils literal">d</tt></td>
<td>Day of month.</td>
</tr>
-<tr><td><tt class="docutils literal"><span class="pre">D</span></tt></td>
+<tr><td><tt class="docutils literal">D</tt></td>
<td>Day of year.</td>
</tr>
-<tr><td><tt class="docutils literal"><span class="pre">F</span></tt></td>
+<tr><td><tt class="docutils literal">F</tt></td>
<td>Day of week in month.</td>
</tr>
-<tr><td><tt class="docutils literal"><span class="pre">g</span></tt></td>
+<tr><td><tt class="docutils literal">g</tt></td>
<td>??</td>
</tr>
<tr><td rowspan="3">Week day</td>
-<td><tt class="docutils literal"><span class="pre">E</span></tt></td>
+<td><tt class="docutils literal">E</tt></td>
<td>Day of week. Use one through three letters for the
short day, or four for the full name, or five for the
narrow name.</td>
</tr>
-<tr><td><tt class="docutils literal"><span class="pre">e</span></tt></td>
+<tr><td><tt class="docutils literal">e</tt></td>
<td>Local day of week. Same as E except adds a numeric
value that will depend on the local starting day of
the week, using one or two letters.</td>
</tr>
-<tr><td><tt class="docutils literal"><span class="pre">c</span></tt></td>
+<tr><td><tt class="docutils literal">c</tt></td>
<td>??</td>
</tr>
</tbody>
@@ -216,51 +241,51 @@
</thead>
<tbody valign="top">
<tr><td>Period</td>
-<td><tt class="docutils literal"><span class="pre">a</span></tt></td>
+<td><tt class="docutils literal">a</tt></td>
<td>AM or PM</td>
</tr>
<tr><td rowspan="4">Hour</td>
-<td><tt class="docutils literal"><span class="pre">h</span></tt></td>
+<td><tt class="docutils literal">h</tt></td>
<td>Hour [1-12].</td>
</tr>
-<tr><td><tt class="docutils literal"><span class="pre">H</span></tt></td>
+<tr><td><tt class="docutils literal">H</tt></td>
<td>Hour [0-23].</td>
</tr>
-<tr><td><tt class="docutils literal"><span class="pre">K</span></tt></td>
+<tr><td><tt class="docutils literal">K</tt></td>
<td>Hour [0-11].</td>
</tr>
-<tr><td><tt class="docutils literal"><span class="pre">k</span></tt></td>
+<tr><td><tt class="docutils literal">k</tt></td>
<td>Hour [1-24].</td>
</tr>
<tr><td>Minute</td>
-<td><tt class="docutils literal"><span class="pre">m</span></tt></td>
+<td><tt class="docutils literal">m</tt></td>
<td>Use one or two for zero places padding.</td>
</tr>
<tr><td rowspan="3">Second</td>
-<td><tt class="docutils literal"><span class="pre">s</span></tt></td>
+<td><tt class="docutils literal">s</tt></td>
<td>Use one or two for zero places padding.</td>
</tr>
-<tr><td><tt class="docutils literal"><span class="pre">S</span></tt></td>
+<tr><td><tt class="docutils literal">S</tt></td>
<td>Fractional second, rounds to the count of letters.</td>
</tr>
-<tr><td><tt class="docutils literal"><span class="pre">A</span></tt></td>
+<tr><td><tt class="docutils literal">A</tt></td>
<td>Milliseconds in day.</td>
</tr>
<tr><td rowspan="4">Timezone</td>
-<td><tt class="docutils literal"><span class="pre">z</span></tt></td>
+<td><tt class="docutils literal">z</tt></td>
<td>Use one to three letters for the short timezone or
four for the full name.</td>
</tr>
-<tr><td><tt class="docutils literal"><span class="pre">Z</span></tt></td>
+<tr><td><tt class="docutils literal">Z</tt></td>
<td>Use one to three letters for RFC 822, four letters for
GMT format.</td>
</tr>
-<tr><td><tt class="docutils literal"><span class="pre">v</span></tt></td>
+<tr><td><tt class="docutils literal">v</tt></td>
<td>Use one letter for short wall (generic) time, four for
long wall time.</td>
</tr>
-<tr><td><tt class="docutils literal"><span class="pre">V</span></tt></td>
-<td>Same as <tt class="docutils literal"><span class="pre">z</span></tt>, except that timezone abbreviations
+<tr><td><tt class="docutils literal">V</tt></td>
+<td>Same as <tt class="docutils literal">z</tt>, except that timezone abbreviations
should be used regardless of whether they are in
common use by the locale.</td>
</tr>
@@ -272,75 +297,116 @@
<div class="section" id="time-zone-support">
<h1>2 Time-zone Support</h1>
<p>Many of the verbose time formats include the time-zone, but time-zone
-information is not by default available for the Python <tt class="docutils literal"><span class="pre">datetime</span></tt> and
-<tt class="docutils literal"><span class="pre">time</span></tt> objects. The standard library includes only the abstract <tt class="docutils literal"><span class="pre">tzinfo</span></tt>
+information is not by default available for the Python <tt class="docutils literal">datetime</tt> and
+<tt class="docutils literal">time</tt> objects. The standard library includes only the abstract <tt class="docutils literal">tzinfo</tt>
class, which you need appropriate implementations for to actually use in your
-application. Babel includes a <tt class="docutils literal"><span class="pre">tzinfo</span></tt> implementation for UTC (Universal
+application. Babel includes a <tt class="docutils literal">tzinfo</tt> implementation for UTC (Universal
Time).</p>
<p>For real time-zone support, it is strongly recommended that you use the
third-party package <a class="reference external" href="http://pytz.sourceforge.net/">pytz</a>, which includes the definitions of practically all
of the time-zones used on the world, as well as important functions for
reliably converting from UTC to local time, and vice versa:</p>
-<div class="highlight"><pre><span class="gp">>>> </span><span class="kn">from</span> <span class="nn">datetime</span> <span class="kn">import</span> <span class="n">time</span>
-<span class="gp">>>> </span><span class="kn">from</span> <span class="nn">pytz</span> <span class="kn">import</span> <span class="n">timezone</span><span class="p">,</span> <span class="n">utc</span>
-<span class="gp">>>> </span><span class="n">dt</span> <span class="o">=</span> <span class="n">datetime</span><span class="p">(</span><span class="mi">2007</span><span class="p">,</span> <span class="mo">04</span><span class="p">,</span> <span class="mo">01</span><span class="p">,</span> <span class="mi">15</span><span class="p">,</span> <span class="mi">30</span><span class="p">,</span> <span class="n">tzinfo</span><span class="o">=</span><span class="n">utc</span><span class="p">)</span>
-<span class="gp">>>> </span><span class="n">eastern</span> <span class="o">=</span> <span class="n">timezone</span><span class="p">(</span><span class="s">'US/Eastern'</span><span class="p">)</span>
-<span class="gp">>>> </span><span class="n">format_datetime</span><span class="p">(</span><span class="n">dt</span><span class="p">,</span> <span class="s">'H:mm Z'</span><span class="p">,</span> <span class="n">tzinfo</span><span class="o">=</span><span class="n">eastern</span><span class="p">,</span> <span class="n">locale</span><span class="o">=</span><span class="s">'en_US'</span><span class="p">)</span>
-<span class="go">u'11:30 -0400'</span>
-</pre></div>
+<div class="system-message">
+<p class="system-message-title">System Message: ERROR/3 (<tt class="docutils">doc/dates.txt</tt>, line 215)</p>
+<p>Unknown directive type "code-block".</p>
+<pre class="literal-block">
+.. code-block:: pycon
+
+ >>> from datetime import time
+ >>> from pytz import timezone, utc
+ >>> dt = datetime(2007, 04, 01, 15, 30, tzinfo=utc)
+ >>> eastern = timezone('US/Eastern')
+ >>> format_datetime(dt, 'H:mm Z', tzinfo=eastern, locale='en_US')
+ u'11:30 -0400'
+
+</pre>
+</div>
<p>The recommended approach to deal with different time-zones in a Python
application is to always use UTC internally, and only convert from/to the users
time-zone when accepting user input and displaying date/time data, respectively.
-You can use Babel together with <tt class="docutils literal"><span class="pre">pytz</span></tt> to apply a time-zone to any
-<tt class="docutils literal"><span class="pre">datetime</span></tt> or <tt class="docutils literal"><span class="pre">time</span></tt> object for display, leaving the original information
+You can use Babel together with <tt class="docutils literal">pytz</tt> to apply a time-zone to any
+<tt class="docutils literal">datetime</tt> or <tt class="docutils literal">time</tt> object for display, leaving the original information
unchanged:</p>
-<div class="highlight"><pre><span class="gp">>>> </span><span class="n">british</span> <span class="o">=</span> <span class="n">timezone</span><span class="p">(</span><span class="s">'Europe/London'</span><span class="p">)</span>
-<span class="gp">>>> </span><span class="n">format_datetime</span><span class="p">(</span><span class="n">dt</span><span class="p">,</span> <span class="s">'H:mm zzzz'</span><span class="p">,</span> <span class="n">tzinfo</span><span class="o">=</span><span class="n">british</span><span class="p">,</span> <span class="n">locale</span><span class="o">=</span><span class="s">'en_US'</span><span class="p">)</span>
-<span class="go">u'16:30 British Summer Time'</span>
-</pre></div>
+<div class="system-message">
+<p class="system-message-title">System Message: ERROR/3 (<tt class="docutils">doc/dates.txt</tt>, line 231)</p>
+<p>Unknown directive type "code-block".</p>
+<pre class="literal-block">
+.. code-block:: pycon
+
+ >>> british = timezone('Europe/London')
+ >>> format_datetime(dt, 'H:mm zzzz', tzinfo=british, locale='en_US')
+ u'16:30 British Summer Time'
+
+</pre>
+</div>
<p>Here, the given UTC time is adjusted to the "Europe/London" time-zone, and
daylight savings time is taken into account. Daylight savings time is also
-applied to <tt class="docutils literal"><span class="pre">format_time</span></tt>, but because the actual date is unknown in that
+applied to <tt class="docutils literal">format_time</tt>, but because the actual date is unknown in that
case, the current day is assumed to determine whether DST or standard time
should be used.</p>
<blockquote>
</blockquote>
<div class="section" id="localized-time-zone-names">
<h2>2.1 Localized Time-zone Names</h2>
-<p>While the <tt class="docutils literal"><span class="pre">Locale</span></tt> class provides access to various locale display names
+<p>While the <tt class="docutils literal">Locale</tt> class provides access to various locale display names
related to time-zones, the process of building a localized name of a time-zone
is actually quite complicated. Babel implements it in separately usable
-functions in the <tt class="docutils literal"><span class="pre">babel.dates</span></tt> module, most importantly the
-<tt class="docutils literal"><span class="pre">get_timezone_name</span></tt> function:</p>
-<div class="highlight"><pre><span class="gp">>>> </span><span class="kn">from</span> <span class="nn">pytz</span> <span class="kn">import</span> <span class="n">timezone</span>
-<span class="gp">>>> </span><span class="kn">from</span> <span class="nn">babel</span> <span class="kn">import</span> <span class="n">Locale</span>
-<span class="gp">>>> </span><span class="kn">from</span> <span class="nn">babel.dates</span> <span class="kn">import</span> <span class="n">get_timezone_name</span>
-
-<span class="gp">>>> </span><span class="n">tz</span> <span class="o">=</span> <span class="n">timezone</span><span class="p">(</span><span class="s">'Europe/Berlin'</span><span class="p">)</span>
-<span class="gp">>>> </span><span class="n">get_timezone_name</span><span class="p">(</span><span class="n">tz</span><span class="p">,</span> <span class="n">locale</span><span class="o">=</span><span class="n">Locale</span><span class="o">.</span><span class="n">parse</span><span class="p">(</span><span class="s">'pt_PT'</span><span class="p">))</span>
-<span class="go">u'Hor\xe1rio Alemanha'</span>
-</pre></div>
-<p>You can pass the function either a <tt class="docutils literal"><span class="pre">datetime.tzinfo</span></tt> object, or a
-<tt class="docutils literal"><span class="pre">datetime.date</span></tt> or <tt class="docutils literal"><span class="pre">datetime.datetime</span></tt> object. If you pass an actual date,
+functions in the <tt class="docutils literal">babel.dates</tt> module, most importantly the
+<tt class="docutils literal">get_timezone_name</tt> function:</p>
+<div class="system-message">
+<p class="system-message-title">System Message: ERROR/3 (<tt class="docutils">doc/dates.txt</tt>, line 255)</p>
+<p>Unknown directive type "code-block".</p>
+<pre class="literal-block">
+.. code-block:: pycon
+
+ >>> from pytz import timezone
+ >>> from babel import Locale
+ >>> from babel.dates import get_timezone_name
+
+ >>> tz = timezone('Europe/Berlin')
+ >>> get_timezone_name(tz, locale=Locale.parse('pt_PT'))
+ u'Hor\xe1rio Alemanha'
+
+</pre>
+</div>
+<p>You can pass the function either a <tt class="docutils literal">datetime.tzinfo</tt> object, or a
+<tt class="docutils literal">datetime.date</tt> or <tt class="docutils literal">datetime.datetime</tt> object. If you pass an actual date,
the function will be able to take daylight savings time into account. If you
pass just the time-zone, Babel does not know whether daylight savings time is
in effect, so it uses a generic representation, which is useful for example to
display a list of time-zones to the user.</p>
-<div class="highlight"><pre><span class="gp">>>> </span><span class="kn">from</span> <span class="nn">datetime</span> <span class="kn">import</span> <span class="n">datetime</span>
+<div class="system-message">
+<p class="system-message-title">System Message: ERROR/3 (<tt class="docutils">doc/dates.txt</tt>, line 272)</p>
+<p>Unknown directive type "code-block".</p>
+<pre class="literal-block">
+.. code-block:: pycon
-<span class="gp">>>> </span><span class="n">dt</span> <span class="o">=</span> <span class="n">tz</span><span class="o">.</span><span class="n">localize</span><span class="p">(</span><span class="n">datetime</span><span class="p">(</span><span class="mi">2007</span><span class="p">,</span> <span class="mi">8</span><span class="p">,</span> <span class="mi">15</span><span class="p">))</span>
-<span class="gp">>>> </span><span class="n">get_timezone_name</span><span class="p">(</span><span class="n">dt</span><span class="p">,</span> <span class="n">locale</span><span class="o">=</span><span class="n">Locale</span><span class="o">.</span><span class="n">parse</span><span class="p">(</span><span class="s">'de_DE'</span><span class="p">))</span>
-<span class="go">u'Mitteleurop\xe4ische Sommerzeit'</span>
-<span class="gp">>>> </span><span class="n">get_timezone_name</span><span class="p">(</span><span class="n">tz</span><span class="p">,</span> <span class="n">locale</span><span class="o">=</span><span class="n">Locale</span><span class="o">.</span><span class="n">parse</span><span class="p">(</span><span class="s">'de_DE'</span><span class="p">))</span>
-<span class="go">u'Deutschland'</span>
-</pre></div>
+ >>> from datetime import datetime
+
+ >>> dt = tz.localize(datetime(2007, 8, 15))
+ >>> get_timezone_name(dt, locale=Locale.parse('de_DE'))
+ u'Mitteleurop\xe4ische Sommerzeit'
+ >>> get_timezone_name(tz, locale=Locale.parse('de_DE'))
+ u'Deutschland'
+
+
+</pre>
+</div>
</div>
</div>
<div class="section" id="parsing-dates">
<h1>3 Parsing Dates</h1>
<p>Babel can also parse date and time information in a locale-sensitive manner:</p>
-<div class="highlight"><pre><span class="gp">>>> </span><span class="kn">from</span> <span class="nn">babel.dates</span> <span class="kn">import</span> <span class="n">parse_date</span><span class="p">,</span> <span class="n">parse_datetime</span><span class="p">,</span> <span class="n">parse_time</span>
-</pre></div>
+<div class="system-message">
+<p class="system-message-title">System Message: ERROR/3 (<tt class="docutils">doc/dates.txt</tt>, line 288)</p>
+<p>Unknown directive type "code-block".</p>
+<pre class="literal-block">
+.. code-block:: pycon
+
+ >>> from babel.dates import parse_date, parse_datetime, parse_time
+
+</pre>
+</div>
<div class="note">
<p class="first admonition-title">Note</p>
<p class="last">Date/time parsing is not properly implemented yet</p>
|
[-]
[+]
|
Changed |
Babel-0.9.6.tar.bz2/doc/display.html
^
|
@@ -3,14 +3,14 @@
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<meta name="generator" content="Docutils 0.5: http://docutils.sourceforge.net/">
+<meta name="generator" content="Docutils 0.7: http://docutils.sourceforge.net/">
<title>Babel: Locale Display Names</title>
<link rel="stylesheet" href="common/style/edgewall.css" type="text/css">
</head>
<body>
<div class="document" id="locale-display-names">
<div id="navigation">
- <span class="projinfo">Babel 0.9.5</span>
+ <span class="projinfo">Babel 0.9.6</span>
<a href="index.html">Documentation Index</a>
</div>
<h1 class="title">Locale Display Names</h1>
@@ -18,7 +18,7 @@
<p class="topic-title first">Contents</p>
<ul class="auto-toc simple">
<li><a class="reference internal" href="#introduction" id="id1">1 Introduction</a></li>
-<li><a class="reference internal" href="#the-locale-class" id="id2">2 The <tt class="docutils literal"><span class="pre">Locale</span></tt> Class</a></li>
+<li><a class="reference internal" href="#the-locale-class" id="id2">2 The <tt class="docutils literal">Locale</tt> Class</a></li>
<li><a class="reference internal" href="#calender-display-names" id="id3">3 Calender Display Names</a></li>
</ul>
</div>
@@ -36,21 +36,29 @@
Consortium</a>.</p>
</div>
<div class="section" id="the-locale-class">
-<h1>2 The <tt class="docutils literal"><span class="pre">Locale</span></tt> Class</h1>
+<h1>2 The <tt class="docutils literal">Locale</tt> Class</h1>
<p>You normally access such locale data through the <a class="reference external" href="api/babel.core.Locale-class.html">Locale</a> class provided
by Babel:</p>
-<div class="highlight"><pre><span class="gp">>>> </span><span class="kn">from</span> <span class="nn">babel</span> <span class="kn">import</span> <span class="n">Locale</span>
-<span class="gp">>>> </span><span class="n">locale</span> <span class="o">=</span> <span class="n">Locale</span><span class="p">(</span><span class="s">'en'</span><span class="p">,</span> <span class="s">'US'</span><span class="p">)</span>
-<span class="gp">>>> </span><span class="n">locale</span><span class="o">.</span><span class="n">territories</span><span class="p">[</span><span class="s">'US'</span><span class="p">]</span>
-<span class="go">u'United States'</span>
-<span class="gp">>>> </span><span class="n">locale</span> <span class="o">=</span> <span class="n">Locale</span><span class="p">(</span><span class="s">'es'</span><span class="p">,</span> <span class="s">'MX'</span><span class="p">)</span>
-<span class="gp">>>> </span><span class="n">locale</span><span class="o">.</span><span class="n">territories</span><span class="p">[</span><span class="s">'US'</span><span class="p">]</span>
-<span class="go">u'Estados Unidos'</span>
-</pre></div>
+<div class="system-message">
+<p class="system-message-title">System Message: ERROR/3 (<tt class="docutils">doc/display.txt</tt>, line 34)</p>
+<p>Unknown directive type "code-block".</p>
+<pre class="literal-block">
+.. code-block:: pycon
+
+ >>> from babel import Locale
+ >>> locale = Locale('en', 'US')
+ >>> locale.territories['US']
+ u'United States'
+ >>> locale = Locale('es', 'MX')
+ >>> locale.territories['US']
+ u'Estados Unidos'
+
+</pre>
+</div>
<p>In addition to country/territory names, the locale data also provides access to
names of languages, scripts, variants, time zones, and more. Some of the data
is closely related to number and date formatting.</p>
-<p>Most of the corresponding <tt class="docutils literal"><span class="pre">Locale</span></tt> properties return dictionaries, where the
+<p>Most of the corresponding <tt class="docutils literal">Locale</tt> properties return dictionaries, where the
key is a code such as the ISO country and language codes. Consult the API
documentation for references to the relevant specifications.</p>
</div>
@@ -61,24 +69,31 @@
<p>These display names are of course used for date formatting, but can also be
used, for example, to show a list of months to the user in their preferred
language:</p>
-<div class="highlight"><pre><span class="gp">>>> </span><span class="n">locale</span> <span class="o">=</span> <span class="n">Locale</span><span class="p">(</span><span class="s">'es'</span><span class="p">)</span>
-<span class="gp">>>> </span><span class="n">month_names</span> <span class="o">=</span> <span class="n">locale</span><span class="o">.</span><span class="n">months</span><span class="p">[</span><span class="s">'format'</span><span class="p">][</span><span class="s">'wide'</span><span class="p">]</span><span class="o">.</span><span class="n">items</span><span class="p">()</span>
-<span class="gp">>>> </span><span class="n">month_names</span><span class="o">.</span><span class="n">sort</span><span class="p">()</span>
-<span class="gp">>>> </span><span class="k">for</span> <span class="n">idx</span><span class="p">,</span> <span class="n">name</span> <span class="ow">in</span> <span class="n">month_names</span><span class="p">:</span>
-<span class="gp">... </span> <span class="k">print</span> <span class="n">name</span>
-<span class="go">enero</span>
-<span class="go">febrero</span>
-<span class="go">marzo</span>
-<span class="go">abril</span>
-<span class="go">mayo</span>
-<span class="go">junio</span>
-<span class="go">julio</span>
-<span class="go">agosto</span>
-<span class="go">septiembre</span>
-<span class="go">octubre</span>
-<span class="go">noviembre</span>
-<span class="go">diciembre</span>
-</pre></div>
+<div class="system-message">
+<p class="system-message-title">System Message: ERROR/3 (<tt class="docutils">doc/display.txt</tt>, line 65)</p>
+<p>Unknown directive type "code-block".</p>
+<pre class="literal-block">
+.. code-block:: pycon
+
+ >>> locale = Locale('es')
+ >>> month_names = locale.months['format']['wide'].items()
+ >>> month_names.sort()
+ >>> for idx, name in month_names:
+ ... print name
+ enero
+ febrero
+ marzo
+ abril
+ mayo
+ junio
+ julio
+ agosto
+ septiembre
+ octubre
+ noviembre
+ diciembre
+</pre>
+</div>
</div>
<div id="footer">
Visit the Babel open source project at
|
[-]
[+]
|
Changed |
Babel-0.9.6.tar.bz2/doc/index.html
^
|
@@ -3,18 +3,18 @@
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<meta name="generator" content="Docutils 0.5: http://docutils.sourceforge.net/">
+<meta name="generator" content="Docutils 0.7: http://docutils.sourceforge.net/">
<title>Babel: Preface</title>
<link rel="stylesheet" href="common/style/edgewall.css" type="text/css">
</head>
<body>
<div class="document" id="preface">
<div id="navigation">
- <span class="projinfo">Babel 0.9.5</span>
+ <span class="projinfo">Babel 0.9.6</span>
<a href="index.html">Documentation Index</a>
</div>
<h1 class="title">Preface</h1>
-<div align="center" class="align-center"><img alt="Babel" class="logo align-center" src="logo.png" style="width: 426px; height: 187px;"></div>
+<img alt="Babel" class="logo align-center" src="logo.png" style="width: 426px; height: 187px;">
<div class="section" id="simple-internationalization-for-python-applications">
<h1>Simple Internationalization for Python Applications</h1>
<p>Babel is an integrated collection of utilities that assist in
|
[-]
[+]
|
Changed |
Babel-0.9.6.tar.bz2/doc/intro.html
^
|
@@ -3,14 +3,14 @@
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<meta name="generator" content="Docutils 0.5: http://docutils.sourceforge.net/">
+<meta name="generator" content="Docutils 0.7: http://docutils.sourceforge.net/">
<title>Babel: Introduction</title>
<link rel="stylesheet" href="common/style/edgewall.css" type="text/css">
</head>
<body>
<div class="document" id="introduction">
<div id="navigation">
- <span class="projinfo">Babel 0.9.5</span>
+ <span class="projinfo">Babel 0.9.6</span>
<a href="index.html">Documentation Index</a>
</div>
<h1 class="title">Introduction</h1>
@@ -18,7 +18,7 @@
localization (L10N) can be separated into two different aspects:</p>
<blockquote>
<ul class="simple">
-<li>tools to build and work with <tt class="docutils literal"><span class="pre">gettext</span></tt> message catalogs, and</li>
+<li>tools to build and work with <tt class="docutils literal">gettext</tt> message catalogs, and</li>
<li>a Python interface to the CLDR (Common Locale Data Repository), providing
access to various locale display names, localized number and date
formatting, etc.</li>
@@ -36,14 +36,14 @@
<p>While the Python standard library includes a
<a class="reference external" href="http://docs.python.org/lib/module-gettext.html">gettext</a> module that enables
applications to use message catalogs, it requires developers to build these
-catalogs using GNU tools such as <tt class="docutils literal"><span class="pre">xgettext</span></tt>, <tt class="docutils literal"><span class="pre">msgmerge</span></tt>, and <tt class="docutils literal"><span class="pre">msgfmt</span></tt>.
-And while <tt class="docutils literal"><span class="pre">xgettext</span></tt> does have support for extracting messages from Python
+catalogs using GNU tools such as <tt class="docutils literal">xgettext</tt>, <tt class="docutils literal">msgmerge</tt>, and <tt class="docutils literal">msgfmt</tt>.
+And while <tt class="docutils literal">xgettext</tt> does have support for extracting messages from Python
files, it does not know how to deal with other kinds of files commonly found
in Python web-applications, such as templates, nor does it provide an easy
extensibility mechanism to add such support.</p>
<p>Babel addresses this by providing a framework where various extraction methods
can be plugged in to a larger message extraction framework, and also removes
-the dependency on the GNU <tt class="docutils literal"><span class="pre">gettext</span></tt> tools for common tasks, as these aren't
+the dependency on the GNU <tt class="docutils literal">gettext</tt> tools for common tasks, as these aren't
necessarily available on all platforms. See <a class="reference external" href="messages.html">Working with Message Catalogs</a>
for details on this aspect of Babel.</p>
</div>
|
[-]
[+]
|
Changed |
Babel-0.9.6.tar.bz2/doc/messages.html
^
|
@@ -3,14 +3,14 @@
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<meta name="generator" content="Docutils 0.5: http://docutils.sourceforge.net/">
+<meta name="generator" content="Docutils 0.7: http://docutils.sourceforge.net/">
<title>Babel: Working with Message Catalogs</title>
<link rel="stylesheet" href="common/style/edgewall.css" type="text/css">
</head>
<body>
<div class="document" id="working-with-message-catalogs">
<div id="navigation">
- <span class="projinfo">Babel 0.9.5</span>
+ <span class="projinfo">Babel 0.9.6</span>
<a href="index.html">Documentation Index</a>
</div>
<h1 class="title">Working with Message Catalogs</h1>
@@ -33,15 +33,31 @@
</div>
<div class="section" id="introduction">
<h1>1 Introduction</h1>
-<p>The <tt class="docutils literal"><span class="pre">gettext</span></tt> translation system enables you to mark any strings used in your
+<p>The <tt class="docutils literal">gettext</tt> translation system enables you to mark any strings used in your
application as subject to localization, by wrapping them in functions such as
-<tt class="docutils literal"><span class="pre">gettext(str)</span></tt> and <tt class="docutils literal"><span class="pre">ngettext(singular,</span> <span class="pre">plural,</span> <span class="pre">num)</span></tt>. For brevity, the
-<tt class="docutils literal"><span class="pre">gettext</span></tt> function is often aliased to <tt class="docutils literal"><span class="pre">_(str)</span></tt>, so you can write:</p>
-<div class="highlight"><pre><span class="k">print</span> <span class="n">_</span><span class="p">(</span><span class="s">"Hello"</span><span class="p">)</span>
-</pre></div>
+<tt class="docutils literal">gettext(str)</tt> and <tt class="docutils literal">ngettext(singular, plural, num)</tt>. For brevity, the
+<tt class="docutils literal">gettext</tt> function is often aliased to <tt class="docutils literal">_(str)</tt>, so you can write:</p>
+<div class="system-message">
+<p class="system-message-title">System Message: ERROR/3 (<tt class="docutils">doc/messages.txt</tt>, line 20)</p>
+<p>Unknown directive type "code-block".</p>
+<pre class="literal-block">
+.. code-block:: python
+
+ print _("Hello")
+
+</pre>
+</div>
<p>instead of just:</p>
-<div class="highlight"><pre><span class="k">print</span> <span class="s">"Hello"</span>
-</pre></div>
+<div class="system-message">
+<p class="system-message-title">System Message: ERROR/3 (<tt class="docutils">doc/messages.txt</tt>, line 26)</p>
+<p>Unknown directive type "code-block".</p>
+<pre class="literal-block">
+.. code-block:: python
+
+ print "Hello"
+
+</pre>
+</div>
<p>to make the string "Hello" localizable.</p>
<p>Message catalogs are collections of translations for such localizable messages
used in an application. They are commonly stored in PO (Portable Object) and MO
@@ -52,40 +68,40 @@
<p>The general procedure for building message catalogs looks something like this:</p>
<blockquote>
<ul class="simple">
-<li>use a tool (such as <tt class="docutils literal"><span class="pre">xgettext</span></tt>) to extract localizable strings from the
+<li>use a tool (such as <tt class="docutils literal">xgettext</tt>) to extract localizable strings from the
code base and write them to a POT (PO Template) file.</li>
<li>make a copy of the POT file for a specific locale (for example, "en_US")
and start translating the messages</li>
-<li>use a tool such as <tt class="docutils literal"><span class="pre">msgfmt</span></tt> to compile the locale PO file into an binary
+<li>use a tool such as <tt class="docutils literal">msgfmt</tt> to compile the locale PO file into an binary
MO file</li>
<li>later, when code changes make it necessary to update the translations, you
regenerate the POT file and merge the changes into the various
-locale-specific PO files, for example using <tt class="docutils literal"><span class="pre">msgmerge</span></tt></li>
+locale-specific PO files, for example using <tt class="docutils literal">msgmerge</tt></li>
</ul>
</blockquote>
<p>Python provides the <a class="reference external" href="http://docs.python.org/lib/module-gettext.html">gettext module</a> as part of the standard library, which
enables applications to work with appropriately generated MO files.</p>
<blockquote>
</blockquote>
-<p>As <tt class="docutils literal"><span class="pre">gettext</span></tt> provides a solid and well supported foundation for translating
+<p>As <tt class="docutils literal">gettext</tt> provides a solid and well supported foundation for translating
application messages, Babel does not reinvent the wheel, but rather reuses this
infrastructure, and makes it easier to build message catalogs for Python
applications.</p>
</div>
<div class="section" id="message-extraction">
<h1>2 Message Extraction</h1>
-<p>Babel provides functionality similar to that of the <tt class="docutils literal"><span class="pre">xgettext</span></tt> program,
+<p>Babel provides functionality similar to that of the <tt class="docutils literal">xgettext</tt> program,
except that only extraction from Python source files is built-in, while support
for other file formats can be added using a simple extension mechanism.</p>
-<p>Unlike <tt class="docutils literal"><span class="pre">xgettext</span></tt>, which is usually invoked once for every file, the routines
+<p>Unlike <tt class="docutils literal">xgettext</tt>, which is usually invoked once for every file, the routines
for message extraction in Babel operate on directories. While the per-file
-approach of <tt class="docutils literal"><span class="pre">xgettext</span></tt> works nicely with projects using a <tt class="docutils literal"><span class="pre">Makefile</span></tt>,
-Python projects rarely use <tt class="docutils literal"><span class="pre">make</span></tt>, and thus a different mechanism is needed
+approach of <tt class="docutils literal">xgettext</tt> works nicely with projects using a <tt class="docutils literal">Makefile</tt>,
+Python projects rarely use <tt class="docutils literal">make</tt>, and thus a different mechanism is needed
for extracting messages from the heterogeneous collection of source files that
many Python projects are composed of.</p>
<p>When message extraction is based on directories instead of individual files,
there needs to be a way to configure which files should be treated in which
-manner. For example, while many projects may contain <tt class="docutils literal"><span class="pre">.html</span></tt> files, some of
+manner. For example, while many projects may contain <tt class="docutils literal">.html</tt> files, some of
those files may be static HTML files that don't contain localizable message,
while others may be <a class="reference external" href="http://www.djangoproject.com/">Django</a> templates, and still others may contain <a class="reference external" href="http://genshi.edgewall.org/">Genshi</a>
markup templates. Some projects may even mix HTML files for different templates
@@ -116,50 +132,58 @@
available depends on the specific extraction method).</p>
<p>For example, the following configuration adds extraction of messages from both
Genshi markup templates and text templates:</p>
-<div class="highlight"><pre><span class="c"># Extraction from Python source files</span>
+<div class="system-message">
+<p class="system-message-title">System Message: ERROR/3 (<tt class="docutils">doc/messages.txt</tt>, line 125)</p>
+<p>Unknown directive type "code-block".</p>
+<pre class="literal-block">
+.. code-block:: ini
+
+ # Extraction from Python source files
+
+ [python: **.py]
+
+ # Extraction from Genshi HTML and text templates
-<span class="k">[python: **.py]</span>
+ [genshi: **/templates/**.html]
+ ignore_tags = script,style
+ include_attrs = alt title summary
-<span class="c"># Extraction from Genshi HTML and text templates</span>
+ [genshi: **/templates/**.txt]
+ template_class = genshi.template:TextTemplate
+ encoding = ISO-8819-15
-<span class="k">[genshi: **/templates/**.html]</span>
-<span class="na">ignore_tags</span> <span class="o">=</span> <span class="s">script,style</span>
-<span class="na">include_attrs</span> <span class="o">=</span> <span class="s">alt title summary</span>
-
-<span class="k">[genshi: **/templates/**.txt]</span>
-<span class="na">template_class</span> <span class="o">=</span> <span class="s">genshi.template:TextTemplate</span>
-<span class="na">encoding</span> <span class="o">=</span> <span class="s">ISO-8819-15</span>
-</pre></div>
-<p>The configuration file syntax is based on the format commonly found in <tt class="docutils literal"><span class="pre">.INI</span></tt>
-files on Windows systems, and as supported by the <tt class="docutils literal"><span class="pre">ConfigParser</span></tt> module in
+</pre>
+</div>
+<p>The configuration file syntax is based on the format commonly found in <tt class="docutils literal">.INI</tt>
+files on Windows systems, and as supported by the <tt class="docutils literal">ConfigParser</tt> module in
the Python standard library. Section names (the strings enclosed in square
brackets) specify both the name of the extraction method, and the extended glob
pattern to specify the files that this extraction method should be used for,
separated by a colon. The options in the sections are passed to the extraction
method. Which options are available is specific to the extraction method used.</p>
<p>The extended glob patterns used in this configuration are similar to the glob
-patterns provided by most shells. A single asterisk (<tt class="docutils literal"><span class="pre">*</span></tt>) is a wildcard for
+patterns provided by most shells. A single asterisk (<tt class="docutils literal">*</tt>) is a wildcard for
any number of characters (except for the pathname component separator "/"),
-while a question mark (<tt class="docutils literal"><span class="pre">?</span></tt>) only matches a single character. In addition,
-two subsequent asterisk characters (<tt class="docutils literal"><span class="pre">**</span></tt>) can be used to make the wildcard
+while a question mark (<tt class="docutils literal">?</tt>) only matches a single character. In addition,
+two subsequent asterisk characters (<tt class="docutils literal">**</tt>) can be used to make the wildcard
match any directory level, so the pattern <tt class="docutils literal"><span class="pre">**.txt</span></tt> matches any file with the
-extension <tt class="docutils literal"><span class="pre">.txt</span></tt> in any directory.</p>
-<p>Lines that start with a <tt class="docutils literal"><span class="pre">#</span></tt> or <tt class="docutils literal"><span class="pre">;</span></tt> character are ignored and can be used
+extension <tt class="docutils literal">.txt</tt> in any directory.</p>
+<p>Lines that start with a <tt class="docutils literal">#</tt> or <tt class="docutils literal">;</tt> character are ignored and can be used
for comments. Empty lines are ignored, too.</p>
<div class="note">
<p class="first admonition-title">Note</p>
<p class="last">if you're performing message extraction using the command Babel
-provides for integration into <tt class="docutils literal"><span class="pre">setup.py</span></tt> scripts, you can also
+provides for integration into <tt class="docutils literal">setup.py</tt> scripts, you can also
provide this configuration in a different way, namely as a keyword
-argument to the <tt class="docutils literal"><span class="pre">setup()</span></tt> function. See <a class="reference external" href="setup.html">Distutils/Setuptools
+argument to the <tt class="docutils literal">setup()</tt> function. See <a class="reference external" href="setup.html">Distutils/Setuptools
Integration</a> for more information.</p>
</div>
<div class="section" id="default-extraction-methods">
<h3>2.2.1 Default Extraction Methods</h3>
-<p>Babel comes with only two builtin extractors: <tt class="docutils literal"><span class="pre">python</span></tt> (which extracts
-messages from Python source files) and <tt class="docutils literal"><span class="pre">ignore</span></tt> (which extracts nothing).</p>
-<p>The <tt class="docutils literal"><span class="pre">python</span></tt> extractor is by default mapped to the glob pattern <tt class="docutils literal"><span class="pre">**.py</span></tt>,
-meaning it'll be applied to all files with the <tt class="docutils literal"><span class="pre">.py</span></tt> extension in any
+<p>Babel comes with only two builtin extractors: <tt class="docutils literal">python</tt> (which extracts
+messages from Python source files) and <tt class="docutils literal">ignore</tt> (which extracts nothing).</p>
+<p>The <tt class="docutils literal">python</tt> extractor is by default mapped to the glob pattern <tt class="docutils literal"><span class="pre">**.py</span></tt>,
+meaning it'll be applied to all files with the <tt class="docutils literal">.py</tt> extension in any
directory. If you specify your own mapping configuration, this default mapping
is discarded, so you need to explicitly add it to your mapping (as shown in the
example above.)</p>
@@ -172,59 +196,83 @@
<p>If this is not possible for some reason, you need to map the short names to
fully qualified function names in an extract section in the mapping
configuration. For example:</p>
-<div class="highlight"><pre><span class="c"># Some custom extraction method</span>
+<div class="system-message">
+<p class="system-message-title">System Message: ERROR/3 (<tt class="docutils">doc/messages.txt</tt>, line 195)</p>
+<p>Unknown directive type "code-block".</p>
+<pre class="literal-block">
+.. code-block:: ini
+
+ # Some custom extraction method
-<span class="k">[extractors]</span>
-<span class="na">custom</span> <span class="o">=</span> <span class="s">mypackage.module:extract_custom</span>
+ [extractors]
+ custom = mypackage.module:extract_custom
-<span class="k">[custom: **.ctm]</span>
-<span class="na">some_option</span> <span class="o">=</span> <span class="s">foo</span>
-</pre></div>
-<p>Note that the builtin extraction methods <tt class="docutils literal"><span class="pre">python</span></tt> and <tt class="docutils literal"><span class="pre">ignore</span></tt> are available
+ [custom: **.ctm]
+ some_option = foo
+
+</pre>
+</div>
+<p>Note that the builtin extraction methods <tt class="docutils literal">python</tt> and <tt class="docutils literal">ignore</tt> are available
by default, even if <a class="reference external" href="http://peak.telecommunity.com/DevCenter/PkgResources">pkg_resources</a> is not installed. You should never need to
-explicitly define them in the <tt class="docutils literal"><span class="pre">[extractors]</span></tt> section.</p>
+explicitly define them in the <tt class="docutils literal">[extractors]</tt> section.</p>
</div>
</div>
<div class="section" id="writing-extraction-methods">
<h2>2.3 Writing Extraction Methods</h2>
<p>Adding new methods for extracting localizable methods is easy. First, you'll
need to implement a function that complies with the following interface:</p>
-<div class="highlight"><pre><span class="k">def</span> <span class="nf">extract_xxx</span><span class="p">(</span><span class="n">fileobj</span><span class="p">,</span> <span class="n">keywords</span><span class="p">,</span> <span class="n">comment_tags</span><span class="p">,</span> <span class="n">options</span><span class="p">):</span>
- <span class="sd">"""Extract messages from XXX files.</span>
+<div class="system-message">
+<p class="system-message-title">System Message: ERROR/3 (<tt class="docutils">doc/messages.txt</tt>, line 220)</p>
+<p>Unknown directive type "code-block".</p>
+<pre class="literal-block">
+.. code-block:: python
+
+ def extract_xxx(fileobj, keywords, comment_tags, options):
+ """Extract messages from XXX files.
-<span class="sd"> :param fileobj: the file-like object the messages should be extracted</span>
-<span class="sd"> from</span>
-<span class="sd"> :param keywords: a list of keywords (i.e. function names) that should</span>
-<span class="sd"> be recognized as translation functions</span>
-<span class="sd"> :param comment_tags: a list of translator tags to search for and</span>
-<span class="sd"> include in the results</span>
-<span class="sd"> :param options: a dictionary of additional options (optional)</span>
-<span class="sd"> :return: an iterator over ``(lineno, funcname, message, comments)``</span>
-<span class="sd"> tuples</span>
-<span class="sd"> :rtype: ``iterator``</span>
-<span class="sd"> """</span>
-</pre></div>
+ :param fileobj: the file-like object the messages should be extracted
+ from
+ :param keywords: a list of keywords (i.e. function names) that should
+ be recognized as translation functions
+ :param comment_tags: a list of translator tags to search for and
+ include in the results
+ :param options: a dictionary of additional options (optional)
+ :return: an iterator over ``(lineno, funcname, message, comments)``
+ tuples
+ :rtype: ``iterator``
+ """
+
+</pre>
+</div>
<div class="note">
<p class="first admonition-title">Note</p>
<p class="last">Any strings in the tuples produced by this function must be either
-<tt class="docutils literal"><span class="pre">unicode</span></tt> objects, or <tt class="docutils literal"><span class="pre">str</span></tt> objects using plain ASCII characters.
+<tt class="docutils literal">unicode</tt> objects, or <tt class="docutils literal">str</tt> objects using plain ASCII characters.
That means that if sources contain strings using other encodings, it
is the job of the extractor implementation to do the decoding to
-<tt class="docutils literal"><span class="pre">unicode</span></tt> objects.</p>
+<tt class="docutils literal">unicode</tt> objects.</p>
</div>
<p>Next, you should register that function as an entry point. This requires your
-<tt class="docutils literal"><span class="pre">setup.py</span></tt> script to use <a class="reference external" href="http://peak.telecommunity.com/DevCenter/setuptools">setuptools</a>, and your package to be installed with
+<tt class="docutils literal">setup.py</tt> script to use <a class="reference external" href="http://peak.telecommunity.com/DevCenter/setuptools">setuptools</a>, and your package to be installed with
the necessary metadata. If that's taken care of, add something like the
-following to your <tt class="docutils literal"><span class="pre">setup.py</span></tt> script:</p>
-<div class="highlight"><pre><span class="k">def</span> <span class="nf">setup</span><span class="p">(</span><span class="o">...</span>
+following to your <tt class="docutils literal">setup.py</tt> script:</p>
+<div class="system-message">
+<p class="system-message-title">System Message: ERROR/3 (<tt class="docutils">doc/messages.txt</tt>, line 248)</p>
+<p>Unknown directive type "code-block".</p>
+<pre class="literal-block">
+.. code-block:: python
- <span class="n">entry_points</span> <span class="o">=</span> <span class="s">"""</span>
-<span class="s"> [babel.extractors]</span>
-<span class="s"> xxx = your.package:extract_xxx</span>
-<span class="s"> """</span><span class="p">,</span>
-</pre></div>
+ def setup(...
+
+ entry_points = """
+ [babel.extractors]
+ xxx = your.package:extract_xxx
+ """,
+
+</pre>
+</div>
<p>That is, add your extraction method to the entry point group
-<tt class="docutils literal"><span class="pre">babel.extractors</span></tt>, where the name of the entry point is the name that people
+<tt class="docutils literal">babel.extractors</tt>, where the name of the entry point is the name that people
will use to reference the extraction method, and the value being the module and
the name of the function (separated by a colon) implementing the actual
extraction.</p>
@@ -243,11 +291,19 @@
calls, as shown on the following example:</p>
<blockquote>
</blockquote>
-<div class="highlight"><pre><span class="c"># NOTE: This is a comment about `Foo Bar`</span>
-<span class="n">_</span><span class="p">(</span><span class="s">'Foo Bar'</span><span class="p">)</span>
-</pre></div>
-<p>The comments tag for the above example would be <tt class="docutils literal"><span class="pre">NOTE:</span></tt>, and the translator
-comment for that tag would be <tt class="docutils literal"><span class="pre">This</span> <span class="pre">is</span> <span class="pre">a</span> <span class="pre">comment</span> <span class="pre">about</span> <span class="pre">`Foo</span> <span class="pre">Bar`</span></tt>.</p>
+<div class="system-message">
+<p class="system-message-title">System Message: ERROR/3 (<tt class="docutils">doc/messages.txt</tt>, line 281)</p>
+<p>Unknown directive type "code-block".</p>
+<pre class="literal-block">
+.. code-block:: python
+
+ # NOTE: This is a comment about `Foo Bar`
+ _('Foo Bar')
+
+</pre>
+</div>
+<p>The comments tag for the above example would be <tt class="docutils literal">NOTE:</tt>, and the translator
+comment for that tag would be <tt class="docutils literal">This is a comment about `Foo Bar`</tt>.</p>
<p>The resulting output in the catalog template would be something like:</p>
<pre class="literal-block">
#. This is a comment about `Foo Bar`
|
[-]
[+]
|
Changed |
Babel-0.9.6.tar.bz2/doc/numbers.html
^
|
@@ -3,14 +3,14 @@
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<meta name="generator" content="Docutils 0.5: http://docutils.sourceforge.net/">
+<meta name="generator" content="Docutils 0.7: http://docutils.sourceforge.net/">
<title>Babel: Number Formatting</title>
<link rel="stylesheet" href="common/style/edgewall.css" type="text/css">
</head>
<body>
<div class="document" id="number-formatting">
<div id="navigation">
- <span class="projinfo">Babel 0.9.5</span>
+ <span class="projinfo">Babel 0.9.6</span>
<a href="index.html">Documentation Index</a>
</div>
<h1 class="title">Number Formatting</h1>
@@ -22,17 +22,34 @@
</ul>
</div>
<p>Support for locale-specific formatting and parsing of numbers is provided by
-the <tt class="docutils literal"><span class="pre">babel.numbers</span></tt> module:</p>
-<div class="highlight"><pre><span class="gp">>>> </span><span class="kn">from</span> <span class="nn">babel.numbers</span> <span class="kn">import</span> <span class="n">format_number</span><span class="p">,</span> <span class="n">format_decimal</span><span class="p">,</span> <span class="n">format_percent</span>
-</pre></div>
+the <tt class="docutils literal">babel.numbers</tt> module:</p>
+<div class="system-message">
+<p class="system-message-title">System Message: ERROR/3 (<tt class="docutils">doc/numbers.txt</tt>, line 16)</p>
+<p>Unknown directive type "code-block".</p>
+<pre class="literal-block">
+.. code-block:: pycon
+
+ >>> from babel.numbers import format_number, format_decimal, format_percent
+
+</pre>
+</div>
<p>Examples:</p>
-<div class="highlight"><pre><span class="gp">>>> </span><span class="n">format_decimal</span><span class="p">(</span><span class="mf">1.2345</span><span class="p">,</span> <span class="n">locale</span><span class="o">=</span><span class="s">'en_US'</span><span class="p">)</span>
-<span class="go">u'1.234'</span>
-<span class="gp">>>> </span><span class="n">format_decimal</span><span class="p">(</span><span class="mf">1.2345</span><span class="p">,</span> <span class="n">locale</span><span class="o">=</span><span class="s">'sv_SE'</span><span class="p">)</span>
-<span class="go">u'1,234'</span>
-<span class="gp">>>> </span><span class="n">format_decimal</span><span class="p">(</span><span class="mi">12345</span><span class="p">,</span> <span class="n">locale</span><span class="o">=</span><span class="s">'de_DE'</span><span class="p">)</span>
-<span class="go">u'12.345'</span>
-</pre></div>
+<div class="system-message">
+<p class="system-message-title">System Message: ERROR/3 (<tt class="docutils">doc/numbers.txt</tt>, line 22)</p>
+<p>Unknown directive type "code-block".</p>
+<pre class="literal-block">
+.. code-block:: pycon
+
+ >>> format_decimal(1.2345, locale='en_US')
+ u'1.234'
+ >>> format_decimal(1.2345, locale='sv_SE')
+ u'1,234'
+ >>> format_decimal(12345, locale='de_DE')
+ u'12.345'
+
+
+</pre>
+</div>
<div class="section" id="pattern-syntax">
<h1>1 Pattern Syntax</h1>
<p>While Babel makes it simple to use the appropriate number format for a given
@@ -40,11 +57,19 @@
formatting patterns, the patterns Babel supports for number formatting are
based on the <a class="reference external" href="http://unicode.org/reports/tr35/#Number_Format_Patterns">Locale Data Markup Language specification</a> (LDML).</p>
<p>Examples:</p>
-<div class="highlight"><pre><span class="gp">>>> </span><span class="n">format_decimal</span><span class="p">(</span><span class="o">-</span><span class="mf">1.2345</span><span class="p">,</span> <span class="n">format</span><span class="o">=</span><span class="s">'#,##0.##;-#'</span><span class="p">,</span> <span class="n">locale</span><span class="o">=</span><span class="s">'en'</span><span class="p">)</span>
-<span class="go">u'-1.23'</span>
-<span class="gp">>>> </span><span class="n">format_decimal</span><span class="p">(</span><span class="o">-</span><span class="mf">1.2345</span><span class="p">,</span> <span class="n">format</span><span class="o">=</span><span class="s">'#,##0.##;(#)'</span><span class="p">,</span> <span class="n">locale</span><span class="o">=</span><span class="s">'en'</span><span class="p">)</span>
-<span class="go">u'(1.23)'</span>
-</pre></div>
+<div class="system-message">
+<p class="system-message-title">System Message: ERROR/3 (<tt class="docutils">doc/numbers.txt</tt>, line 42)</p>
+<p>Unknown directive type "code-block".</p>
+<pre class="literal-block">
+.. code-block:: pycon
+
+ >>> format_decimal(-1.2345, format='#,##0.##;-#', locale='en')
+ u'-1.23'
+ >>> format_decimal(-1.2345, format='#,##0.##;(#)', locale='en')
+ u'(1.23)'
+
+</pre>
+</div>
<p>The syntax for custom number format patterns is described in detail in the
the specification. The following table is just a relatively brief overview.</p>
<blockquote>
@@ -60,51 +85,51 @@
</tr>
</thead>
<tbody valign="top">
-<tr><td><tt class="docutils literal"><span class="pre">0</span></tt></td>
+<tr><td><tt class="docutils literal">0</tt></td>
<td>Digit</td>
</tr>
<tr><td><tt class="docutils literal"><span class="pre">1-9</span></tt></td>
<td>'1' through '9' indicate rounding.</td>
</tr>
-<tr><td><tt class="docutils literal"><span class="pre">@</span></tt></td>
+<tr><td><tt class="docutils literal">@</tt></td>
<td>Significant digit</td>
</tr>
-<tr><td><tt class="docutils literal"><span class="pre">#</span></tt></td>
+<tr><td><tt class="docutils literal">#</tt></td>
<td>Digit, zero shows as absent</td>
</tr>
-<tr><td><tt class="docutils literal"><span class="pre">.</span></tt></td>
+<tr><td><tt class="docutils literal">.</tt></td>
<td>Decimal separator or monetary decimal separator</td>
</tr>
-<tr><td><tt class="docutils literal"><span class="pre">-</span></tt></td>
+<tr><td><tt class="docutils literal">-</tt></td>
<td>Minus sign</td>
</tr>
-<tr><td><tt class="docutils literal"><span class="pre">,</span></tt></td>
+<tr><td><tt class="docutils literal">,</tt></td>
<td>Grouping separator</td>
</tr>
-<tr><td><tt class="docutils literal"><span class="pre">E</span></tt></td>
+<tr><td><tt class="docutils literal">E</tt></td>
<td>Separates mantissa and exponent in scientific notation</td>
</tr>
-<tr><td><tt class="docutils literal"><span class="pre">+</span></tt></td>
+<tr><td><tt class="docutils literal">+</tt></td>
<td>Prefix positive exponents with localized plus sign</td>
</tr>
-<tr><td><tt class="docutils literal"><span class="pre">;</span></tt></td>
+<tr><td><tt class="docutils literal">;</tt></td>
<td>Separates positive and negative subpatterns</td>
</tr>
-<tr><td><tt class="docutils literal"><span class="pre">%</span></tt></td>
+<tr><td><tt class="docutils literal">%</tt></td>
<td>Multiply by 100 and show as percentage</td>
</tr>
-<tr><td><tt class="docutils literal"><span class="pre">‰</span></tt></td>
+<tr><td><tt class="docutils literal">‰</tt></td>
<td>Multiply by 1000 and show as per mille</td>
</tr>
-<tr><td><tt class="docutils literal"><span class="pre">¤</span></tt></td>
+<tr><td><tt class="docutils literal">¤</tt></td>
<td>Currency sign, replaced by currency symbol. If doubled,
replaced by international currency symbol. If tripled, uses the
long form of the decimal symbol.</td>
</tr>
-<tr><td><tt class="docutils literal"><span class="pre">'</span></tt></td>
+<tr><td><tt class="docutils literal">'</tt></td>
<td>Used to quote special characters in a prefix or suffix</td>
</tr>
-<tr><td><tt class="docutils literal"><span class="pre">*</span></tt></td>
+<tr><td><tt class="docutils literal">*</tt></td>
<td>Pad escape, precedes pad character</td>
</tr>
</tbody>
@@ -115,18 +140,34 @@
<div class="section" id="parsing-numbers">
<h1>2 Parsing Numbers</h1>
<p>Babel can also parse numeric data in a locale-sensitive manner:</p>
-<div class="highlight"><pre><span class="gp">>>> </span><span class="kn">from</span> <span class="nn">babel.numbers</span> <span class="kn">import</span> <span class="n">parse_decimal</span><span class="p">,</span> <span class="n">parse_number</span>
-</pre></div>
+<div class="system-message">
+<p class="system-message-title">System Message: ERROR/3 (<tt class="docutils">doc/numbers.txt</tt>, line 96)</p>
+<p>Unknown directive type "code-block".</p>
+<pre class="literal-block">
+.. code-block:: pycon
+
+ >>> from babel.numbers import parse_decimal, parse_number
+
+</pre>
+</div>
<p>Examples:</p>
-<div class="highlight"><pre><span class="gp">>>> </span><span class="n">parse_decimal</span><span class="p">(</span><span class="s">'1,099.98'</span><span class="p">,</span> <span class="n">locale</span><span class="o">=</span><span class="s">'en_US'</span><span class="p">)</span>
-<span class="go">1099.98</span>
-<span class="gp">>>> </span><span class="n">parse_decimal</span><span class="p">(</span><span class="s">'1.099,98'</span><span class="p">,</span> <span class="n">locale</span><span class="o">=</span><span class="s">'de'</span><span class="p">)</span>
-<span class="go">1099.98</span>
-<span class="gp">>>> </span><span class="n">parse_decimal</span><span class="p">(</span><span class="s">'2,109,998'</span><span class="p">,</span> <span class="n">locale</span><span class="o">=</span><span class="s">'de'</span><span class="p">)</span>
-<span class="gt">Traceback (most recent call last):</span>
- <span class="c">...</span>
-<span class="nc">NumberFormatError</span>: <span class="n-Identifier">'2,109,998' is not a valid decimal number</span>
-</pre></div>
+<div class="system-message">
+<p class="system-message-title">System Message: ERROR/3 (<tt class="docutils">doc/numbers.txt</tt>, line 102)</p>
+<p>Unknown directive type "code-block".</p>
+<pre class="literal-block">
+.. code-block:: pycon
+
+ >>> parse_decimal('1,099.98', locale='en_US')
+ 1099.98
+ >>> parse_decimal('1.099,98', locale='de')
+ 1099.98
+ >>> parse_decimal('2,109,998', locale='de')
+ Traceback (most recent call last):
+ ...
+ NumberFormatError: '2,109,998' is not a valid decimal number
+
+</pre>
+</div>
<div class="note">
<p class="first admonition-title">Note</p>
<p class="last">Number parsing is not properly implemented yet</p>
|
[-]
[+]
|
Changed |
Babel-0.9.6.tar.bz2/doc/setup.html
^
|
@@ -3,34 +3,43 @@
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<meta name="generator" content="Docutils 0.5: http://docutils.sourceforge.net/">
+<meta name="generator" content="Docutils 0.7: http://docutils.sourceforge.net/">
<title>Babel: Distutils/Setuptools Integration</title>
<link rel="stylesheet" href="common/style/edgewall.css" type="text/css">
</head>
<body>
<div class="document" id="distutils-setuptools-integration">
<div id="navigation">
- <span class="projinfo">Babel 0.9.5</span>
+ <span class="projinfo">Babel 0.9.6</span>
<a href="index.html">Documentation Index</a>
</div>
<h1 class="title">Distutils/Setuptools Integration</h1>
-<p>Babel provides commands for integration into <tt class="docutils literal"><span class="pre">setup.py</span></tt> scripts, based on
-either the <tt class="docutils literal"><span class="pre">distutils</span></tt> package that is part of the Python standard library,
-or the third-party <tt class="docutils literal"><span class="pre">setuptools</span></tt> package.</p>
+<p>Babel provides commands for integration into <tt class="docutils literal">setup.py</tt> scripts, based on
+either the <tt class="docutils literal">distutils</tt> package that is part of the Python standard library,
+or the third-party <tt class="docutils literal">setuptools</tt> package.</p>
<p>These commands are available by default when Babel has been properly installed,
-and <tt class="docutils literal"><span class="pre">setup.py</span></tt> is using <tt class="docutils literal"><span class="pre">setuptools</span></tt>. For projects that use plain old
-<tt class="docutils literal"><span class="pre">distutils</span></tt>, the commands need to be registered explicitly, for example:</p>
-<div class="highlight"><pre><span class="kn">from</span> <span class="nn">distutils.core</span> <span class="kn">import</span> <span class="n">setup</span>
-<span class="kn">from</span> <span class="nn">babel.messages</span> <span class="kn">import</span> <span class="n">frontend</span> <span class="k">as</span> <span class="n">babel</span>
-
-<span class="n">setup</span><span class="p">(</span>
- <span class="o">...</span>
- <span class="n">cmdclass</span> <span class="o">=</span> <span class="p">{</span><span class="s">'compile_catalog'</span><span class="p">:</span> <span class="n">babel</span><span class="o">.</span><span class="n">compile_catalog</span><span class="p">,</span>
- <span class="s">'extract_messages'</span><span class="p">:</span> <span class="n">babel</span><span class="o">.</span><span class="n">extract_messages</span><span class="p">,</span>
- <span class="s">'init_catalog'</span><span class="p">:</span> <span class="n">babel</span><span class="o">.</span><span class="n">init_catalog</span><span class="p">,</span>
- <span class="s">'update_catalog'</span><span class="p">:</span> <span class="n">babel</span><span class="o">.</span><span class="n">update_catalog</span><span class="p">}</span>
-<span class="p">)</span>
-</pre></div>
+and <tt class="docutils literal">setup.py</tt> is using <tt class="docutils literal">setuptools</tt>. For projects that use plain old
+<tt class="docutils literal">distutils</tt>, the commands need to be registered explicitly, for example:</p>
+<div class="system-message">
+<p class="system-message-title">System Message: ERROR/3 (<tt class="docutils">doc/setup.txt</tt>, line 15)</p>
+<p>Unknown directive type "code-block".</p>
+<pre class="literal-block">
+.. code-block:: python
+
+ from distutils.core import setup
+ from babel.messages import frontend as babel
+
+ setup(
+ ...
+ cmdclass = {'compile_catalog': babel.compile_catalog,
+ 'extract_messages': babel.extract_messages,
+ 'init_catalog': babel.init_catalog,
+ 'update_catalog': babel.update_catalog}
+ )
+
+
+</pre>
+</div>
<div class="contents topic" id="contents">
<p class="topic-title first">Contents</p>
<ul class="auto-toc simple">
@@ -55,10 +64,10 @@
</div>
<div class="section" id="compile-catalog">
<h1>1 compile_catalog</h1>
-<p>The <tt class="docutils literal"><span class="pre">compile_catalog</span></tt> command is similar to the GNU <tt class="docutils literal"><span class="pre">msgfmt</span></tt> tool, in that
+<p>The <tt class="docutils literal">compile_catalog</tt> command is similar to the GNU <tt class="docutils literal">msgfmt</tt> tool, in that
it takes a message catalog from a PO file and compiles it to a binary MO file.</p>
<p>If the command has been correctly installed or registered, a project's
-<tt class="docutils literal"><span class="pre">setup.py</span></tt> script should allow you to use the command:</p>
+<tt class="docutils literal">setup.py</tt> script should allow you to use the command:</p>
<pre class="literal-block">
$ ./setup.py compile_catalog --help
Global options:
@@ -70,15 +79,15 @@
Options for 'compile_catalog' command:
...
</pre>
-<p>Running the command will produce a PO template file:</p>
+<p>Running the command will produce a binary MO file:</p>
<pre class="literal-block">
$ ./setup.py compile_catalog --directory foobar/locale --locale pt_BR
running compile_catalog
-compiling catalog to to foobar/locale/pt_BR/LC_MESSAGES/messages.mo
+compiling catalog to foobar/locale/pt_BR/LC_MESSAGES/messages.mo
</pre>
<div class="section" id="options">
<h2>1.1 Options</h2>
-<p>The <tt class="docutils literal"><span class="pre">compile_catalog</span></tt> command accepts the following options:</p>
+<p>The <tt class="docutils literal">compile_catalog</tt> command accepts the following options:</p>
<blockquote>
<table border="1" class="docutils">
<colgroup>
@@ -116,25 +125,25 @@
</tbody>
</table>
</blockquote>
-<p>If <tt class="docutils literal"><span class="pre">directory</span></tt> is specified, but <tt class="docutils literal"><span class="pre">output-file</span></tt> is not, the default filename
+<p>If <tt class="docutils literal">directory</tt> is specified, but <tt class="docutils literal"><span class="pre">output-file</span></tt> is not, the default filename
of the output file will be:</p>
<pre class="literal-block">
<directory>/<locale>/LC_MESSAGES/<domain>.mo
</pre>
-<p>If neither the <tt class="docutils literal"><span class="pre">input_file</span></tt> nor the <tt class="docutils literal"><span class="pre">locale</span></tt> option is set, this command
+<p>If neither the <tt class="docutils literal">input_file</tt> nor the <tt class="docutils literal">locale</tt> option is set, this command
looks for all catalog files in the base directory that match the given domain,
and compiles each of them to MO files in the same directory.</p>
<p>These options can either be specified on the command-line, or in the
-<tt class="docutils literal"><span class="pre">setup.cfg</span></tt> file.</p>
+<tt class="docutils literal">setup.cfg</tt> file.</p>
</div>
</div>
<div class="section" id="extract-messages">
<h1>2 extract_messages</h1>
-<p>The <tt class="docutils literal"><span class="pre">extract_messages</span></tt> command is comparable to the GNU <tt class="docutils literal"><span class="pre">xgettext</span></tt> program:
+<p>The <tt class="docutils literal">extract_messages</tt> command is comparable to the GNU <tt class="docutils literal">xgettext</tt> program:
it can extract localizable messages from a variety of difference source files,
and generate a PO (portable object) template file from the collected messages.</p>
<p>If the command has been correctly installed or registered, a project's
-<tt class="docutils literal"><span class="pre">setup.py</span></tt> script should allow you to use the command:</p>
+<tt class="docutils literal">setup.py</tt> script should allow you to use the command:</p>
<pre class="literal-block">
$ ./setup.py extract_messages --help
Global options:
@@ -160,27 +169,36 @@
<p>The mapping of file patterns to extraction methods (and options) can be
specified using a configuration file that is pointed to using the
<tt class="docutils literal"><span class="pre">--mapping-file</span></tt> option shown above. Alternatively, you can configure the
-mapping directly in <tt class="docutils literal"><span class="pre">setup.py</span></tt> using a keyword argument to the <tt class="docutils literal"><span class="pre">setup()</span></tt>
+mapping directly in <tt class="docutils literal">setup.py</tt> using a keyword argument to the <tt class="docutils literal">setup()</tt>
function:</p>
-<div class="highlight"><pre><span class="n">setup</span><span class="p">(</span><span class="o">...</span>
+<div class="system-message">
+<p class="system-message-title">System Message: ERROR/3 (<tt class="docutils">doc/setup.txt</tt>, line 136)</p>
+<p>Unknown directive type "code-block".</p>
+<pre class="literal-block">
+.. code-block:: python
+
+ setup(...
- <span class="n">message_extractors</span> <span class="o">=</span> <span class="p">{</span>
- <span class="s">'foobar'</span><span class="p">:</span> <span class="p">[</span>
- <span class="p">(</span><span class="s">'**.py'</span><span class="p">,</span> <span class="s">'python'</span><span class="p">,</span> <span class="bp">None</span><span class="p">),</span>
- <span class="p">(</span><span class="s">'**/templates/**.html'</span><span class="p">,</span> <span class="s">'genshi'</span><span class="p">,</span> <span class="bp">None</span><span class="p">),</span>
- <span class="p">(</span><span class="s">'**/templates/**.txt'</span><span class="p">,</span> <span class="s">'genshi'</span><span class="p">,</span> <span class="p">{</span>
- <span class="s">'template_class'</span><span class="p">:</span> <span class="s">'genshi.template:TextTemplate'</span>
- <span class="p">})</span>
- <span class="p">],</span>
- <span class="p">},</span>
-
- <span class="o">...</span>
-<span class="p">)</span>
-</pre></div>
+ message_extractors = {
+ 'foobar': [
+ ('**.py', 'python', None),
+ ('**/templates/**.html', 'genshi', None),
+ ('**/templates/**.txt', 'genshi', {
+ 'template_class': 'genshi.template:TextTemplate'
+ })
+ ],
+ },
+
+ ...
+ )
+
+
+</pre>
+</div>
</div>
<div class="section" id="id1">
<h2>2.2 Options</h2>
-<p>The <tt class="docutils literal"><span class="pre">extract_messages</span></tt> command accepts the following options:</p>
+<p>The <tt class="docutils literal">extract_messages</tt> command accepts the following options:</p>
<blockquote>
<table border="1" class="docutils">
<colgroup>
@@ -248,29 +266,37 @@
</table>
</blockquote>
<p>These options can either be specified on the command-line, or in the
-<tt class="docutils literal"><span class="pre">setup.cfg</span></tt> file. In the latter case, the options above become entries of the
-section <tt class="docutils literal"><span class="pre">[extract_messages]</span></tt>, and the option names are changed to use
+<tt class="docutils literal">setup.cfg</tt> file. In the latter case, the options above become entries of the
+section <tt class="docutils literal">[extract_messages]</tt>, and the option names are changed to use
underscore characters instead of dashes, for example:</p>
-<div class="highlight"><pre><span class="k">[extract_messages]</span>
-<span class="na">keywords</span> <span class="o">=</span> <span class="s">_, gettext, ngettext</span>
-<span class="na">mapping_file</span> <span class="o">=</span> <span class="s">babel.cfg</span>
-<span class="na">width</span> <span class="o">=</span> <span class="s">80</span>
-</pre></div>
+<div class="system-message">
+<p class="system-message-title">System Message: ERROR/3 (<tt class="docutils">doc/setup.txt</tt>, line 204)</p>
+<p>Unknown directive type "code-block".</p>
+<pre class="literal-block">
+.. code-block:: ini
+
+ [extract_messages]
+ keywords = _, gettext, ngettext
+ mapping_file = babel.cfg
+ width = 80
+
+</pre>
+</div>
<p>This would be equivalent to invoking the command from the command-line as
follows:</p>
<pre class="literal-block">
$ setup.py extract_messages -k _ -k gettext -k ngettext -F mapping.cfg -w 80
</pre>
-<p>Any path names are interpreted relative to the location of the <tt class="docutils literal"><span class="pre">setup.py</span></tt>
+<p>Any path names are interpreted relative to the location of the <tt class="docutils literal">setup.py</tt>
file. For boolean options, use "true" or "false" values.</p>
</div>
</div>
<div class="section" id="init-catalog">
<h1>3 init_catalog</h1>
-<p>The <tt class="docutils literal"><span class="pre">init_catalog</span></tt> command is basically equivalent to the GNU <tt class="docutils literal"><span class="pre">msginit</span></tt>
+<p>The <tt class="docutils literal">init_catalog</tt> command is basically equivalent to the GNU <tt class="docutils literal">msginit</tt>
program: it creates a new translation catalog based on a PO template file (POT).</p>
<p>If the command has been correctly installed or registered, a project's
-<tt class="docutils literal"><span class="pre">setup.py</span></tt> script should allow you to use the command:</p>
+<tt class="docutils literal">setup.py</tt> script should allow you to use the command:</p>
<pre class="literal-block">
$ ./setup.py init_catalog --help
Global options:
@@ -291,7 +317,7 @@
</pre>
<div class="section" id="id2">
<h2>3.1 Options</h2>
-<p>The <tt class="docutils literal"><span class="pre">init_catalog</span></tt> command accepts the following options:</p>
+<p>The <tt class="docutils literal">init_catalog</tt> command accepts the following options:</p>
<blockquote>
<table border="1" class="docutils">
<colgroup>
@@ -329,16 +355,16 @@
<output_dir>/<locale>/LC_MESSAGES/<domain>.po
</pre>
<p>These options can either be specified on the command-line, or in the
-<tt class="docutils literal"><span class="pre">setup.cfg</span></tt> file.</p>
+<tt class="docutils literal">setup.cfg</tt> file.</p>
</div>
</div>
<div class="section" id="update-catalog">
<h1>4 update_catalog</h1>
-<p>The <tt class="docutils literal"><span class="pre">update_catalog</span></tt> command is basically equivalent to the GNU <tt class="docutils literal"><span class="pre">msgmerge</span></tt>
+<p>The <tt class="docutils literal">update_catalog</tt> command is basically equivalent to the GNU <tt class="docutils literal">msgmerge</tt>
program: it updates an existing translations catalog based on a PO template
file (POT).</p>
<p>If the command has been correctly installed or registered, a project's
-<tt class="docutils literal"><span class="pre">setup.py</span></tt> script should allow you to use the command:</p>
+<tt class="docutils literal">setup.py</tt> script should allow you to use the command:</p>
<pre class="literal-block">
$ ./setup.py update_catalog --help
Global options:
@@ -359,7 +385,7 @@
</pre>
<div class="section" id="id3">
<h2>4.1 Options</h2>
-<p>The <tt class="docutils literal"><span class="pre">update_catalog</span></tt> command accepts the following options:</p>
+<p>The <tt class="docutils literal">update_catalog</tt> command accepts the following options:</p>
<blockquote>
<table border="1" class="docutils">
<colgroup>
@@ -407,11 +433,11 @@
<pre class="literal-block">
<output_dir>/<locale>/LC_MESSAGES/<domain>.po
</pre>
-<p>If neither the <tt class="docutils literal"><span class="pre">input_file</span></tt> nor the <tt class="docutils literal"><span class="pre">locale</span></tt> option is set, this command
+<p>If neither the <tt class="docutils literal">input_file</tt> nor the <tt class="docutils literal">locale</tt> option is set, this command
looks for all catalog files in the base directory that match the given domain,
and updates each of them.</p>
<p>These options can either be specified on the command-line, or in the
-<tt class="docutils literal"><span class="pre">setup.cfg</span></tt> file.</p>
+<tt class="docutils literal">setup.cfg</tt> file.</p>
</div>
</div>
<div id="footer">
|
[-]
[+]
|
Changed |
Babel-0.9.6.tar.bz2/doc/setup.txt
^
|
@@ -50,11 +50,11 @@
Options for 'compile_catalog' command:
...
-Running the command will produce a PO template file::
+Running the command will produce a binary MO file::
$ ./setup.py compile_catalog --directory foobar/locale --locale pt_BR
running compile_catalog
- compiling catalog to to foobar/locale/pt_BR/LC_MESSAGES/messages.mo
+ compiling catalog to foobar/locale/pt_BR/LC_MESSAGES/messages.mo
Options
|
[-]
[+]
|
Changed |
Babel-0.9.6.tar.bz2/doc/support.html
^
|
@@ -3,14 +3,14 @@
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<meta name="generator" content="Docutils 0.5: http://docutils.sourceforge.net/">
+<meta name="generator" content="Docutils 0.7: http://docutils.sourceforge.net/">
<title>Babel: Support Classes and Functions</title>
<link rel="stylesheet" href="common/style/edgewall.css" type="text/css">
</head>
<body>
<div class="document" id="support-classes-and-functions">
<div id="navigation">
- <span class="projinfo">Babel 0.9.5</span>
+ <span class="projinfo">Babel 0.9.6</span>
<a href="index.html">Documentation Index</a>
</div>
<h1 class="title">Support Classes and Functions</h1>
@@ -21,7 +21,7 @@
<li><a class="reference internal" href="#extended-translations-class" id="id2">2 Extended Translations Class</a></li>
</ul>
</div>
-<p>The <tt class="docutils literal"><span class="pre">babel.support</span></tt> modules contains a number of classes and functions that
+<p>The <tt class="docutils literal">babel.support</tt> modules contains a number of classes and functions that
can help with integrating Babel, and internationalization in general, into your
application or framework. The code in this module is not used by Babel itself,
but instead is provided to address common requirements of applications that
@@ -31,8 +31,8 @@
<p>One such requirement is lazy evaluation of translations. Many web-based
applications define some localizable message at the module level, or in general
at some level where the locale of the remote user is not yet known. For such
-cases, web frameworks generally provide a "lazy" variant of the <tt class="docutils literal"><span class="pre">gettext</span></tt>
-functions, which basically translates the message not when the <tt class="docutils literal"><span class="pre">gettext</span></tt>
+cases, web frameworks generally provide a "lazy" variant of the <tt class="docutils literal">gettext</tt>
+functions, which basically translates the message not when the <tt class="docutils literal">gettext</tt>
function is invoked, but when the string is accessed in some manner.</p>
</div>
<div class="section" id="extended-translations-class">
@@ -41,13 +41,20 @@
(possibly using some kind of plugin system), and some of those components may
provide their own message catalogs that need to be integrated into the larger
system.</p>
-<p>To support this usage pattern, Babel provides a <tt class="docutils literal"><span class="pre">Translations</span></tt> class that is
-derived from the <tt class="docutils literal"><span class="pre">GNUTranslations</span></tt> class in the <tt class="docutils literal"><span class="pre">gettext</span></tt> module. This
-class adds a <tt class="docutils literal"><span class="pre">merge()</span></tt> method that takes another <tt class="docutils literal"><span class="pre">Translations</span></tt> instance,
+<p>To support this usage pattern, Babel provides a <tt class="docutils literal">Translations</tt> class that is
+derived from the <tt class="docutils literal">GNUTranslations</tt> class in the <tt class="docutils literal">gettext</tt> module. This
+class adds a <tt class="docutils literal">merge()</tt> method that takes another <tt class="docutils literal">Translations</tt> instance,
and merges the content of the latter into the main catalog:</p>
-<div class="highlight"><pre><span class="n">translations</span> <span class="o">=</span> <span class="n">Translations</span><span class="o">.</span><span class="n">load</span><span class="p">(</span><span class="s">'main'</span><span class="p">)</span>
-<span class="n">translations</span><span class="o">.</span><span class="n">merge</span><span class="p">(</span><span class="n">Translations</span><span class="o">.</span><span class="n">load</span><span class="p">(</span><span class="s">'plugin1'</span><span class="p">))</span>
-</pre></div>
+<div class="system-message">
+<p class="system-message-title">System Message: ERROR/3 (<tt class="docutils">doc/support.txt</tt>, line 45)</p>
+<p>Unknown directive type "code-block".</p>
+<pre class="literal-block">
+.. code-block:: python
+
+ translations = Translations.load('main')
+ translations.merge(Translations.load('plugin1'))
+</pre>
+</div>
</div>
<div id="footer">
Visit the Babel open source project at
|
[-]
[+]
|
Changed |
Babel-0.9.6.tar.bz2/scripts/import_cldr.py
^
|
@@ -28,6 +28,7 @@
from babel import dates, numbers
from babel.localedata import Alias
+from babel.util import set
weekdays = {'mon': 0, 'tue': 1, 'wed': 2, 'thu': 3, 'fri': 4, 'sat': 5,
'sun': 6}
@@ -93,7 +94,7 @@
territory_zones = global_data.setdefault('territory_zones', {})
zone_aliases = global_data.setdefault('zone_aliases', {})
zone_territories = global_data.setdefault('zone_territories', {})
- for elem in sup.findall('//timezoneData/zoneFormatting/zoneItem'):
+ for elem in sup.findall('.//timezoneData/zoneFormatting/zoneItem'):
tzid = elem.attrib['type']
territory_zones.setdefault(elem.attrib['territory'], []).append(tzid)
zone_territories[tzid] = elem.attrib['territory']
@@ -104,7 +105,7 @@
# Import Metazone mapping
meta_zones = global_data.setdefault('meta_zones', {})
tzsup = parse(os.path.join(srcdir, 'supplemental', 'metazoneInfo.xml'))
- for elem in tzsup.findall('//timezone'):
+ for elem in tzsup.findall('.//timezone'):
for child in elem.findall('usesMetazone'):
if 'to' not in child.attrib: # FIXME: support old mappings
meta_zones[elem.attrib['type']] = child.attrib['mzone']
@@ -117,7 +118,7 @@
# build a territory containment mapping for inheritance
regions = {}
- for elem in sup.findall('//territoryContainment/group'):
+ for elem in sup.findall('.//territoryContainment/group'):
regions[elem.attrib['type']] = elem.attrib['contains'].split()
# Resolve territory containment
@@ -146,13 +147,13 @@
data = {}
language = None
- elem = tree.find('//identity/language')
+ elem = tree.find('.//identity/language')
if elem is not None:
language = elem.attrib['type']
print>>sys.stderr, ' Language: %r' % language
territory = None
- elem = tree.find('//identity/territory')
+ elem = tree.find('.//identity/territory')
if elem is not None:
territory = elem.attrib['type']
else:
@@ -164,28 +165,28 @@
# <localeDisplayNames>
territories = data.setdefault('territories', {})
- for elem in tree.findall('//territories/territory'):
+ for elem in tree.findall('.//territories/territory'):
if ('draft' in elem.attrib or 'alt' in elem.attrib) \
and elem.attrib['type'] in territories:
continue
territories[elem.attrib['type']] = _text(elem)
languages = data.setdefault('languages', {})
- for elem in tree.findall('//languages/language'):
+ for elem in tree.findall('.//languages/language'):
if ('draft' in elem.attrib or 'alt' in elem.attrib) \
and elem.attrib['type'] in languages:
continue
languages[elem.attrib['type']] = _text(elem)
variants = data.setdefault('variants', {})
- for elem in tree.findall('//variants/variant'):
+ for elem in tree.findall('.//variants/variant'):
if ('draft' in elem.attrib or 'alt' in elem.attrib) \
and elem.attrib['type'] in variants:
continue
variants[elem.attrib['type']] = _text(elem)
scripts = data.setdefault('scripts', {})
- for elem in tree.findall('//scripts/script'):
+ for elem in tree.findall('.//scripts/script'):
if ('draft' in elem.attrib or 'alt' in elem.attrib) \
and elem.attrib['type'] in scripts:
continue
@@ -194,7 +195,7 @@
# <dates>
week_data = data.setdefault('week_data', {})
- supelem = sup.find('//weekData')
+ supelem = sup.find('.//weekData')
for elem in supelem.findall('minDays'):
territories = elem.attrib['territories'].split()
@@ -217,22 +218,22 @@
week_data['weekend_end'] = weekdays[elem.attrib['day']]
zone_formats = data.setdefault('zone_formats', {})
- for elem in tree.findall('//timeZoneNames/gmtFormat'):
+ for elem in tree.findall('.//timeZoneNames/gmtFormat'):
if 'draft' not in elem.attrib and 'alt' not in elem.attrib:
zone_formats['gmt'] = unicode(elem.text).replace('{0}', '%s')
break
- for elem in tree.findall('//timeZoneNames/regionFormat'):
+ for elem in tree.findall('.//timeZoneNames/regionFormat'):
if 'draft' not in elem.attrib and 'alt' not in elem.attrib:
zone_formats['region'] = unicode(elem.text).replace('{0}', '%s')
break
- for elem in tree.findall('//timeZoneNames/fallbackFormat'):
+ for elem in tree.findall('.//timeZoneNames/fallbackFormat'):
if 'draft' not in elem.attrib and 'alt' not in elem.attrib:
zone_formats['fallback'] = unicode(elem.text) \
.replace('{0}', '%(0)s').replace('{1}', '%(1)s')
break
time_zones = data.setdefault('time_zones', {})
- for elem in tree.findall('//timeZoneNames/zone'):
+ for elem in tree.findall('.//timeZoneNames/zone'):
info = {}
city = elem.findtext('exemplarCity')
if city:
@@ -244,7 +245,7 @@
time_zones[elem.attrib['type']] = info
meta_zones = data.setdefault('meta_zones', {})
- for elem in tree.findall('//timeZoneNames/metazone'):
+ for elem in tree.findall('.//timeZoneNames/metazone'):
info = {}
city = elem.findtext('exemplarCity')
if city:
@@ -256,7 +257,7 @@
info['common'] = elem.findtext('commonlyUsed') == 'true'
meta_zones[elem.attrib['type']] = info
- for calendar in tree.findall('//calendars/calendar'):
+ for calendar in tree.findall('.//calendars/calendar'):
if calendar.attrib['type'] != 'gregorian':
# TODO: support other calendar types
continue
@@ -402,11 +403,13 @@
# <numbers>
number_symbols = data.setdefault('number_symbols', {})
- for elem in tree.findall('//numbers/symbols/*'):
+ for elem in tree.findall('.//numbers/symbols/*'):
+ if ('draft' in elem.attrib or 'alt' in elem.attrib):
+ continue
number_symbols[elem.tag] = unicode(elem.text)
decimal_formats = data.setdefault('decimal_formats', {})
- for elem in tree.findall('//decimalFormats/decimalFormatLength'):
+ for elem in tree.findall('.//decimalFormats/decimalFormatLength'):
if ('draft' in elem.attrib or 'alt' in elem.attrib) \
and elem.attrib.get('type') in decimal_formats:
continue
@@ -414,7 +417,7 @@
decimal_formats[elem.attrib.get('type')] = numbers.parse_pattern(pattern)
scientific_formats = data.setdefault('scientific_formats', {})
- for elem in tree.findall('//scientificFormats/scientificFormatLength'):
+ for elem in tree.findall('.//scientificFormats/scientificFormatLength'):
if ('draft' in elem.attrib or 'alt' in elem.attrib) \
and elem.attrib.get('type') in scientific_formats:
continue
@@ -422,7 +425,7 @@
scientific_formats[elem.attrib.get('type')] = numbers.parse_pattern(pattern)
currency_formats = data.setdefault('currency_formats', {})
- for elem in tree.findall('//currencyFormats/currencyFormatLength'):
+ for elem in tree.findall('.//currencyFormats/currencyFormatLength'):
if ('draft' in elem.attrib or 'alt' in elem.attrib) \
and elem.attrib.get('type') in currency_formats:
continue
@@ -430,7 +433,7 @@
currency_formats[elem.attrib.get('type')] = numbers.parse_pattern(pattern)
percent_formats = data.setdefault('percent_formats', {})
- for elem in tree.findall('//percentFormats/percentFormatLength'):
+ for elem in tree.findall('.//percentFormats/percentFormatLength'):
if ('draft' in elem.attrib or 'alt' in elem.attrib) \
and elem.attrib.get('type') in percent_formats:
continue
@@ -439,7 +442,7 @@
currency_names = data.setdefault('currency_names', {})
currency_symbols = data.setdefault('currency_symbols', {})
- for elem in tree.findall('//currencies/currency'):
+ for elem in tree.findall('.//currencies/currency'):
code = elem.attrib['type']
# TODO: support plural rules for currency name selection
for name in elem.findall('displayName'):
|
[-]
[+]
|
Changed |
Babel-0.9.6.tar.bz2/setup.py
^
|
@@ -31,7 +31,7 @@
setup(
name = 'Babel',
- version = '0.9.5',
+ version = '0.9.6',
description = 'Internationalization utilities',
long_description = \
"""A collection of tools for internationalizing Python applications.""",
|