summaryrefslogtreecommitdiff
path: root/babel
diff options
context:
space:
mode:
authorArmin Ronacher <armin.ronacher@active-4.com>2013-07-24 15:09:42 +0200
committerArmin Ronacher <armin.ronacher@active-4.com>2013-07-24 15:09:42 +0200
commit59f02c9ecda9fabe5b96f9ec994d7cc7e45f56ad (patch)
tree565f6ace1a9d801aea47abf6e20f0da500471103 /babel
parent1f67eab0d5fa54d031aecb1ceff894e8e497bec9 (diff)
downloadbabel-59f02c9ecda9fabe5b96f9ec994d7cc7e45f56ad.tar.gz
License clarification and cleanup
Diffstat (limited to 'babel')
-rw-r--r--babel/__init__.py33
-rw-r--r--babel/_compat.py14
-rw-r--r--babel/core.py22
-rw-r--r--babel/dates.py35
-rw-r--r--babel/localedata.py27
-rw-r--r--babel/localtime/__init__.py12
-rw-r--r--babel/messages/__init__.py20
-rw-r--r--babel/messages/catalog.py22
-rw-r--r--babel/messages/checkers.py25
-rw-r--r--babel/messages/extract.py36
-rwxr-xr-xbabel/messages/frontend.py23
-rw-r--r--babel/messages/jslexer.py23
-rw-r--r--babel/messages/mofile.py25
-rw-r--r--babel/messages/plurals.py22
-rw-r--r--babel/messages/pofile.py26
-rw-r--r--babel/numbers.py35
-rw-r--r--babel/plural.py23
-rw-r--r--babel/support.py28
-rw-r--r--babel/util.py23
19 files changed, 190 insertions, 284 deletions
diff --git a/babel/__init__.py b/babel/__init__.py
index ae7d6ca..fa5d59a 100644
--- a/babel/__init__.py
+++ b/babel/__init__.py
@@ -1,29 +1,20 @@
# -*- coding: utf-8 -*-
-#
-# Copyright (C) 2007-2011 Edgewall Software
-# All rights reserved.
-#
-# This software is licensed as described in the file COPYING, which
-# you should have received as part of this distribution. The terms
-# are also available at http://babel.edgewall.org/wiki/License.
-#
-# This software consists of voluntary contributions made by many
-# individuals. For the exact contribution history, see the revision
-# history and logs, available at http://babel.edgewall.org/log/.
+"""
+ babel
+ ~~~~~
-"""Integrated collection of utilities that assist in internationalizing and
-localizing applications.
+ Integrated collection of utilities that assist in internationalizing and
+ localizing applications.
-This package is basically composed of two major parts:
+ This package is basically composed of two major parts:
- * tools to build and work with ``gettext`` message catalogs
- * a Python interface to the CLDR (Common Locale Data Repository), providing
- access to various locale display names, localized number and date
- formatting, etc.
+ * tools to build and work with ``gettext`` message catalogs
+ * a Python interface to the CLDR (Common Locale Data Repository), providing
+ access to various locale display names, localized number and date
+ formatting, etc.
-:see: http://www.gnu.org/software/gettext/
-:see: http://docs.python.org/lib/module-gettext.html
-:see: http://www.unicode.org/cldr/
+ :copyright: (c) 2013 by the Babel Team.
+ :license: BSD, see LICENSE for more details.
"""
from babel.core import UnknownLocaleError, Locale, default_locale, \
diff --git a/babel/_compat.py b/babel/_compat.py
index 1f7f91b..86096da 100644
--- a/babel/_compat.py
+++ b/babel/_compat.py
@@ -1,17 +1,3 @@
-# -*- coding: utf-8 -*-
-#
-# Copyright (C) 2007-2011 Edgewall Software
-# All rights reserved.
-#
-# This software is licensed as described in the file COPYING, which
-# you should have received as part of this distribution. The terms
-# are also available at http://babel.edgewall.org/wiki/License.
-#
-# This software consists of voluntary contributions made by many
-# individuals. For the exact contribution history, see the revision
-# history and logs, available at http://babel.edgewall.org/log/.
-
-
import sys
PY2 = sys.version_info[0] == 2
diff --git a/babel/core.py b/babel/core.py
index 034c35b..d22ccaa 100644
--- a/babel/core.py
+++ b/babel/core.py
@@ -1,17 +1,13 @@
# -*- coding: utf-8 -*-
-#
-# Copyright (C) 2007-2011 Edgewall Software
-# All rights reserved.
-#
-# This software is licensed as described in the file COPYING, which
-# you should have received as part of this distribution. The terms
-# are also available at http://babel.edgewall.org/wiki/License.
-#
-# This software consists of voluntary contributions made by many
-# individuals. For the exact contribution history, see the revision
-# history and logs, available at http://babel.edgewall.org/log/.
-
-"""Core locale representation and locale data access."""
+"""
+ babel.core
+ ~~~~~~~~~~
+
+ Core locale representation and locale data access.
+
+ :copyright: (c) 2013 by the Babel Team.
+ :license: BSD, see LICENSE for more details.
+"""
import os
diff --git a/babel/dates.py b/babel/dates.py
index 996fecd..c15015a 100644
--- a/babel/dates.py
+++ b/babel/dates.py
@@ -1,24 +1,19 @@
# -*- coding: utf-8 -*-
-#
-# Copyright (C) 2007-2011 Edgewall Software
-# All rights reserved.
-#
-# This software is licensed as described in the file COPYING, which
-# you should have received as part of this distribution. The terms
-# are also available at http://babel.edgewall.org/wiki/License.
-#
-# This software consists of voluntary contributions made by many
-# individuals. For the exact contribution history, see the revision
-# history and logs, available at http://babel.edgewall.org/log/.
-
-"""Locale dependent formatting and parsing of dates and times.
-
-The default locale for the functions in this module is determined by the
-following environment variables, in that order:
-
- * ``LC_TIME``,
- * ``LC_ALL``, and
- * ``LANG``
+"""
+ babel.dates
+ ~~~~~~~~~~~
+
+ Locale dependent formatting and parsing of dates and times.
+
+ The default locale for the functions in this module is determined by the
+ following environment variables, in that order:
+
+ * ``LC_TIME``,
+ * ``LC_ALL``, and
+ * ``LANG``
+
+ :copyright: (c) 2013 by the Babel Team.
+ :license: BSD, see LICENSE for more details.
"""
from __future__ import division
diff --git a/babel/localedata.py b/babel/localedata.py
index d6e4703..e05b6a9 100644
--- a/babel/localedata.py
+++ b/babel/localedata.py
@@ -1,20 +1,15 @@
# -*- coding: utf-8 -*-
-#
-# Copyright (C) 2007-2011 Edgewall Software
-# All rights reserved.
-#
-# This software is licensed as described in the file COPYING, which
-# you should have received as part of this distribution. The terms
-# are also available at http://babel.edgewall.org/wiki/License.
-#
-# This software consists of voluntary contributions made by many
-# individuals. For the exact contribution history, see the revision
-# history and logs, available at http://babel.edgewall.org/log/.
-
-"""Low-level locale data access.
-
-:note: The `Locale` class, which uses this module under the hood, provides a
- more convenient interface for accessing the locale data.
+"""
+ babel.localedata
+ ~~~~~~~~~~~~~~~~
+
+ Low-level locale data access.
+
+ :note: The `Locale` class, which uses this module under the hood, provides a
+ more convenient interface for accessing the locale data.
+
+ :copyright: (c) 2013 by the Babel Team.
+ :license: BSD, see LICENSE for more details.
"""
import os
diff --git a/babel/localtime/__init__.py b/babel/localtime/__init__.py
index 842a03e..cdb3e9b 100644
--- a/babel/localtime/__init__.py
+++ b/babel/localtime/__init__.py
@@ -1,3 +1,15 @@
+# -*- coding: utf-8 -*-
+"""
+ babel.localtime
+ ~~~~~~~~~~~~~~~
+
+ Babel specific fork of tzlocal to determine the local timezone
+ of the system.
+
+ :copyright: (c) 2013 by the Babel Team.
+ :license: BSD, see LICENSE for more details.
+"""
+
import sys
import pytz
import time
diff --git a/babel/messages/__init__.py b/babel/messages/__init__.py
index 8110724..1b63bae 100644
--- a/babel/messages/__init__.py
+++ b/babel/messages/__init__.py
@@ -1,16 +1,12 @@
# -*- coding: utf-8 -*-
-#
-# Copyright (C) 2007-2011 Edgewall Software
-# All rights reserved.
-#
-# This software is licensed as described in the file COPYING, which
-# you should have received as part of this distribution. The terms
-# are also available at http://babel.edgewall.org/wiki/License.
-#
-# This software consists of voluntary contributions made by many
-# individuals. For the exact contribution history, see the revision
-# history and logs, available at http://babel.edgewall.org/log/.
+"""
+ babel.messages
+ ~~~~~~~~~~~~~~
-"""Support for ``gettext`` message catalogs."""
+ Support for ``gettext`` message catalogs.
+
+ :copyright: (c) 2013 by the Babel Team.
+ :license: BSD, see LICENSE for more details.
+"""
from babel.messages.catalog import *
diff --git a/babel/messages/catalog.py b/babel/messages/catalog.py
index 4f3afcb..e187acb 100644
--- a/babel/messages/catalog.py
+++ b/babel/messages/catalog.py
@@ -1,17 +1,13 @@
# -*- coding: utf-8 -*-
-#
-# Copyright (C) 2007-2011 Edgewall Software
-# All rights reserved.
-#
-# This software is licensed as described in the file COPYING, which
-# you should have received as part of this distribution. The terms
-# are also available at http://babel.edgewall.org/wiki/License.
-#
-# This software consists of voluntary contributions made by many
-# individuals. For the exact contribution history, see the revision
-# history and logs, available at http://babel.edgewall.org/log/.
-
-"""Data structures for message catalogs."""
+"""
+ babel.messages.catalog
+ ~~~~~~~~~~~~~~~~~~~~~~
+
+ Data structures for message catalogs.
+
+ :copyright: (c) 2013 by the Babel Team.
+ :license: BSD, see LICENSE for more details.
+"""
from cgi import parse_header
from datetime import datetime, time as time_
diff --git a/babel/messages/checkers.py b/babel/messages/checkers.py
index fe8ab3a..de46e99 100644
--- a/babel/messages/checkers.py
+++ b/babel/messages/checkers.py
@@ -1,19 +1,14 @@
# -*- coding: utf-8 -*-
-#
-# Copyright (C) 2007-2011 Edgewall Software
-# All rights reserved.
-#
-# This software is licensed as described in the file COPYING, which
-# you should have received as part of this distribution. The terms
-# are also available at http://babel.edgewall.org/wiki/License.
-#
-# This software consists of voluntary contributions made by many
-# individuals. For the exact contribution history, see the revision
-# history and logs, available at http://babel.edgewall.org/log/.
-
-"""Various routines that help with validation of translations.
-
-:since: version 0.9
+"""
+ babel.messages.checkers
+ ~~~~~~~~~~~~~~~~~~~~~~~
+
+ Various routines that help with validation of translations.
+
+ :since: version 0.9
+
+ :copyright: (c) 2013 by the Babel Team.
+ :license: BSD, see LICENSE for more details.
"""
from babel.messages.catalog import TranslationError, PYTHON_FORMAT
diff --git a/babel/messages/extract.py b/babel/messages/extract.py
index 1e99ce2..201ebd2 100644
--- a/babel/messages/extract.py
+++ b/babel/messages/extract.py
@@ -1,24 +1,20 @@
# -*- coding: utf-8 -*-
-#
-# Copyright (C) 2007-2011 Edgewall Software
-# All rights reserved.
-#
-# This software is licensed as described in the file COPYING, which
-# you should have received as part of this distribution. The terms
-# are also available at http://babel.edgewall.org/wiki/License.
-#
-# This software consists of voluntary contributions made by many
-# individuals. For the exact contribution history, see the revision
-# history and logs, available at http://babel.edgewall.org/log/.
-
-"""Basic infrastructure for extracting localizable messages from source files.
-
-This module defines an extensible system for collecting localizable message
-strings from a variety of sources. A native extractor for Python source files
-is builtin, extractors for other sources can be added using very simple plugins.
-
-The main entry points into the extraction functionality are the functions
-`extract_from_dir` and `extract_from_file`.
+"""
+ babel.messages.extract
+ ~~~~~~~~~~~~~~~~~~~~~~
+
+ Basic infrastructure for extracting localizable messages from source files.
+
+ This module defines an extensible system for collecting localizable message
+ strings from a variety of sources. A native extractor for Python source
+ files is builtin, extractors for other sources can be added using very
+ simple plugins.
+
+ The main entry points into the extraction functionality are the functions
+ `extract_from_dir` and `extract_from_file`.
+
+ :copyright: (c) 2013 by the Babel Team.
+ :license: BSD, see LICENSE for more details.
"""
import os
diff --git a/babel/messages/frontend.py b/babel/messages/frontend.py
index 8bd636b..a15b5aa 100755
--- a/babel/messages/frontend.py
+++ b/babel/messages/frontend.py
@@ -1,18 +1,13 @@
-#!/usr/bin/env python
# -*- coding: utf-8 -*-
-#
-# Copyright (C) 2007-2011 Edgewall Software
-# All rights reserved.
-#
-# This software is licensed as described in the file COPYING, which
-# you should have received as part of this distribution. The terms
-# are also available at http://babel.edgewall.org/wiki/License.
-#
-# This software consists of voluntary contributions made by many
-# individuals. For the exact contribution history, see the revision
-# history and logs, available at http://babel.edgewall.org/log/.
-
-"""Frontends for the message extraction functionality."""
+"""
+ babel.messages.frontend
+ ~~~~~~~~~~~~~~~~~~~~~~~
+
+ Frontends for the message extraction functionality.
+
+ :copyright: (c) 2013 by the Babel Team.
+ :license: BSD, see LICENSE for more details.
+"""
try:
from ConfigParser import RawConfigParser
diff --git a/babel/messages/jslexer.py b/babel/messages/jslexer.py
index 08493d3..d49687b 100644
--- a/babel/messages/jslexer.py
+++ b/babel/messages/jslexer.py
@@ -1,18 +1,13 @@
# -*- coding: utf-8 -*-
-#
-# Copyright (C) 2008-2011 Edgewall Software
-# All rights reserved.
-#
-# This software is licensed as described in the file COPYING, which
-# you should have received as part of this distribution. The terms
-# are also available at http://babel.edgewall.org/wiki/License.
-#
-# This software consists of voluntary contributions made by many
-# individuals. For the exact contribution history, see the revision
-# history and logs, available at http://babel.edgewall.org/log/.
-
-"""A simple JavaScript 1.5 lexer which is used for the JavaScript
-extractor.
+"""
+ babel.messages.jslexer
+ ~~~~~~~~~~~~~~~~~~~~~~
+
+ A simple JavaScript 1.5 lexer which is used for the JavaScript
+ extractor.
+
+ :copyright: (c) 2013 by the Babel Team.
+ :license: BSD, see LICENSE for more details.
"""
from operator import itemgetter
diff --git a/babel/messages/mofile.py b/babel/messages/mofile.py
index f355c73..c92cbad 100644
--- a/babel/messages/mofile.py
+++ b/babel/messages/mofile.py
@@ -1,21 +1,12 @@
# -*- coding: utf-8 -*-
-#
-# Copyright (C) 2007-2011 Edgewall Software
-# All rights reserved.
-#
-# This software is licensed as described in the file COPYING, which
-# you should have received as part of this distribution. The terms
-# are also available at http://babel.edgewall.org/wiki/License.
-#
-# This software consists of voluntary contributions made by many
-# individuals. For the exact contribution history, see the revision
-# history and logs, available at http://babel.edgewall.org/log/.
-
-"""Writing of files in the ``gettext`` MO (machine object) format.
-
-:since: version 0.9
-:see: `The Format of MO Files
- <http://www.gnu.org/software/gettext/manual/gettext.html#MO-Files>`_
+"""
+ babel.messages.mofile
+ ~~~~~~~~~~~~~~~~~~~~~
+
+ Writing of files in the ``gettext`` MO (machine object) format.
+
+ :copyright: (c) 2013 by the Babel Team.
+ :license: BSD, see LICENSE for more details.
"""
import array
diff --git a/babel/messages/plurals.py b/babel/messages/plurals.py
index 172339e..9b4b4ac 100644
--- a/babel/messages/plurals.py
+++ b/babel/messages/plurals.py
@@ -1,17 +1,13 @@
# -*- coding: utf-8 -*-
-#
-# Copyright (C) 2007-2011 Edgewall Software
-# All rights reserved.
-#
-# This software is licensed as described in the file COPYING, which
-# you should have received as part of this distribution. The terms
-# are also available at http://babel.edgewall.org/wiki/License.
-#
-# This software consists of voluntary contributions made by many
-# individuals. For the exact contribution history, see the revision
-# history and logs, available at http://babel.edgewall.org/log/.
-
-"""Plural form definitions."""
+"""
+ babel.messages.plurals
+ ~~~~~~~~~~~~~~~~~~~~~~
+
+ Plural form definitions.
+
+ :copyright: (c) 2013 by the Babel Team.
+ :license: BSD, see LICENSE for more details.
+"""
from babel.core import default_locale, Locale
from operator import itemgetter
diff --git a/babel/messages/pofile.py b/babel/messages/pofile.py
index 5d0d96c..6c9c6f9 100644
--- a/babel/messages/pofile.py
+++ b/babel/messages/pofile.py
@@ -1,21 +1,13 @@
# -*- coding: utf-8 -*-
-#
-# Copyright (C) 2007-2011 Edgewall Software
-# All rights reserved.
-#
-# This software is licensed as described in the file COPYING, which
-# you should have received as part of this distribution. The terms
-# are also available at http://babel.edgewall.org/wiki/License.
-#
-# This software consists of voluntary contributions made by many
-# individuals. For the exact contribution history, see the revision
-# history and logs, available at http://babel.edgewall.org/log/.
-
-"""Reading and writing of files in the ``gettext`` PO (portable object)
-format.
-
-:see: `The Format of PO Files
- <http://www.gnu.org/software/gettext/manual/gettext.html#PO-Files>`_
+"""
+ babel.messages.pofile
+ ~~~~~~~~~~~~~~~~~~~~~
+
+ Reading and writing of files in the ``gettext`` PO (portable object)
+ format.
+
+ :copyright: (c) 2013 by the Babel Team.
+ :license: BSD, see LICENSE for more details.
"""
import os
diff --git a/babel/numbers.py b/babel/numbers.py
index f792e7e..8d15978 100644
--- a/babel/numbers.py
+++ b/babel/numbers.py
@@ -1,24 +1,19 @@
# -*- coding: utf-8 -*-
-#
-# Copyright (C) 2007-2011 Edgewall Software
-# All rights reserved.
-#
-# This software is licensed as described in the file COPYING, which
-# you should have received as part of this distribution. The terms
-# are also available at http://babel.edgewall.org/wiki/License.
-#
-# This software consists of voluntary contributions made by many
-# individuals. For the exact contribution history, see the revision
-# history and logs, available at http://babel.edgewall.org/log/.
-
-"""Locale dependent formatting and parsing of numeric data.
-
-The default locale for the functions in this module is determined by the
-following environment variables, in that order:
-
- * ``LC_NUMERIC``,
- * ``LC_ALL``, and
- * ``LANG``
+"""
+ babel.numbers
+ ~~~~~~~~~~~~~
+
+ Locale dependent formatting and parsing of numeric data.
+
+ The default locale for the functions in this module is determined by the
+ following environment variables, in that order:
+
+ * ``LC_NUMERIC``,
+ * ``LC_ALL``, and
+ * ``LANG``
+
+ :copyright: (c) 2013 by the Babel Team.
+ :license: BSD, see LICENSE for more details.
"""
# TODO:
# Padding and rounding increments in pattern:
diff --git a/babel/plural.py b/babel/plural.py
index afc6d1e..6f16053 100644
--- a/babel/plural.py
+++ b/babel/plural.py
@@ -1,17 +1,13 @@
# -*- coding: utf-8 -*-
-#
-# Copyright (C) 2008-2011 Edgewall Software
-# All rights reserved.
-#
-# This software is licensed as described in the file COPYING, which
-# you should have received as part of this distribution. The terms
-# are also available at http://babel.edgewall.org/wiki/License.
-#
-# This software consists of voluntary contributions made by many
-# individuals. For the exact contribution history, see the revision
-# history and logs, available at http://babel.edgewall.org/log/.
-
-"""CLDR Plural support. See UTS #35. EXPERIMENTAL"""
+"""
+ babel.numbers
+ ~~~~~~~~~~~~~
+
+ CLDR Plural support. See UTS #35.
+
+ :copyright: (c) 2013 by the Babel Team.
+ :license: BSD, see LICENSE for more details.
+"""
import re
@@ -19,7 +15,6 @@ __all__ = ['PluralRule', 'RuleError', 'to_gettext', 'to_javascript',
'to_python']
-
_plural_tags = ('zero', 'one', 'two', 'few', 'many', 'other')
_fallback_tag = 'other'
diff --git a/babel/support.py b/babel/support.py
index 8e4f40f..27f0897 100644
--- a/babel/support.py
+++ b/babel/support.py
@@ -1,20 +1,15 @@
# -*- coding: utf-8 -*-
-#
-# Copyright (C) 2007-2011 Edgewall Software
-# All rights reserved.
-#
-# This software is licensed as described in the file COPYING, which
-# you should have received as part of this distribution. The terms
-# are also available at http://babel.edgewall.org/wiki/License.
-#
-# This software consists of voluntary contributions made by many
-# individuals. For the exact contribution history, see the revision
-# history and logs, available at http://babel.edgewall.org/log/.
-
-"""Several classes and functions that help with integrating and using Babel
-in applications.
-
-.. note: the code in this module is not used by Babel itself
+"""
+ babel.support
+ ~~~~~~~~~~~~~
+
+ Several classes and functions that help with integrating and using Babel
+ in applications.
+
+ .. note: the code in this module is not used by Babel itself
+
+ :copyright: (c) 2013 by the Babel Team.
+ :license: BSD, see LICENSE for more details.
"""
import gettext
@@ -30,7 +25,6 @@ from babel._compat import PY2, text_type, text_to_native
__all__ = ['Format', 'LazyProxy', 'NullTranslations', 'Translations']
-
class Format(object):
"""Wrapper class providing the various date and number formatting functions
bound to a specific locale and time-zone.
diff --git a/babel/util.py b/babel/util.py
index e5e7e7b..230c261 100644
--- a/babel/util.py
+++ b/babel/util.py
@@ -1,17 +1,13 @@
# -*- coding: utf-8 -*-
-#
-# Copyright (C) 2007-2011 Edgewall Software
-# All rights reserved.
-#
-# This software is licensed as described in the file COPYING, which
-# you should have received as part of this distribution. The terms
-# are also available at http://babel.edgewall.org/wiki/License.
-#
-# This software consists of voluntary contributions made by many
-# individuals. For the exact contribution history, see the revision
-# history and logs, available at http://babel.edgewall.org/log/.
-
-"""Various utility classes and functions."""
+"""
+ babel.util
+ ~~~~~~~~~~
+
+ Various utility classes and functions.
+
+ :copyright: (c) 2013 by the Babel Team.
+ :license: BSD, see LICENSE for more details.
+"""
import codecs
from datetime import timedelta, tzinfo
@@ -26,7 +22,6 @@ __all__ = ['distinct', 'pathmatch', 'relpath', 'wraptext', 'odict', 'UTC',
'LOCALTZ']
-
def distinct(iterable):
"""Yield all items in an iterable collection that are distinct.