All Downloads are FREE. Search and download functionalities are using the official Maven repository.

kr.motd.maven.sphinx.dist.libfuturize.main$py.class Maven / Gradle / Ivy

There is a newer version: 2.10.0
Show newest version
????1?f$0R(Lorg/python/core/PyFrame;Lorg/python/core/ThreadState;)Lorg/python/core/PyObject;__doc__?
futurize: automatic conversion to clean 2/3 code using ``python-future``
======================================================================

Like Armin Ronacher's modernize.py, ``futurize`` attempts to produce clean
standard Python 3 code that runs on both Py2 and Py3.

One pass
--------

Use it like this on Python 2 code:

  $ futurize --verbose mypython2script.py

This will attempt to port the code to standard Py3 code that also
provides Py2 compatibility with the help of the right imports from
``future``.

To write changes to the files, use the -w flag.

Two stages
----------

The ``futurize`` script can also be called in two separate stages. First:

  $ futurize --stage1 mypython2script.py

This produces more modern Python 2 code that is not yet compatible with Python
3. The tests should still run and the diff should be uncontroversial to apply to
most Python projects that are willing to drop support for Python 2.5 and lower.

After this, the recommended approach is to explicitly mark all strings that must
be byte-strings with a b'' prefix and all text (unicode) strings with a u''
prefix, and then invoke the second stage of Python 2 to 2/3 conversion with::

  $ futurize --stage2 mypython2script.py

Stage 2 adds a dependency on ``future``. It converts most remaining Python
2-specific code to Python 3 code and adds appropriate imports from ``future``
to restore Py2 support.

The command above leaves all unadorned string literals as native strings
(byte-strings on Py2, unicode strings on Py3). If instead you would like all
unadorned string literals to be promoted to unicode, you can also pass this
flag:

  $ futurize --stage2 --unicode-literals mypython2script.py

This adds the declaration ``from __future__ import unicode_literals`` to the
top of each file, which implicitly declares all unadorned string literals to be
unicode strings (``unicode`` on Py2).

All imports
-----------

The --all-imports option forces adding all ``__future__`` imports,
``builtins`` imports, and standard library aliases, even if they don't
seem necessary for the current state of each module. (This can simplify
testing, and can reduce the need to think about Py2 compatibility when editing
the code further.)

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

