ÿØÿàJFIFÿþ ÿÛC       ÿÛC ÿÀÿÄÿÄ"#QrÿÄÿÄ&1!A"2qQaáÿÚ ?Øy,æ/3JæÝ¹È߲؋5êXw²±ÉyˆR”¾I0ó2—PI¾IÌÚiMö¯–þrìN&"KgX:Šíµ•nTJnLK„…@!‰-ý ùúmë;ºgµŒ&ó±hw’¯Õ@”Ü— 9ñ-ë.²1<yà‚¹ïQÐU„ہ?.’¦èûbß±©Ö«Âw*VŒ) `$‰bØÔŸ’ëXÖ-ËTÜíGÚ3ð«g Ÿ§¯—Jx„–’U/ÂÅv_s(Hÿ@TñJÑãõçn­‚!ÈgfbÓc­:él[ðQe 9ÀPLbÃãCµm[5¿ç'ªjglå‡Ûí_§Úõl-;"PkÞÞÁQâ¼_Ñ^¢SŸx?"¸¦ùY騐ÒOÈ q’`~~ÚtËU¹CڒêV  I1Áß_ÿÙ A[c@@sdZddlmZmZmZddlZddlmZddlZddl Z ddl Z ddl Z ddl m Z mZddlmZddlmZmZmZmZdZdd ZdS( u 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.) i(tabsolute_importtprint_functiontunicode_literalsN(t __version__(twarntStdoutRefactoringTool(trefactor(tlib2to3_fix_names_stage1tlib2to3_fix_names_stage2tlibfuturize_fix_names_stage1tlibfuturize_fix_names_stage2ulibfuturize.fixesc C@s% tjdd}|jdddddd|jd d dddd |jd d dddd|jdddddd|jdddddd|jdddddd|jdddddgdd|jdddddd d!d"dd#|jd$d%dddgdd&|jd'd(dddd)|jd*d+dddd,|jd-d.dddd/|jd0dddd1|jd2d3dddd4|jd5d6dddtdd7|jd8d9ddd!d:dd;dd<|jd=d>dddd?|jd@ddd!d:dd;ddAi}t}|j|\}}|jrt|dB<|jstdCnt|_n|j r|j r|j dDn|j r|j r|j dEn|j r|j rtdFn|j r|j r|j dGndH|krNt}|jrNtdIdJtjdKSn|jrdt|dL= 2.7 only.u-Wu--write-unchanged-filesuYAlso write files even if no changes were required (useful with --output-dir); implies -w.u --add-suffixuAppend this string to all output filenames. Requires -n if non-empty. For Python >= 2.7 only.ex: --add-suffix='3' will generate .py3 files.uwrite_unchanged_filesu&--write-unchanged-files/-W implies -w.u%Can't use --output-dir/-o without -n.u"Can't use --add-suffix without -n.u@not writing files and not printing diffs; that's not very usefuluCan't use -n without -wu-uCan't write to stdin.tfileiuprint_functiontformatu%(name)s: %(message)stlevelulibfuturize.mainu-libfuturize.fixes.fix_unicode_literals_importiu2Available transformations for the -f/--fix option:u1At least one file or directory argument required.uUse --help to show usage.u.fix_ufix_{0}uOAmbiguous fixer name. Choose a fully qualified module name instead from these: u cs@s|]}d|VqdS(u N((t.0tmyf((sA/opt/alt/python27/lib/python2.7/site-packages/libfuturize/main.pys su1Unknown fixer. Use --list-fixes or -l for a list.ulibfuturize.fixes.u0fix_add__future__imports_except_unicode_literalsulibpasteurize.fixes.ufix_add_all__future__importsu&fix_add_future_standard_library_importufix_add_all_future_builtinsuallcs@s|]}d|VqdS(u N((RR((sA/opt/alt/python27/lib/python2.7/site-packages/libfuturize/main.pys su[Conflicting usage: the following fixers have been simultaneously requested and disallowed: cs@s|]}d|VqdS(u N((RR((sA/opt/alt/python27/lib/python2.7/site-packages/libfuturize/main.pys su7Output in %r will mirror the input directory %r layout.u append_suffixu output_diruinput_base_diru+Sorry, -j isn't supported on this platform.N(Dtoptparset OptionParsert add_optiontFalset parse_argstwrite_unchanged_filestTruetwriteRt output_dirt nobackupsterrort add_suffixtno_diffstprinttsyststderrRtverbosetloggingtDEBUGtINFOt basicConfigt getLoggertstage1tstage2t both_stagestsettupdateRR RR RtaddtversionRt list_fixestsortedtnofixtendswithRtlentjoint all_importstfixtuniontostpatht commonprefixtseptisdirtdirnametrstriptinfotfuturetutilstPY26Rterrorstrefactor_stdinRtNonet processestMultiprocessingUnsupportedt summarizetinttbool(targstparsertflagsRGtoptionsRtloggert avail_fixestfixnametunwanted_fixesR9tftfoundt extra_fixestprefixtexplicitt all_presentt requestedt fixer_namestinput_base_dirt extra_kwargstrt((sA/opt/alt/python27/lib/python2.7/site-packages/libfuturize/main.pytmainTsZ                            $              $                  (t__doc__t __future__RRRt future.utilsRCRR#R&RR;t lib2to3.mainRRtlib2to3Rtlibfuturize.fixesRRR R t fixer_pkgRHRa(((sA/opt/alt/python27/lib/python2.7/site-packages/libfuturize/main.pyt>s     "