kr.motd.maven.sphinx.dist.babel.messages.extract$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__ a
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.
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
os org/python/core/imp importOne H(Ljava/lang/String;Lorg/python/core/PyFrame;I)Lorg/python/core/PyObject;
setlocal
os.path " java/lang/String $ relpath &
importFrom \(Ljava/lang/String;[Ljava/lang/String;Lorg/python/core/PyFrame;I)[Lorg/python/core/PyObject; ( )
* sys , tokenize . generate_tokens 0 COMMENT 2 NAME 4 OP 6 STRING 8
babel.util : parse_encoding < parse_future_flags > pathmatch @
babel._compat B PY2 D text_type F textwrap H dedent J babel.extractors L
GROUP_NAME N org/python/core/PyDictionary P org/python/core/PyObject R _ T None V getname .(Ljava/lang/String;)Lorg/python/core/PyObject; X Y
Z gettext \ ngettext ^ org/python/core/PyTuple ` org/python/core/Py b
newInteger (I)Lorg/python/core/PyInteger; d e
c f ([Lorg/python/core/PyObject;)V h i
a j ugettext l ungettext n dgettext p dngettext r N_ t pgettext v c x npgettext z
Q j DEFAULT_KEYWORDS } org/python/core/PyList **.py ? python ?
? j DEFAULT_MAPPING ? ?%s: warning: Empty msgid. It is reserved by GNU gettext: gettext("") returns the header entry with meta information, not the empty string. ? empty_msgid_warning ? EmptyObjects [Lorg/python/core/PyObject; ? ? c ? org/python/core/PyFunction ? f_globals Lorg/python/core/PyObject; ? ? ? _strip_comment_tags$1 to_cell (II)V ? ?
? ?Helper function for `extract` that strips comment tags from strings
in a list of comment lines. This functions operates in-place.
? _strip$2 getderef (I)Lorg/python/core/PyObject; ? ?
? __iter__ ()Lorg/python/core/PyObject; ? ?
S ? (ILorg/python/core/PyObject;)V ?
? getlocal ? ?
?
startswith ? __getattr__ ? Y
S ? __call__ S(Lorg/python/core/ThreadState;Lorg/python/core/PyObject;)Lorg/python/core/PyObject; ? ?
S ? __nonzero__ ()Z ? ?
S ? len ? getglobal ? Y
? __getslice__ j(Lorg/python/core/PyObject;Lorg/python/core/PyObject;Lorg/python/core/PyObject;)Lorg/python/core/PyObject; ? ?
S ? strip ? 9(Lorg/python/core/ThreadState;)Lorg/python/core/PyObject; ? ?
S ? f_lasti I ? ? ? __iternext__ ? ?
S ? babel/messages/extract$py ? Lorg/python/core/PyCode; ? ? ? ?
getclosure ? ?
? ?(Lorg/python/core/PyObject;[Lorg/python/core/PyObject;Lorg/python/core/PyCode;Lorg/python/core/PyObject;[Lorg/python/core/PyObject;)V h ?
? ? map ? m(Lorg/python/core/ThreadState;Lorg/python/core/PyObject;Lorg/python/core/PyObject;)Lorg/python/core/PyObject; ? ?
S ? __setslice__ k(Lorg/python/core/PyObject;Lorg/python/core/PyObject;Lorg/python/core/PyObject;Lorg/python/core/PyObject;)V ? ?
S ? V ? c ? ? ? ? ? j(Lorg/python/core/PyObject;[Lorg/python/core/PyObject;Lorg/python/core/PyCode;Lorg/python/core/PyObject;)V h ?
? ? _strip_comment_tags ? False ? extract_from_dir$38Extract messages from any source files found in the given directory.
This function generates tuples of the form ``(filename, lineno, message,
comments, context)``.
Which extraction method is used per file is determined by the `method_map`
parameter, which maps extended glob patterns to extraction method names.
For example, the following is the default mapping:
>>> method_map = [
... ('**.py', 'python')
... ]
This basically says that files with the filename extension ".py" at any
level inside the directory should be processed by the "python" extraction
method. Files that don't match any of the mapping patterns are ignored. See
the documentation of the `pathmatch` function for details on the pattern
syntax.
The following extended mapping would also use the "genshi" extraction
method on any file in "templates" subdirectory:
>>> method_map = [
... ('**/templates/**.*', 'genshi'),
... ('**.py', 'python')
... ]
The dictionary provided by the optional `options_map` parameter augments
these mappings. It uses extended glob patterns as keys, and the values are
dictionaries mapping options names to option values (both strings).
The glob patterns of the `options_map` do not necessarily need to be the
same as those used in the method mapping. For example, while all files in
the ``templates`` folders in an application may be Genshi applications, the
options for those files may differ based on extension:
>>> options_map = {
... '**/templates/**.txt': {
... 'template_class': 'genshi.template:TextTemplate',
... 'encoding': 'latin-1'
... },
... '**/templates/**.html': {
... 'include_attrs': ''
... }
... }
:param dirname: the path to the directory to extract messages from. If
not given the current working directory is used.
:param method_map: a list of ``(pattern, method)`` tuples that maps of
extraction method names to extended glob patterns
:param options_map: a dictionary of additional options (optional)
:param keywords: a dictionary mapping keywords (i.e. names of functions
that should be recognized as translation functions) to
tuples that specify which of their arguments contain
localizable strings
:param comment_tags: a list of tags of translator comments to search for
and include in the results
:param callback: a function that is called for every file that message are
extracted from, just before the extraction itself is
performed; the function is passed the filename, the name
of the extraction method and and the options dictionary as
positional arguments, in that order
:param strip_comment_tags: a flag that if set to `True` causes all comment
tags to be removed from the collected comments.
:see: `pathmatch`
? _is 6(Lorg/python/core/PyObject;)Lorg/python/core/PyObject; ? ?
S ? getcwd ? java/util/Arrays ? fill (([Ljava/lang/Object;Ljava/lang/Object;)V ? ?
? ? path ? abspath ? walk unpackSequence 8(Lorg/python/core/PyObject;I)[Lorg/python/core/PyObject;
c ()V h
? append . __not__
?
S dellocal
sort join replace sep / check_and_call_extract_file dirpath g(Lorg/python/core/ThreadState;[Lorg/python/core/PyObject;[Ljava/lang/String;)Lorg/python/core/PyObject; ?!
S" java/lang/Object$
f_savedlocals [Ljava/lang/Object;&' ( getGeneratorInput ()Ljava/lang/Object;*+
, org/python/core/PyException. java/lang/Throwable0 ? ? ?2 extract_from_dir4 check_and_call_extract_file$4Checks if the given file matches an extraction method mapping, and if so, calls extract_from_file.
Note that the extraction method mappings are based relative to dirpath.
So, given an absolute path to a file `filepath`, we want to check using
just the relative path from `dirpath` to `filepath`.
Yields 5-tuples (filename, lineno, messages, comments, context).
:param filepath: An absolute path to a file that exists.
:param method_map: a list of ``(pattern, method)`` tuples that maps of
extraction method names to extended glob patterns
:param options_map: a dictionary of additional options (optional)
:param callback: a function that is called for every file that message are
extracted from, just before the extraction itself is
performed; the function is passed the filename, the name
of the extraction method and and the options dictionary as
positional arguments, in that order
:param keywords: a dictionary mapping keywords (i.e. names of functions
that should be recognized as translation functions) to
tuples that specify which of their arguments contain
localizable strings
:param comment_tags: a list of tags of translator comments to search for
and include in the results
:param strip_comment_tags: a flag that if set to `True` causes all comment
tags to be removed from the collected comments.
:param dirpath: the path to the directory to extract messages from.
:return: iterable of 5-tuples (filename, lineno, messages, comments, context)
:rtype: Iterable[tuple[str, int, str|tuple[str], list[str], str|None]
7 items9 ?(Lorg/python/core/ThreadState;Lorg/python/core/PyObject;Lorg/python/core/PyObject;Lorg/python/core/PyObject;)Lorg/python/core/PyObject; ?;
S< extract_from_file> keywords@ comment_tagsB optionsD strip_comment_tagsF _addH ?
SI6 ? ?K extract_from_file$5 f_exitsN ? OExtract messages from a specific file.
This function returns a list of tuples of the form ``(lineno, message, comments, context)``.
:param filename: the path to the file to extract messages from
:param method: a string specifying the extraction method (.e.g. "python")
:param keywords: a dictionary mapping keywords (i.e. names of functions
that should be recognized as translation functions) to
tuples that specify which of their arguments contain
localizable strings
:param comment_tags: a list of translator tags to search for and include
in the results
:param strip_comment_tags: a flag that if set to `True` causes all comment
tags to be removed from the collected comments.
:param options: a dictionary of additional options (optional)
:returns: list of tuples of the form ``(lineno, message, comments, context)``
:rtype: list[tuple[int, str|tuple[str], list[str], str|None]
Q openS rbU org/python/core/ContextGuardW
getManager <(Lorg/python/core/PyObject;)Lorg/python/core/ContextManager;YZ
X[ org/python/core/ContextManager] __enter___ ?^` listb extractd T(Lorg/python/core/ThreadState;[Lorg/python/core/PyObject;)Lorg/python/core/PyObject; ?f
Sg __exit__ =(Lorg/python/core/ThreadState;Lorg/python/core/PyException;)Zij^k setException M(Ljava/lang/Throwable;Lorg/python/core/PyFrame;)Lorg/python/core/PyException;mn
co
makeException ()Lorg/python/core/PyException;qr
csM ? ?u extract$6?Extract messages from the given file-like object using the specified
extraction method.
This function returns tuples of the form ``(lineno, message, comments, context)``.
The implementation dispatches the actual extraction to plugins, based on the
value of the ``method`` parameter.
>>> source = b'''# foo module
... def run(argv):
... print(_('Hello, world!'))
... '''
>>> from babel._compat import BytesIO
>>> for message in extract('python', BytesIO(source)):
... print(message)
(3, u'Hello, world!', [], None)
:param method: an extraction method (a callable), or
a string specifying the extraction method (.e.g. "python");
if this is a simple name, the extraction function will be
looked up by entry point; if it is an explicit reference
to a function (of the form ``package.module:funcname`` or
``package.module.funcname``), the corresponding function
will be imported and used
:param fileobj: the file-like object the messages should be extracted from
:param keywords: a dictionary mapping keywords (i.e. names of functions
that should be recognized as translation functions) to
tuples that specify which of their arguments contain
localizable strings
:param comment_tags: a list of translator tags to search for and include
in the results
:param options: a dictionary of additional options (optional)
:param strip_comment_tags: a flag that if set to `True` causes all comment
tags to be removed from the collected comments.
:raise ValueError: if the extraction method is not registered
:returns: iterable of tuples of the form ``(lineno, message, comments, context)``
:rtype: Iterable[tuple[int, str|tuple[str], list[str], str|None]
x callablez :| _in~ ?
S _notin? ?
S? rfind? split? getattr?
__import__? ?(Lorg/python/core/ThreadState;Lorg/python/core/PyObject;Lorg/python/core/PyObject;Lorg/python/core/PyObject;Lorg/python/core/PyObject;)Lorg/python/core/PyObject; ??
S?
pkg_resources? working_set? ImportError? match (Lorg/python/core/PyObject;)Z??
/? iter_entry_points? load? True? require? ignore? extract_nothing? extract_python?
javascript? extract_javascript? get?
ValueError? Unknown extraction method %r? _mod? ?
S? 9(Lorg/python/core/PyObject;)Lorg/python/core/PyException;q?
c? keys? __getitem__? ?
S?
isinstance? tuple? _sub? ?
S? _lt? ?
S? %s:%i? hasattr? name? (unknown)? stderr? write?
? _eq? ?
S?w ? ?? extract_nothing$7 dPseudo extractor that does not actually extract anything, but simply
returns an empty list.
?? ? ?? extract_python$8cExtract messages from Python source code.
It returns an iterator yielding tuples in the following form ``(lineno,
funcname, message, comments)``.
:param fileobj: the seekable, 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)
:rtype: ``iterator``
? encoding? UTF-8? setderef? ?
? readline? f$9 decode?? ? ?? k(Lorg/python/core/PyObject;[Lorg/python/core/PyObject;Lorg/python/core/PyCode;[Lorg/python/core/PyObject;)V h?
?? def? class? (? _iadd? ?
S? )? ? __delslice__ Q(Lorg/python/core/PyObject;Lorg/python/core/PyObject;Lorg/python/core/PyObject;)V?
S _gt ?
S compile # coding=%s
%s str
eval __builtins__ , pop _isub ?
S? ? ? extract_javascript$10?Extract messages from JavaScript source code.
:param fileobj: the seekable, 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)
Supported options are:
* `jsx` -- set to false to disable JSX/E4X support.
* `template_string` -- set to false to disable ES6
template string support.
babel.messages.jslexer Token unquote_string" utf-8$ any& f$11( ? ?) read+ jsx- template_string/ dotted1 type3 lineno5 value7 operator9 linecomment; multilinecomment=
splitlines? __setitem__ 7(Lorg/python/core/PyObject;Lorg/python/core/PyObject;)VAB
SC enumerateE _isnotG ?
SH stringJ +L _neN ?
SO functionQ ? ?S (Ljava/lang/String;)V org/python/core/PyFunctionTableV
W self Lbabel/messages/extract$py;YZ ?[ ] 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;_`
ca ? ?c commentse tagsg _stripi linek tagm dirnameo
method_mapq options_maps callbacku absnamew rooty dirnames{ filenames} _[141_12] subdir? filename? filepath?
message_tuple? pattern? method? opattern? odict? fileobj? func? lastdot? module? attrname? entry_point? builtin? results? funcname? messages? spec? context? msgs? invalid?
last_index? index? message? first_msg_index? where? message_lineno?
call_stack? buf? translator_comments? in_def? in_translator_comments? comment_tag? future_flags? next_line? tokens? tok? nested? _[468_24]? comment? code?
old_lineno? old_comment? ?
last_argument? concatenate_next?
last_token? _(533_17)? token? lines? offset? _[602_28]? new_value? _(x)? kw? ? getMain ()Lorg/python/core/PyCode; main ([Ljava/lang/String;)V ? hU
????
?? org/python/core/CodeLoader? createSimpleBootstrap 9(Lorg/python/core/PyCode;)Lorg/python/core/CodeBootstrap;??
? runMain 5(Lorg/python/core/CodeBootstrap;[Ljava/lang/String;)V
c 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;
? ?
? ?
? ?
?6
?M
?w
??
??
? ?
?"
?$(
?& org/python/core/PyRunnable( Lorg/python/compiler/APIVersion; % Lorg/python/compiler/MTime; `9Q? Lorg/python/compiler/Filename; `/home/trustin/Workspaces/sphinx-maven-plugin/target/update-sphinx/dist/babel/messages/extract.py org/python/core/ThreadState1' ? Code LineNumberTable StackMap
SourceFile RuntimeVisibleAnnotations ! ?W )
YZ ? ? ? ? ? ? ? 6 ? M ? w ? ? ? ? ? ? ? ? ( ? 5 ? ?+? ? +? ? W+? +? N+-? !N+? #? %N-'S-+? +N-2:+'? !:+? -+? N+--? !N+? /? %N-1S-3S-5S-7S-9S-+? +N-2:+1? !:-2:+3? !:-2:+5? !:-2:+7? !:-2:+9? !:+? ;? %N-=S-?S-AS-+? +N-2:+=? !:-2:+?? !:-2:+A? !:+? C? %N-ES-GS-+? +N-2:+E? !:-2:+G? !:+? I? %N-KS-+? +N-2:+K? !:+? M? N+O-? !N+ ? ? QY? SYU? SY+W? [SY]? SY+W? [SY_? SY? aY? SY? gSY? gS? kSYm? SY+W? [SYo? SY ? aY? SY? gSY? gS? kSY
q? SY? aY? SY? gS? kSYs? SY
? aY? SY? gSY? gS? kSYu? SY+W? [SYw? SY? aY? SY? aY? SY? gSYy? S? kSY? gS? kSY{? SY? aY? SY? aY? SY? gSYy? S? kSY? gSY? gS? kS? |N+~-? !N+-? ? ?Y? SY? aY? SY?? SY?? S? kS? ?N+?-? !N+/? ?? N+?-? !N+4? ? ?N? ?Y+? ?-? ??? ? ?N+?-? !N+@? ? SN+W? [-__S+?? [-__S+W? [-__S+~? [-__S? aY? ?? k-__S+W? [-__S+? [-__S? ?Y+? ?-?3? ? ?N+5-? !N+ ?? ? SN+W? [-__S? ?Y+? ?-?L8? ? ?N+-? !N+ ۶ ? SN+~? [-__S? aY? ?? k-__S+W? [-__S+? [-__S? ?Y+? ?-?vR? ? ?N+?-? !N+ ?? ? SN+~? [-__S? aY? ?? k-__S+W? [-__S+? [-__S? ?Y+? ?-??y? ? ?N+e-? !N+x? ? ?N? ?Y+? ?-??۸ ? ?N+?-? !N+? ? ?N? ?Y+? ?-?? ? ?N+?-? !N+?? ? ?N? ?Y+? ?-?T? ? ?N+?-? !N+? ʲ ? 6 R - / 4 @ ? ? ? x ? ? 5 ?
u+? ?+7? ?? W+8? ? ?N? ?Y+? ?-? ?? SN-+? ?S-? ?N+-? ?N+=? +ڶ ?,+? ?+? ?? ?N+? ?-? ?N+? ʲ ? 6 7 8 = ? 5 ? ?+9? +? ?? ?N? [+? ?+:? +? ??? ?,+? ?? ?? ?? 5+;? +? ?+?? ?,+? ?? ?? ?ö ?,? ?:+? ??+9? -? ?:???+