Ignore:
Timestamp:
Mar 19, 2014, 11:31:01 PM (11 years ago)
Author:
dmik
Message:

python: Merge vendor 2.7.6 to trunk.

Location:
python/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • python/trunk

  • python/trunk/Doc/library/locale.rst

    r2 r391  
    2424.. exception:: Error
    2525
    26    Exception raised when :func:`setlocale` fails.
     26   Exception raised when the locale passed to :func:`setlocale` is not
     27   recognized.
    2728
    2829
    2930.. function:: setlocale(category[, locale])
    3031
    31    If *locale* is specified, it may be a string, a tuple of the form ``(language
    32    code, encoding)``, or ``None``. If it is a tuple, it is converted to a string
    33    using the locale aliasing engine.  If *locale* is given and not ``None``,
    34    :func:`setlocale` modifies the locale setting for the *category*.  The available
    35    categories are listed in the data description below.  The value is the name of a
    36    locale.  An empty string specifies the user's default settings. If the
    37    modification of the locale fails, the exception :exc:`Error` is raised.  If
    38    successful, the new locale setting is returned.
     32   If *locale* is given and not ``None``, :func:`setlocale` modifies the locale
     33   setting for the *category*. The available categories are listed in the data
     34   description below. *locale* may be a string, or an iterable of two strings
     35   (language code and encoding). If it's an iterable, it's converted to a locale
     36   name using the locale aliasing engine. An empty string specifies the user's
     37   default settings. If the modification of the locale fails, the exception
     38   :exc:`Error` is raised. If successful, the new locale setting is returned.
    3939
    4040   If *locale* is omitted or ``None``, the current setting for *category* is
    4141   returned.
    4242
    43    :func:`setlocale` is not thread safe on most systems. Applications typically
     43   :func:`setlocale` is not thread-safe on most systems. Applications typically
    4444   start with a call of ::
    4545
     
    5252
    5353   .. versionchanged:: 2.0
    54       Added support for tuple values of the *locale* parameter.
     54      Added support for iterable values of the *locale* parameter.
    5555
    5656
     
    5959   Returns the database of the local conventions as a dictionary. This dictionary
    6060   has the following strings as keys:
     61
     62   .. tabularcolumns:: |l|l|L|
    6163
    6264   +----------------------+-------------------------------------+--------------------------------+
     
    165167   .. data:: D_T_FMT
    166168
    167       Get a string that can be used as a format string for :func:`strftime` to
    168       represent time and date in a locale-specific way.
     169      Get a string that can be used as a format string for :func:`time.strftime` to
     170      represent date and time in a locale-specific way.
    169171
    170172   .. data:: D_FMT
    171173
    172       Get a string that can be used as a format string for :func:`strftime` to
     174      Get a string that can be used as a format string for :func:`time.strftime` to
    173175      represent a date in a locale-specific way.
    174176
    175177   .. data:: T_FMT
    176178
    177       Get a string that can be used as a format string for :func:`strftime` to
     179      Get a string that can be used as a format string for :func:`time.strftime` to
    178180      represent a time in a locale-specific way.
    179181
    180182   .. data:: T_FMT_AMPM
    181183
    182       Get a format string for :func:`strftime` to represent time in the am/pm
     184      Get a format string for :func:`time.strftime` to represent time in the am/pm
    183185      format.
    184186
     
    220222      .. note::
    221223
    222          The expression is in the syntax suitable for the :cfunc:`regex` function
     224         The expression is in the syntax suitable for the :c:func:`regex` function
    223225         from the C library, which might differ from the syntax used in :mod:`re`.
    224226
     
    244246
    245247      Normally it should not be necessary to use this value directly. Specifying
    246       the ``E`` modifier in their format strings causes the :func:`strftime`
     248      the ``E`` modifier in their format strings causes the :func:`time.strftime`
    247249      function to use this information.  The format of the returned string is not
    248250      specified, and therefore you should not assume knowledge of it on different
    249251      systems.
    250252
    251    .. data:: ERA_YEAR
    252 
    253       Get the year in the relevant era of the locale.
    254 
    255253   .. data:: ERA_D_T_FMT
    256254
    257       Get a format string for :func:`strftime` to represent dates and times in a
     255      Get a format string for :func:`time.strftime` to represent date and time in a
    258256      locale-specific era-based way.
    259257
    260258   .. data:: ERA_D_FMT
    261259
    262       Get a format string for :func:`strftime` to represent time in a
     260      Get a format string for :func:`time.strftime` to represent a date in a
     261      locale-specific era-based way.
     262
     263   .. data:: ERA_T_FMT
     264
     265      Get a format string for :func:`time.strftime` to represent a time in a
    263266      locale-specific era-based way.
    264267
     
    559562Python applications should normally find no need to invoke these functions, and
    560563should use :mod:`gettext` instead.  A known exception to this rule are
    561 applications that link use additional C libraries which internally invoke
    562 :cfunc:`gettext` or :func:`dcgettext`.  For these applications, it may be
     564applications that link with additional C libraries which internally invoke
     565:c:func:`gettext` or :func:`dcgettext`.  For these applications, it may be
    563566necessary to bind the text domain, so that the libraries can properly locate
    564567their message catalogs.
Note: See TracChangeset for help on using the changeset viewer.