__future__java/lang/Stringabsolute_importprint_functionunicode_literalsorg/python/core/imp!
importFrom\(Ljava/lang/String;[Ljava/lang/String;Lorg/python/core/PyFrame;I)[Lorg/python/core/PyObject;#$
"%setlocal'
(future.utils*	importOneH(Ljava/lang/String;Lorg/python/core/PyFrame;I)Lorg/python/core/PyObject;,-
".future0__version__2sys4logging6optparse8os:lib2to3.main<main>warn@StdoutRefactoringToolBlib2to3DrefactorFlibfuturize.fixesHlib2to3_fix_names_stage1Jlib2to3_fix_names_stage2Llibfuturize_fix_names_stage1Nlibfuturize_fix_names_stage2Porg/python/core/PyUnicodeR/(Ljava/lang/String;)Lorg/python/core/PyUnicode;	T
SU	fixer_pkgWorg/python/core/PyObjectYNone[getname.(Ljava/lang/String;)Lorg/python/core/PyObject;]^
_org/python/core/PyFunctiona	f_globalsLorg/python/core/PyObject;cd	emain$1?Main program.

    Args:
        fixer_pkg: the name of a package where the fixers are located.
        args: optional; a list of command line arguments. If omitted,
              sys.argv[1:] is used.

    Returns a suggested exit status (0, 1, 2).
    h	getglobalj^
kOptionParserm__getattr__o^
Zpfuturize [options] file|dir ...rusaget__call__g(Lorg/python/core/ThreadState;[Lorg/python/core/PyObject;[Ljava/lang/String;)Lorg/python/core/PyObject;vw
Zx(ILorg/python/core/PyObject;)V'z
{getlocal(I)Lorg/python/core/PyObject;}~

add_option?-V?	--version?
store_true?%Report the version number of futurize?action?help?-a?
--all-imports?4Add all __future__ and future imports to each module?-1?--stage1?ZModernize Python 2 code only; no compatibility with Python 3 (or dependency on ``future``)?-2?--stage2?^Take modernized (stage1) code and add a dependency on ``future`` to provide Py3 compatibility.?-0?
--both-stages?Apply both stages 1 and 2?-u?--unicode-literals?{Add ``from __future__ import unicode_literals`` to implicitly convert all unadorned string literals '' into unicode strings?-f?--fix?append?org/python/core/PyList?org/python/core/Py?EmptyObjectsorg/python/core/PyObject;??	??([Lorg/python/core/PyObject;)V??
???Each FIX specifies a transformation; default: all.
Either use '-f division -f metaclass' etc. or use the fully-qualified module name: '-f lib2to3.fixes.fix_types -f libfuturize.fixes.fix_unicode_keep_u'?default?-j?--processes?store?
newInteger(I)Lorg/python/core/PyInteger;??
??int?Run 2to3 concurrently?type?-x?--nofix?Prevent a fixer from being run.?-l?--list-fixes?List available transformations?-p?--print-function?0Modify the grammar so that print() is a function?-v?	--verbose?More verbose logging?
--no-diffs?#Don't show diffs of the refactoring?-w?--write?Write back modified files?-n?--nobackups?False?'Don't write backups for modified files.?-o?--output-dir?strpPut output files in this directory instead of overwriting the input files.  Requires -n. For Python >= 2.7 only.-W--write-unchanged-files	YAlso write files even if no changes were required (useful with --output-dir); implies -w.--add-suffix
?Append this string to all output filenames. Requires -n if non-empty. For Python >= 2.7 only.ex: --add-suffix='3' will generate .py3 files.org/python/core/PyDictionary
?
parse_argsS(Lorg/python/core/ThreadState;Lorg/python/core/PyObject;)Lorg/python/core/PyObject;v
ZunpackSequence8(Lorg/python/core/PyObject;I)[Lorg/python/core/PyObject;
?write_unchanged_files__nonzero__()Z 
Z!True#__setitem__7(Lorg/python/core/PyObject;Lorg/python/core/PyObject;)V%&
Z'write)__not__()Lorg/python/core/PyObject;+,
Z-&--write-unchanged-files/-W implies -w./__setattr__1
Z2
output_dir4	nobackups6error8%Can't use --output-dir/-o without -n.:
add_suffix<"Can't use --add-suffix without -n.>no_diffs@@not writing files and not printing diffs; that's not very usefulBCan't use -n without -wD-F_in6(Lorg/python/core/PyObject;)Lorg/python/core/PyObject;HI
ZJprintLCan't write to stdin.NstderrPfileRf_lastiITU	VverboseXDEBUGZINFO\basicConfig^%(name)s: %(message)s`formatbleveld	getLoggerflibfuturize.mainhstage1jstage2l	__debug__nboth_stagesp_isrI
Zs[d	?uAssertionErrorw
makeExceptionS(Lorg/python/core/PyObject;Lorg/python/core/PyObject;)Lorg/python/core/PyException;yz
?{set}9(Lorg/python/core/ThreadState;)Lorg/python/core/PyObject;v
Z?update?add?-libfuturize.fixes.fix_unicode_literals_import?version?
list_fixes?2Available transformations for the -f/--fix option:?sorted?__iter__?,
Z?__iternext__?,
Z?1At least one file or directory argument required.?Use --help to show usage.?f$2.fix_?_add?I
Z?java/lang/Object?
f_savedlocals[Ljava/lang/Object;??	?getGeneratorInput()Ljava/lang/Object;??
?org/python/core/PyException?java/lang/Throwable?libfuturize/main$py?Lorg/python/core/PyCode;??	??j(Lorg/python/core/PyObject;[Lorg/python/core/PyObject;Lorg/python/core/PyCode;Lorg/python/core/PyObject;)V??
b?nofix?java/util/Arrays?fill(([Ljava/lang/Object;Ljava/lang/Object;)V??
??all_imports?libfuturize.fixes.?0fix_add__future__imports_except_unicode_literals?libpasteurize.fixes.?fix_add_all__future__imports?&fix_add_future_standard_library_import?fix_add_all_future_builtins?fix?all?_eq?I
Z?()V??
??endswith?fix_{0}?dellocal?
?len?_gt?I
Z?OAmbiguous fixer name. Choose a fully qualified module name instead from these:
?
?join?f$3  ???	??1Unknown fixer. Use --list-fixes or -l for a list.?__getitem__?I
Z?_and?I
Z?[Conflicting usage: the following fixers have been simultaneously requested and disallowed:
?f$4??	??union?_or?I
Z?_sub?I
Zpathcommonprefixsepisdirdirname
rstripinfo7Output in %r will mirror the input directory %r layout.?(Lorg/python/core/ThreadState;Lorg/python/core/PyObject;Lorg/python/core/PyObject;Lorg/python/core/PyObject;)Lorg/python/core/PyObject;v
ZutilsPY26
append_suffixinput_base_dir
_callextra~([Lorg/python/core/PyObject;[Ljava/lang/String;Lorg/python/core/PyObject;Lorg/python/core/PyObject;)Lorg/python/core/PyObject;
Zerrors!refactor_stdin#	processes%?(Lorg/python/core/ThreadState;Lorg/python/core/PyObject;Lorg/python/core/PyObject;Lorg/python/core/PyObject;Lorg/python/core/PyObject;)Lorg/python/core/PyObject;v'
Z(setExceptionM(Ljava/lang/Throwable;Lorg/python/core/PyFrame;)Lorg/python/core/PyException;*+
?,MultiprocessingUnsupported.match(Lorg/python/core/PyObject;)Z01
?2+Sorry, -j isn't supported on this platform.4	summarize6bool8g?	?:(Ljava/lang/String;)Vorg/python/core/PyFunctionTable=
>?selfLlibfuturize/main$py;@A	?BDnewCode?(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;FG
?H?	?JargsLparserNflagsPoptionsRloggerTavail_fixesVfixnameXunwanted_fixesZ	_(208_25)\extra_fixes^prefix`explicitball_presentdfoundf	_[235_29]hfj	_(240_40)l	_(251_28)n	requestedpfixer_namesrextra_kwargstrtv_(x)x	zmyf|getMain()Lorg/python/core/PyCode;([Ljava/lang/String;)V??<
??~
??org/python/core/CodeLoader?createSimpleBootstrap9(Lorg/python/core/PyCode;)Lorg/python/core/CodeBootstrap;??
??runMain5(Lorg/python/core/CodeBootstrap;[Ljava/lang/String;)V??
??getCodeBootstrap!()Lorg/python/core/CodeBootstrap;#org/python/core/PyRunnableBootstrap?)getFilenameConstructorReflectionBootstrap2(Ljava/lang/Class;)Lorg/python/core/CodeBootstrap;??
??
call_functionS(ILorg/python/core/PyFrame;Lorg/python/core/ThreadState;)Lorg/python/core/PyObject;
??g
???
???
???
??org/python/core/PyRunnable? Lorg/python/compiler/APIVersion;value%Lorg/python/compiler/MTime;`9 K?Lorg/python/compiler/Filename;Z/home/trustin/Workspaces/sphinx-maven-plugin/target/update-sphinx/dist/libfuturize/main.pyorg/python/core/ThreadState??[Ljava/lang/String;??CodeLineNumberTableStackMap
SourceFileRuntimeVisibleAnnotations!?>?@A?g???????
??<+??+>??W+@??N-S-S- S-+?&N-2:+?):-2:+?):-2:+ ?):+A?++?/N+1-?)N+B?1?N-3S-+?&N-2:+3?):+D?5+?/N+5-?)N+E?7+?/N+7-?)N+F?9+?/N+9-?)N+G?;+?/N+;-?)N+I?=?N-?S-AS-CS-+?&N-2:+??):-2:+A?):-2:+C?):+J?E?N-GS-+?&N-2:+G?):+L?I?N-KS-MS-OS-QS-+?&N-2:+K?):-2:+M?):-2:+O?):-2:+Q?):+Q?I?VN+X-?)N+T??ZN+\?`-__S?bY+?f-?;i?V??N+?-?)N+?W?v??6
>@ABDEFGIJLQTg??	?+]?i?VW+`?+9?ln?q,?ZNs?V-__S?:uS-?yNN+-?|N+a?+????q,?ZN??V-__S??V-__S??V-__S??V-__S?:?S?S-?yNW+c?+????q,?ZN??V-__S??V-__S??V-__S??V-__S?:?S?S-?yNW+e?+????q,?ZN??V-__S??V-__S??V-__S??V-__S?:?S?S-?yNW+g?+????q,?ZN??V-__S??V-__S??V-__S??V-__S?:?S?S-?yNW+i?+????q,?ZN??V-__S??V-__S??V-__S??V-__S?:?S?S-?yNW+k?+????q,?ZN??V-__S??V-__S??V-__S??V-__S?:?S?S-?yNW+m?+????q,?ZN??V-__S??V-__S??V-__S??Y????-__S??V-__S?:?S?S?S-?yNW+o?+????q,?ZNĸV-__SƸV-__SȸV-__S??-__SθV-__SиV-__S?:?S?S?S?S-?yNW+q?+????q,?ZNԸV-__SָV-__S??V-__S??Y????-__SظV-__S?:?S?S?S-?yNW+s?+????q,?ZNڸV-__SܸV-__S??V-__S޸V-__S?:?S?S-?yNW+u?+????q,?ZN?V-__S?V-__S??V-__S?V-__S?:?S?S-?yNW+w?+????q,?ZN?V-__S?V-__S??V-__S?V-__S?:?S?S-?yNW+y?+????q,?ZN?V-__S??V-__S?V-__S?:?S?S-?yNW+{?+????q,?ZN?V-__S?V-__S??V-__S??V-__S?:?S?S-?yNW+}?+????q,?ZN??V-__S??V-__S??V-__S+??l-__S??V-__S?:?S?S?S-?yNW+?+????q,?ZN??V-__S?V-__SȸV-__S?V-__S?V-__S?V-__S?:?S?S?S?S-?yNW+??+????q,?ZN?V-__S
?V-__S??V-__S?V-__S?:?S?S-?yNW+??+????q,?ZN?V-__SȸV-__S?V-__S?V-__S?V-__S?:?S?S?S?S-?yNW+???Y???N+-?|N+??+??lN+-?|N+??+???q,+???N-?:2:+?|:2:+?|:N+??+???q?"?y+??+$?lN+???V-?(N+??+??*?q?.?"?+??+A?l,0?V?W?+??+$?lN+??*-?3N?+??+??5?qY?"?W+??7?q?.?"?#+??+??9?q,;?V?W?+??+??=?qY?"?W+??7?q?.?"?#+??+??9?q,??V?W?+??+??*?q?.Y?"?W+??A?q?"?+??+A?l,C?V?W?+??+??*?q?.Y?"?W+??7?q?"?#+??+??9?q,E?V?W?+??G?VN+??-_?KN?"??+??+$?lN+-?|N+??+??*?q?"?\+??+M?l,?ZNO?V-__S+5?lQ?q-__S?:SS-?yNW+????N+?W-??+??+???q?"?(+??+$?l:+???V?(:?+??+??+??Y?q?"?+7?l[?q?+7?l]?q:+?|:+??+7?l_?q,?Z:a?V__S+??__S?:cSeS?y:W+??+7?lg?q,i?V?:+?|:+??+??k?qY?"?W+??m?q?"?j+??+o?l?"?4+??q?q:+\?l_?t:?"??v+x?l_?|?+??+??l:+??q?3:?#+??+$?l:+??q?3:+??+~?l,??:+?|:+??+??k?qY?"?W+??q?q?"?B+??+????q,+K?l?W+??+????q,+O?l?W?+??+??m?qY?"?W+??q?q?"?B+??+????q,+M?l?W+??+????q,+Q?l?W?+??+?? ?q?"?$+??+????q,??V?W?+??+????q?"?/+??+M?l,+3?l?W+¶??N+?W-?+ö+????q?"??+Ķ+M?l,??V?W+ƶ+??l,+?????:?$+?|+Ƕ+M?l,+???W+ƶ??:???+ȶ+???.?"?+ɶ??N+?W-??+ʶ+???.?"??+˶+M?l,?Z:??V__S+5?lQ?q__S?:SS?y:W+Ͷ+M?l,?Z:??V__S+5?lQ?q__S?:SS?y:W+ζ??N+?W-?+ж+~?l,+ж?bY+?f??:????:+????q_??,_????:+	?|:+Ҷ+~?l,??:+?|:+Ӷ+????q?"??+Զ+??k?q?"?G+ն??V:+?|:+ֶ+????q,+??øV???W??+ڶŸV:+?|:+۶+????q,+??ǸV???W+ܶ+????q,+??ɸV???W+ݶ+????q,+??˸V???W?+޶+~?l,??:+
?|:+߶+??Ͷq?"?E+?+??l:+?|:+?+??Ͷq??:??+?|+?+??:ϸV_??:?"?!+?+$?l:+?|:??+???V:+??_?K:?"?$+?+
????q,+???W?@+???Y??Y??q:+?|:+?+????:?Y+?|+?+??׶q,ٸVc?q,+?????"?+?+??,+???W?+???:???+?+??:+?|:+??+޶l,+???:??_??:?"??+?+M?l,?Z:?V?V?q,+??bY+?f??:????:+??_??,_??????__S+5?lQ?q__S?:SS?y:W+???N+?W-?+?+޶l,+???:??_??:?"?a+??+M?l,?Z:?V__S+5?lQ?q__S?:SS?y:W+????N+?W-?+??+
????q,+???̶?W+???:??$+??+޶l,+
??+	?????:??_??:?"??+??+M?l,?Z:??V?V?q,+???bY+?f??:????:+
??+	????_??,_??????__S+5?lQ?q__S?:SS?y:W+????N+?W-?+??+??+???"?+????q,+
????	+
??:+?|:?-+?+????q,+
???:+?|:+?+??+????+	???:+?|:+?+;?l?q?q,+???:+?|:+?+??Y?"?JW+??׶q,+;?l?q??.Y?"?#W+;?l?q	?q,+????.?"?6+	?+;?l?q?q,+???:+?|:?+
?+??5?q?"?e+?+??
?q,+;?l?q?:+?|:+?+???q,?V+??5?q+???W?+?+1?l?q?q?"?$+??Y???:+?|:?c+??Y?ZY?VSY+??=?qSY5?VSY+??5?qSY?VSY+??S?:+?|:+?+C?l?Z:+??l,+???__S+??__S+??l,+
???__S+??7?q__S+??A?q?.__S?:+??^X? ::+?|:+?+??"?q?.?"?G+ ?+???"?+!?+??$?q,??W??+$?+??G?q,+??+??*?q+\?l+??&?q?)W??+?-:+G?l/?q?3??+'?+o?l?"?2+??&?q:??_??:?"??v+x?l_?|?+(?+M?l,?Z:5?V__S+5?lQ?q__S?:SS?y:W+*???N+?W-???++?+??7?q,??W?+.?+ζl,+9?l,+??"?q??N+?W-???????]`acegikmoqsuwy{}????????????????????????????????????????????????????????????????????????????????????????????????	
 !$'(*+.??:???$???L???Zr???????Z????????Z		???	1???Z	W???	????
???
>???
l???
x???Z#???Zn???????????????Z9???^???Z????????
???
p??ZZ
???Z?
???ZZ
???Z????Z?z??b	??b??bw??ZZ???ZZ??ZZ<??ZZZZ????ZZZ????ZZZ??ZZZC??ZZ<??Zo??Zu??ZZ???b???Ze??ZZ???Z??ZX??Z???Z?????????0?????????????????????[???+ж+????N?v+?|+ж+ж+X?l??V??+????+?W??:-SS+???+??:2?ZN2?Z:+??Y???????ZW+ж-??:??~+?W?v?+?W????[???[??????????q????ZZ_?????ZZ?????Z?????O???+?+????N?m+?|+?+??V+????+?W??:-SS+???+??:2?ZN2?Z:+??Y???????ZW+?-??:???+?W?v?+?W????d???d??????????q????ZZV??|??ZZ?????Z?????O???+??+????N?m+?|+??+???V+????+?W??:-SS+???+??:2?ZN2?Z:+??Y???????ZW+??-??:???+?W?v?+?W????d???d??????????q????ZZV??|??ZZ?????Z????<??
z*??*?C?M,+E?C?I?K?M,MS,OS,QS,$S,SS,eS,US,WS,YS,	[S,
]S,_S,aS,
cS,eS,?S,gS,iS,kS,mS,oS,qS,sS,S,uS,wS,+?T?C?I?;?M,yS,?S,+{??C!?I???M,yS,}S,+{??C!?I???M,yS,}S,+{??C!?I???~??K?	>??!??Y???????*???	???????????>*,-?8$(,04??????????????????(????,????0????4????8????<?????????I???J???s?




© 2015 - 2024 Weber Informatics LLC | Privacy Policy