*{a3 d Z ddlZddlZddlZddlZddlZddlZddlmZ ddl m Z ddlmZ ej e Ze ej eej eej z eej z eej z Zg dZ G d d Zd Zd Zd Z G d d e Z e ZddZ d Z!d Z" G d de Z# G d de Z$e Z%dS )a' past.translation ================== The ``past.translation`` package provides an import hook for Python 3 which transparently runs ``futurize`` fixers over Python 2 code on import to convert print statements into functions, etc. It is intended to assist users in migrating to Python 3.x even if some dependencies still only support Python 2.x. Usage ----- Once your Py2 package is installed in the usual module search path, the import hook is invoked as follows: >>> from past.translation import autotranslate >>> autotranslate('mypackagename') Or: >>> autotranslate(['mypackage1', 'mypackage2']) You can unregister the hook using:: >>> from past.translation import remove_hooks >>> remove_hooks() Author: Ed Schofield. Inspired by and based on ``uprefix`` by Vinay M. Sajip. N) ParseError)RefactoringTool)fixes)#zlib2to3.fixes.fix_applyzlib2to3.fixes.fix_exceptzlib2to3.fixes.fix_execfilezlib2to3.fixes.fix_exitfunczlib2to3.fixes.fix_funcattrszlib2to3.fixes.fix_filterzlib2to3.fixes.fix_has_keyzlib2to3.fixes.fix_idiomszlib2to3.fixes.fix_importzlib2to3.fixes.fix_internzlib2to3.fixes.fix_isinstancezlib2to3.fixes.fix_methodattrszlib2to3.fixes.fix_nezlib2to3.fixes.fix_numliteralszlib2to3.fixes.fix_parenzlib2to3.fixes.fix_printzlib2to3.fixes.fix_raisezlib2to3.fixes.fix_renameszlib2to3.fixes.fix_reducezlib2to3.fixes.fix_reprzlib2to3.fixes.fix_standarderrorzlib2to3.fixes.fix_sys_exczlib2to3.fixes.fix_throwzlib2to3.fixes.fix_tuple_paramszlib2to3.fixes.fix_typeszlib2to3.fixes.fix_ws_commazlib2to3.fixes.fix_xreadlineszlib2to3.fixes.fix_basestringzlib2to3.fixes.fix_execzlib2to3.fixes.fix_getcwduzlib2to3.fixes.fix_longzlib2to3.fixes.fix_nextzlib2to3.fixes.fix_nonzerozlib2to3.fixes.fix_raw_inputzlib2to3.fixes.fix_xrangec N e Zd ZdZdZdZdZdZed Z ed Z dS )RTsa& A namespace for the refactoring tools. This avoids creating these at the module level, which slows down the module import. (See issue #117). There are two possible grammars: with or without the print statement. Hence we have two possible refactoring tool implementations. Nc dt j t j fv rAt t t _ t t ddi t _ dS dS zj Call this before using the refactoring tools to create them on demand if needed. Nprint_functionT)r _rt_rtpr myfixes k/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/past/translation/__init__.pysetupz RTs.setup sJ CGSX&&&%g..CG&w1A40HIICHHH '&r c dt j t j fv rAt t t _ t t ddi t _ dS dS r )r _rt_py2_detect_rtp_py2_detectr py2_detect_fixersr r r setup_detect_python2zRTs.setup_detect_python2 sX C&(;<<