kr.motd.maven.sphinx.dist.libfuturize.fixer_util$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
???? 14 f$0 R(Lorg/python/core/PyFrame;Lorg/python/core/ThreadState;)Lorg/python/core/PyObject; __doc__ ?
Utility functions from 2to3, 3to2 and python-modernize (and some home-grown
ones).
Licences:
2to3: PSF License v2
3to2: Apache Software License (from 3to2/setup.py)
python-modernize licence: BSD (from python-modernize/LICENSE)
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
lib2to3.fixer_util java/lang/String
FromImport Newline is_import find_root ! does_tree_import # Comma % org/python/core/imp '
importFrom \(Ljava/lang/String;[Ljava/lang/String;Lorg/python/core/PyFrame;I)[Lorg/python/core/PyObject; ) *
( + setlocal -
. lib2to3.pytree 0 Leaf 2 Node 4 lib2to3.pygram 6 python_symbols 8 python_grammar : syms < token > Call @ Name B Number D re F importOne H(Ljava/lang/String;Lorg/python/core/PyFrame;I)Lorg/python/core/PyObject; H I
( J org/python/core/Py L EmptyObjects [Lorg/python/core/PyObject; N O M P org/python/core/PyFunction R f_globals Lorg/python/core/PyObject; T U V canonical_fix_name$1l
Examples:
>>> canonical_fix_name('fix_wrap_text_literals')
'libfuturize.fixes.fix_wrap_text_literals'
>>> canonical_fix_name('wrap_text_literals')
'libfuturize.fixes.fix_wrap_text_literals'
>>> canonical_fix_name('wrap_te')
ValueError("unknown fixer name")
>>> canonical_fix_name('wrap')
ValueError("ambiguous fixer name")
Y .fix_ [ getlocal (I)Lorg/python/core/PyObject; ] ^
_ org/python/core/PyObject a _in 6(Lorg/python/core/PyObject;)Lorg/python/core/PyObject; c d
b e __nonzero__ ()Z g h
b i f_lasti I k l m
startswith o __getattr__ .(Ljava/lang/String;)Lorg/python/core/PyObject; q r
b s fix_ u __call__ S(Lorg/python/core/ThreadState;Lorg/python/core/PyObject;)Lorg/python/core/PyObject; w x
b y
newInteger (I)Lorg/python/core/PyInteger; { |
M } __getslice__ j(Lorg/python/core/PyObject;Lorg/python/core/PyObject;Lorg/python/core/PyObject;)Lorg/python/core/PyObject; ?
b ? (ILorg/python/core/PyObject;)V - ?
? org/python/core/PyList ? ()V ? ?
? ? append ? __iter__ ()Lorg/python/core/PyObject; ? ?
b ? endswith ? fix_{0} ? format ? __iternext__ ? ?
b ? dellocal ?
? len ? getglobal ? r
? _gt ? d
b ?
ValueError ? OAmbiguous fixer name. Choose a fully qualified module name instead from these:
?
? join ? f$2 ? _add ? d
b ? java/lang/Object ?
f_savedlocals [Ljava/lang/Object; ? ? ? getGeneratorInput ()Ljava/lang/Object; ? ?
? org/python/core/PyException ? java/lang/Throwable ? None ? U M ? libfuturize/fixer_util$py ? Lorg/python/core/PyCode; ? ? ? ? j(Lorg/python/core/PyObject;[Lorg/python/core/PyObject;Lorg/python/core/PyCode;Lorg/python/core/PyObject;)V ? ?
S ? java/util/Arrays ? fill (([Ljava/lang/Object;Ljava/lang/Object;)V ? ?
? ?
makeException 9(Lorg/python/core/PyObject;)Lorg/python/core/PyException; ? ?
M ? _eq ? d
b ? 1Unknown fixer. Use --list-fixes or -l for a list. ? __getitem__ ? d
b ? X ? ? ? canonical_fix_name ? ? getname ? r
? Star$3 STAR ? * ? org/python/core/PyUnicode ? /(Ljava/lang/String;)Lorg/python/core/PyUnicode; ?
? ? prefix ? g(Lorg/python/core/ThreadState;[Lorg/python/core/PyObject;[Ljava/lang/String;)Lorg/python/core/PyObject; w ?
b ? ? ? ? ? Star ? DoubleStar$4
DOUBLESTAR ? ** ? ? ? ? ?
DoubleStar Minus$5 MINUS - ? ? Minus
commatize$6 |
Accepts/turns: (Name, Name, ..., Name, Name)
Returns/into: (Name, Comma, Name, Comma, ..., Name, Comma, Name)
([Lorg/python/core/PyObject;)V ?
? 9(Lorg/python/core/ThreadState;)Lorg/python/core/PyObject; w
b __delitem__ (Lorg/python/core/PyObject;)V
b ? ? commatize
indentation$7 f
Returns the indentation for this node
Iff a node is in a suite, then it has indentation.
parent _isnot" d
b# type% suite' _ne) d
b* _is, d
b- / INDENT1 value3 prev_sibling5 ? ?7 indentation9 indentation_step$8
Dirty little trick to get the difference between each indentation level
Implemented by finding the shortest indentation string
(technically, the "least" of all of the indentation strings, but
tabs and spaces mixed won't get this far, so those are synonymous.)
< set> f$9@ ? ?A pre_orderC __not__E ?
bF H minJ; ? ?L indentation_stepN
suitify$10 j
Turn the stuff after the first colon in parent's children
into a suite, if it wasn't already
Q childrenS enumerateU unpackSequence 8(Lorg/python/core/PyObject;I)[Lorg/python/core/PyObject;WX
MY COLON[ No class suite and no ':'!] m(Lorg/python/core/ThreadState;Lorg/python/core/PyObject;Lorg/python/core/PyObject;)Lorg/python/core/PyObject; w_
b` removeb __setattr__d
be append_childgP ? ?i suitifyk
NameImport$11 ?
Accepts a package (Name node), name to import it as (string), and
optional prefix and returns a node:
import [as ]
n importp extendr ast v import_namexm ? ?z
NameImport| org/python/core/PyTuple~ if_stmt?
while_stmt? for_stmt? try_stmt? with_stmt?
_compound_stmts? import_from?
_import_stmts? import_binding_scope$12 ?
Generator yields all nodes for which a node (an import_stmt) has scope
The purpose of this is for a call to _find() on each of them
? __debug__? AssertionError? S(Lorg/python/core/PyObject;Lorg/python/core/PyObject;)Lorg/python/core/PyException; ??
M? next_sibling? NEWLINE? SEMI? simple_stmt?? ? ?? import_binding_scope? ImportAsName$13 import_as_name?? ? ?? ImportAsName? is_docstring$14 <
Returns True if the node appears to be a docstring
? STRING?? ? ?? is_docstring? future_import$15
This seems to work
?
__future__? ?(Lorg/python/core/ThreadState;Lorg/python/core/PyObject;Lorg/python/core/PyObject;Lorg/python/core/PyObject;)Lorg/python/core/PyObject; w?
b? is_shebang_comment? is_encoding_comment? check_future_import? NAME? insert_child?? ? ??
future_import? future_import2$16 D
An alternative to future_import() which might not work ...
? _iadd? d
b?? ? ?? future_import2?
parse_args$17 /
Parse a list of arguments into a dict
? COMMA? dict? argument? EQUAL? __setitem__ 7(Lorg/python/core/PyObject;Lorg/python/core/PyObject;)V??
b?? ? ??
parse_args? is_import_stmt$18? ? ?? is_import_stmt? touch_import_top$19?Works like `does_tree_import` but adds an import statement at the
top if it was not imported (but below any __future__ imports) and below any
comments such as shebang lines).
Based on lib2to3.fixer_util.touch_import()
Calling this multiple times adds the imports in reverse order.
Also adds "standard_library.install_aliases()" after "from future import
standard_library". This should probably be factored into another function.
? False? absolute_import? division? print_function? unicode_literals? True? standard_library? power trailer DOT . install_aliases LPAR
( RPAR )? ? ? touch_import_top check_future_import$20 ZIf this is a future import, return set of symbols that are imported,
else return None. hasattr import_as_names add strange import: %s _mod! d
b" ? ?$ ^#!.*python&
SHEBANG_REGEX( ^#.*coding[:=]\s*([-\w.]+)* ENCODING_REGEX, is_shebang_comment$21 ?
Comments are prefixes for Leaf nodes. Returns whether the given node has a
prefix that looks like a shebang line or an encoding line:
#!/usr/bin/env python
#!/usr/bin/python3
/ bool1 match3. ? ?5 is_encoding_comment$22
Comments are prefixes for Leaf nodes. Returns whether the given node has a
prefix that looks like an encoding line:
# coding: utf-8
# encoding: utf-8
# -*- coding: -*-
# vim: set fileencoding= :
87 ? ?: wrap_in_fn_call$23 ?
Example:
>>> wrap_in_fn_call("oldstr", (arg,))
oldstr(arg)
>>> wrap_in_fn_call("olddiv", (arg1, arg2))
olddiv(arg1, arg2)
= NotImplementedError? write meA<