kr.motd.maven.sphinx.dist.babel.numbers$py.class Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sphinx-maven-plugin Show documentation
Show all versions of sphinx-maven-plugin Show documentation
Maven plugin that creates the site with Sphinx
???? 1? f$0 R(Lorg/python/core/PyFrame;Lorg/python/core/ThreadState;)Lorg/python/core/PyObject; __doc__ ?
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.
org/python/core/PyString fromInterned .(Ljava/lang/String;)Lorg/python/core/PyString;
org/python/core/PyFrame
setglobal /(Ljava/lang/String;Lorg/python/core/PyObject;)V
setline (I)V
re org/python/core/imp importOne H(Ljava/lang/String;Lorg/python/core/PyFrame;I)Lorg/python/core/PyObject;
setlocal
datetime " java/lang/String $ date &
importFrom \(Ljava/lang/String;[Ljava/lang/String;Lorg/python/core/PyFrame;I)[Lorg/python/core/PyObject; ( )
* date_ , datetime_ . itertools 0 chain 2
babel.core 4 default_locale 6 Locale 8
get_global :
babel._compat < decimal > string_types @ babel.localedata B locale_identifiers D getname .(Ljava/lang/String;)Lorg/python/core/PyObject; F G
H
LC_NUMERIC J org/python/core/PyObject L __call__ S(Lorg/python/core/ThreadState;Lorg/python/core/PyObject;)Lorg/python/core/PyObject; N O
M P Exception R UnknownCurrencyError T UnknownCurrencyError$1
__module__ W __name__ Y RException thrown when a currency is requested for which no data is available.
[ org/python/core/Py ] EmptyObjects [Lorg/python/core/PyObject; _ ` ^ a org/python/core/PyFunction c f_globals Lorg/python/core/PyObject; e f g
__init__$2 kCreate the exception.
:param identifier: the identifier string of the unsupported currency
j getglobal l G
m __init__ o __getattr__ q G
M r getlocal (I)Lorg/python/core/PyObject; t u
v Unknown currency %r. x _mod 6(Lorg/python/core/PyObject;)Lorg/python/core/PyObject; z {
M | m(Lorg/python/core/ThreadState;Lorg/python/core/PyObject;Lorg/python/core/PyObject;)Lorg/python/core/PyObject; N ~
M
identifier ? __setattr__ ?
M ? f_lasti I ? ? ? None ? f ^ ? babel/numbers$py ? Lorg/python/core/PyCode; i ? ? ? j(Lorg/python/core/PyObject;[Lorg/python/core/PyObject;Lorg/python/core/PyCode;Lorg/python/core/PyObject;)V ? ?
d ? getf_locals ()Lorg/python/core/PyObject; ? ?
? V ? ? ? makeClass a(Ljava/lang/String;[Lorg/python/core/PyObject;Lorg/python/core/PyCode;)Lorg/python/core/PyObject; ? ?
^ ? java/util/Arrays ? fill (([Ljava/lang/Object;Ljava/lang/Object;)V ? ?
? ? ? list_currencies$3M Return a `set` of normalized currency codes.
.. versionadded:: 2.5.0
:param locale: filters returned currency codes by the provided locale.
Expected to be a locale instance or code. If no locale is
provided, returns the list of all currencies from all
locales.
? __nonzero__ ()Z ? ?
M ? parse ?
currencies ? keys ? 9(Lorg/python/core/ThreadState;)Lorg/python/core/PyObject; N ?
M ? (ILorg/python/core/PyObject;)V ?
? all_currencies ? set ? ? ? ? ? list_currencies ? validate_currency$4 Check the currency code is recognized by Babel.
Accepts a ``locale`` parameter for fined-grained validation, working as
the one defined above in ``list_currencies()`` method.
Raises a `UnknownCurrencyError` exception if the currency is unknown to Babel.
? _notin ? {
M ?
makeException 9(Lorg/python/core/PyObject;)Lorg/python/core/PyException; ? ?
^ ? ? ? ? ? validate_currency ?
is_currency$5 y Returns `True` only if a currency is recognized by Babel.
This method always return a Boolean and never raise.
? __not__ ? ?
M ?
isinstance ? False ? setException M(Ljava/lang/Throwable;Lorg/python/core/PyFrame;)Lorg/python/core/PyException; ? ?
^ ? org/python/core/PyException ? match (Lorg/python/core/PyObject;)Z ? ?
? ? java/lang/Throwable ? True ? ? ? ? ? is_currency ? normalize_currency$6 ?Returns the normalized sting of any currency code.
Accepts a ``locale`` parameter for fined-grained validation, working as
the one defined above in ``list_currencies()`` method.
Returns None if the currency is unknown to Babel.
? upper ? ? ? ? ? normalize_currency ? get_currency_name$7?Return the name used by the locale for the specified currency.
>>> get_currency_name('USD', locale='en_US')
u'US Dollar'
.. versionadded:: 0.9.4
:param currency: the currency code.
:param count: the optional count. If provided the currency name
will be pluralized to that number if possible.
:param locale: the `Locale` object or locale identifier.
? _isnot ? {
M ? plural_form ? _data ? currency_names_plural ? __getitem__ {
M _in {
M get ? ? ? get_currency_name get_currency_symbol$8 ?Return the symbol used by the locale for the specified currency.
>>> get_currency_symbol('USD', locale='en_US')
u'$'
:param currency: the currency code.
:param locale: the `Locale` object or locale identifier.
currency_symbols
? ? get_currency_symbol get_currency_precision$9 ?Return currency's precision.
Precision is the number of decimals found after the decimal point in the
currency's format pattern.
.. versionadded:: 2.5.0
:param currency: the currency code.
currency_fractions DEFAULT
newInteger (I)Lorg/python/core/PyInteger;
^ ? ?! get_currency_precision# get_territory_currencies$10 to_cell (II)V&'
(sReturns the list of currencies for the given territory that are valid for
the given date range. In addition to that the currency database
distinguishes between tender and non-tender currencies. By default only
tender currencies are returned.
The return value is a list of all currencies roughly ordered by the time
of when the currency became active. The longer the currency is being in
use the more to the left of the list it will be.
The start date defaults to today. If no end date is given it will be the
same as the start date. Otherwise a range can be defined. For instance
this can be used to find the currencies in use in Austria between 1995 and
2011:
>>> from datetime import date
>>> get_territory_currencies('AT', date(1995, 1, 1), date(2011, 1, 1))
['ATS', 'EUR']
Likewise it's also possible to find all the currencies in use on a
single date:
>>> get_territory_currencies('AT', date(1995, 1, 1))
['ATS']
>>> get_territory_currencies('AT', date(2011, 1, 1))
['EUR']
By default the return value only includes tender currencies. This
however can be changed:
>>> get_territory_currencies('US')
['USD']
>>> get_territory_currencies('US', tender=False, non_tender=True,
... start_date=date(2014, 1, 1))
['USN', 'USS']
.. versionadded:: 2.0
:param territory: the name of the territory to find the currency for.
:param start_date: the start date. If not given today is assumed.
:param end_date: the end date. If not given the start date is assumed.
:param tender: controls whether tender currencies should be included.
:param non_tender: controls whether non-tender currencies should be
included.
:param include_details: if set to `True`, instead of returning currency
codes the return value will be dictionaries
with detail information. In that case each
dictionary will have the keys ``'currency'``,
``'from'``, ``'to'``, and ``'tender'``.
* territory_currencies, getderef. u
/ _is1 {
M2 today4 setderef6 ?
7 org/python/core/PyTuple9 ([Lorg/python/core/PyObject;)V ?;
:<
_is_active$11 _le? {
M@ _geB {
MC> ? ?E
getclosureG u
H ?(Lorg/python/core/PyObject;[Lorg/python/core/PyObject;Lorg/python/core/PyCode;Lorg/python/core/PyObject;[Lorg/python/core/PyObject;)V ?J
dK org/python/core/PyListM
N< __iter__P ?
MQ unpackSequence 8(Lorg/python/core/PyObject;I)[Lorg/python/core/PyObject;ST
^U
_callextra ~([Lorg/python/core/PyObject;[Ljava/lang/String;Lorg/python/core/PyObject;Lorg/python/core/PyObject;)Lorg/python/core/PyObject;WX
MY append[ org/python/core/PyDictionary] currency_ froma toc tendere
^< __iternext__h ?
Mi% ? ?k get_territory_currenciesm get_decimal_symbol$12 ?Return the symbol used by the locale to separate decimal fractions.
>>> get_decimal_symbol('en_US')
u'.'
:param locale: the `Locale` object or locale identifier
p number_symbolsr .t org/python/core/PyUnicodev /(Ljava/lang/String;)Lorg/python/core/PyUnicode; x
wyo ? ?{ get_decimal_symbol} get_plus_sign_symbol$13 ?Return the plus sign symbol used by the current locale.
>>> get_plus_sign_symbol('en_US')
u'+'
:param locale: the `Locale` object or locale identifier
? plusSign? +? ? ?? get_plus_sign_symbol? get_minus_sign_symbol$14 ?Return the plus sign symbol used by the current locale.
>>> get_minus_sign_symbol('en_US')
u'-'
:param locale: the `Locale` object or locale identifier
? minusSign? -?? ? ?? get_minus_sign_symbol? get_exponential_symbol$15 ?Return the symbol used by the locale to separate mantissa and exponent.
>>> get_exponential_symbol('en_US')
u'E'
:param locale: the `Locale` object or locale identifier
? exponential? E?? ? ?? get_exponential_symbol? get_group_symbol$16 ?Return the symbol used by the locale to separate groups of thousands.
>>> get_group_symbol('en_US')
u','
:param locale: the `Locale` object or locale identifier
? group? ,?? ? ?? get_group_symbol? format_number$17Return the given number formatted for a specific locale.
>>> format_number(1099, locale='en_US')
u'1,099'
>>> format_number(1099, locale='de_DE')
u'1.099'
:param number: the number to format
:param locale: the `Locale` object or locale identifier
? format_decimal? locale? g(Lorg/python/core/ThreadState;[Lorg/python/core/PyObject;[Ljava/lang/String;)Lorg/python/core/PyObject; N?
M?? ? ??
format_number? format_decimal$18?Return the given decimal number formatted for a specific locale.
>>> format_decimal(1.2345, locale='en_US')
u'1.234'
>>> format_decimal(1.2346, locale='en_US')
u'1.235'
>>> format_decimal(-1.2346, locale='en_US')
u'-1.235'
>>> format_decimal(1.2345, locale='sv_SE')
u'1,234'
>>> format_decimal(1.2345, locale='de')
u'1,234'
The appropriate thousands grouping and the decimal separator are used for
each locale:
>>> format_decimal(12345.5, locale='en_US')
u'12,345.5'
:param number: the number to format
:param format:
:param locale: the `Locale` object or locale identifier
? decimal_formats?
parse_pattern? apply?? ? ?? KeyError? UnknownCurrencyFormatError? UnknownCurrencyFormatError$19 >Exception raised when an unknown currency format is requested.?? ? ?? standard? format_currency$20Return formatted currency value.
>>> format_currency(1099.98, 'USD', locale='en_US')
u'$1,099.98'
>>> format_currency(1099.98, 'USD', locale='es_CO')
u'US$\xa01.099,98'
>>> format_currency(1099.98, 'EUR', locale='de_DE')
u'1.099,98\xa0\u20ac'
The format can also be specified explicitly. The currency is
placed with the '¤' sign. As the sign gets repeated the format
expands (¤ being the symbol, ¤¤ is the currency abbreviation and
¤¤¤ is the full name of the currency):
>>> format_currency(1099.98, 'EUR', u'¤¤ #,##0.00', locale='en_US')
u'EUR 1,099.98'
>>> format_currency(1099.98, 'EUR', u'#,##0.00 ¤¤¤', locale='en_US')
u'1,099.98 euros'
Currencies usually have a specific number of decimal digits. This function
favours that information over the given format:
>>> format_currency(1099.98, 'JPY', locale='en_US')
u'\xa51,100'
>>> format_currency(1099.98, 'COP', u'#,##0.00', locale='es_ES')
u'1.100'
However, the number of decimal digits can be overriden from the currency
information, by setting the last parameter to ``False``:
>>> format_currency(1099.98, 'JPY', locale='en_US', currency_digits=False)
u'\xa51,099.98'
>>> format_currency(1099.98, 'COP', u'#,##0.00', locale='es_ES', currency_digits=False)
u'1.099,98'
If a format is not specified the type of currency format to use
from the locale can be specified:
>>> format_currency(1099.98, 'EUR', locale='en_US', format_type='standard')
u'\u20ac1,099.98'
When the given currency format type is not available, an exception is
raised:
>>> format_currency('1099.98', 'EUR', locale='root', format_type='unknown')
Traceback (most recent call last):
...
UnknownCurrencyFormatError: "'unknown' is not a known currency format type"
:param number: the number to format
:param currency: the currency code
:param format: the format string to use
:param locale: the `Locale` object or locale identifier
:param currency_digits: use the currency's number of decimal digits
:param format_type: the currency format type to use
? currency_formats? &%r is not a known currency format type?
force_frac?? ? ?? format_currency? format_percent$21Return formatted percent value for a specific locale.
>>> format_percent(0.34, locale='en_US')
u'34%'
>>> format_percent(25.1234, locale='en_US')
u'2,512%'
>>> format_percent(25.1234, locale='sv_SE')
u'2\xa0512\xa0%'
The format pattern can also be specified explicitly:
>>> format_percent(25.1234, u'#,##0\u2030', locale='en_US')
u'25,123\u2030'
:param number: the percent number to format
:param format:
:param locale: the `Locale` object or locale identifier
? percent_formats?? ? ?? format_percent? format_scientific$22?Return value formatted in scientific notation for a specific locale.
>>> format_scientific(10000, locale='en_US')
u'1E4'
The format pattern can also be specified explicitly:
>>> format_scientific(1234567, u'##0E00', locale='en_US')
u'1.23E06'
:param number: the number to format
:param format:
:param locale: the `Locale` object or locale identifier
? scientific_formats?? ? ?? format_scientific?
ValueError? NumberFormatError? NumberFormatError$23 >Exception raised when a string cannot be parsed into a number.?? ? ?? parse_number$24SParse localized number string into an integer.
>>> parse_number('1,099', locale='en_US')
1099
>>> parse_number('1.099', locale='de_DE')
1099
When the given string cannot be parsed, an exception is raised:
>>> parse_number('1.099,98', locale='de')
Traceback (most recent call last):
...
NumberFormatError: '1.099,98' is not a valid number
:param string: the string to parse
:param locale: the `Locale` object or locale identifier
:return: the parsed number
:raise `NumberFormatError`: if the string can not be converted to a number
? int? replace? ? %r is not a valid number ? ? ? parse_number parse_decimal$25?Parse localized decimal string into a decimal.
>>> parse_decimal('1,099.98', locale='en_US')
Decimal('1099.98')
>>> parse_decimal('1.099,98', locale='de')
Decimal('1099.98')
When the given string cannot be parsed, an exception is raised:
>>> parse_decimal('2,109,998', locale='de')
Traceback (most recent call last):
...
NumberFormatError: '2,109,998' is not a valid decimal number
:param string: the string to parse
:param locale: the `Locale` object or locale identifier
:raise NumberFormatError: if the string can not be converted to a
decimal number
Decimal InvalidOperation %r is not a valid decimal number
? ?
parse_decimal
[^0-9@#.,]
PREFIX_END [0-9@#.,E+] NUMBER_TOKEN (?P(?:'[^']*'|%s)*) PREFIX_PATTERN (?P%s+) NUMBER_PATTERN! (?P.*)# SUFFIX_PATTERN% compile' %s%s%s) number_re+ parse_grouping$26 ?Parse primary and secondary digit grouping
>>> parse_grouping('##')
(1000, 1000)
>>> parse_grouping('#,###')
(3, 3)
>>> parse_grouping('#,####,###')
(3, 4)
. len0 rfind2 _eq4 {
M5 _sub7 {
M8 __neg__: ?
M; __getslice__ j(Lorg/python/core/PyObject;Lorg/python/core/PyObject;Lorg/python/core/PyObject;)Lorg/python/core/PyObject;=>
M?- ? ?A parse_groupingC parse_pattern$27 Parse number format patternsF
NumberPatternH _match_number$28 searchK Invalid number pattern %rM groupsOJ ? ?Q ;S splitU _addW {
MX @Z 0\ 5Significant digit patterns can not contain "@" or "0"^ rsplit` parse_precision$29 (Calculate the min and max allowed digitsc @0e _iaddg {
Mh #jb ? ?l
startswithn lstripp T(Lorg/python/core/ThreadState;[Lorg/python/core/PyObject;)Lorg/python/core/PyObject; Nr
MsE ? ?u objectw NumberPattern$30 __init__$31 pattern{ prefix} suffix grouping? int_prec? frac_prec? exp_prec? exp_plus? %? join? scale? ‰?z ? ?? __repr__$32 <%s %r>? type?? ? ?? __repr__? apply$33 str? scaleb? is_signed? adjusted? abs? _isub? {
M? _div? {
M? _mul? {
M? _lt? {
M? _pow? {
M? %s%s%s%s? _format_significant? ?(Lorg/python/core/ThreadState;Lorg/python/core/PyObject;Lorg/python/core/PyObject;Lorg/python/core/PyObject;)Lorg/python/core/PyObject; N?
M? _format_int? ?(Lorg/python/core/ThreadState;Lorg/python/core/PyObject;Lorg/python/core/PyObject;Lorg/python/core/PyObject;Lorg/python/core/PyObject;)Lorg/python/core/PyObject; N?
M? partition? 1.? 1? quantize? _format_frac? ¤? ¤¤¤? ¤¤?? ? ?? _format_significant$34 max? -{intpart}.{pad:0<{fill}}{fracpart}{fracextra}? format? min? rstrip? intpart? pad? ? fracpart? fracextra?? ? ?? _format_int$35 _gt? {
M?? ? ?? _format_frac$36? ? ??y ? ?? (Ljava/lang/String;)V org/python/core/PyFunctionTable? ()V ??
?? self Lbabel/numbers$py;?? ?? newCode ?(I[Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;IZZLorg/python/core/PyFunctionTable;I[Ljava/lang/String;[Ljava/lang/String;II)Lorg/python/core/PyCode;
^ ? ?? count
loc plural_names
precisions territory
start_date end_date
non_tender include_details curs
_is_active result
currency_code" start$ end& is_tender( number* currency_digits, format_type. precision0 frac2 string4 p6 width8 g1: g2<
_match_number> pos_pattern@ neg_patternB
pos_prefixD
pos_suffixF
neg_prefixH _J
neg_suffixL expN integerP fractionR parse_precisionT rvV cX valueZ is_negative\ exp_sign^ text` ab sepd bf roundedh retvalj minimuml maximumn digitsp ir jt gsizev retx symbolz getMain ()Lorg/python/core/PyCode; main ([Ljava/lang/String;)V ? ??
??|}
?? org/python/core/CodeLoader? createSimpleBootstrap 9(Lorg/python/core/PyCode;)Lorg/python/core/CodeBootstrap;??
?? runMain 5(Lorg/python/core/CodeBootstrap;[Ljava/lang/String;)V??
^? getCodeBootstrap !()Lorg/python/core/CodeBootstrap; #org/python/core/PyRunnableBootstrap? )getFilenameConstructorReflectionBootstrap 2(Ljava/lang/Class;)Lorg/python/core/CodeBootstrap;??
??
call_function S(ILorg/python/core/PyFrame;Lorg/python/core/ThreadState;)Lorg/python/core/PyObject;
?? V
?? i
?? ?
?? ?
?? ?
?? ?
?? ?
??
??
??%
??>
??o
??
???
???
???
???
???
???
???
???
???
???
???
??
??-
??E
??J
??b
??y
??z
???
???
???
???
???
?? org/python/core/PyRunnable? Lorg/python/compiler/APIVersion; % Lorg/python/compiler/MTime; `9Q? Lorg/python/compiler/Filename; W/home/trustin/Workspaces/sphinx-maven-plugin/target/update-sphinx/dist/babel/numbers.py org/python/core/ThreadState? ` [Ljava/lang/String;? Code LineNumberTable StackMap
SourceFile RuntimeVisibleAnnotations ! ?? ? &