|
| 1 | +from lib2to3.fixes import fix_imports |
| 2 | + |
| 3 | + |
| 4 | +class FixImportsSix(fix_imports.FixImports): |
| 5 | + |
| 6 | + mapping = { |
| 7 | + '__builtin__': 'six.moves.builtins', |
| 8 | + '_winreg': 'six.moves.winreg', |
| 9 | + 'BaseHTTPServer': 'six.moves.BaseHTTPServer', |
| 10 | + 'CGIHTTPServer': 'six.moves.CGIHTTPServer', |
| 11 | + 'ConfigParser': 'six.moves.configparser', |
| 12 | + 'copy_reg': 'six.moves.copyreg', |
| 13 | + 'Cookie': 'six.moves.http_cookies', |
| 14 | + 'cookielib': 'six.moves.http_cookiejar', |
| 15 | + 'cPickle': 'six.moves.cPickle', |
| 16 | + 'Dialog': 'six.moves.tkinter_dialog', |
| 17 | + 'dummy_thread': 'six.moves._dummy_thread', |
| 18 | + # cStringIO.StringIO() |
| 19 | + # email.MIMEBase |
| 20 | + # email.MIMEMultipart |
| 21 | + # email.MIMENonMultipart |
| 22 | + # email.MIMEText |
| 23 | + 'FileDialog': 'six.moves.tkinter_filedialog', |
| 24 | + 'gdbm': 'six.moves.dbm_gnu', |
| 25 | + 'htmlentitydefs': 'six.moves.html_entities', |
| 26 | + 'HTMLParser': 'six.moves.html_parser', |
| 27 | + 'httplib': 'six.moves.http_client', |
| 28 | + # intern() |
| 29 | + # itertools.ifilter() |
| 30 | + # itertools.ifilterfalse() |
| 31 | + # itertools.imap() |
| 32 | + # itertools.izip() |
| 33 | + # itertools.zip_longest() |
| 34 | + # pipes.quote |
| 35 | + 'Queue': 'six.moves.queue', |
| 36 | + # reduce() |
| 37 | + # reload() |
| 38 | + 'repr': 'six.moves.reprlib', |
| 39 | + 'robotparser': 'six.moves.urllib_robotparser', |
| 40 | + 'ScrolledText': 'six.moves.tkinter_scrolledtext', |
| 41 | + 'SimpleDialog': 'six.moves.tkinter_simpledialog', |
| 42 | + 'SimpleHTTPServer': 'six.moves.SimpleHTTPServer', |
| 43 | + 'SimpleXMLRPCServer': 'six.moves.xmlrpc_server', |
| 44 | + 'SocketServer': 'six.moves.socketserver', |
| 45 | + 'thread': 'six.moves._thread', |
| 46 | + 'Tix': 'six.moves.tkinter_tix', |
| 47 | + 'tkColorChooser': 'six.moves.tkinter_colorchooser', |
| 48 | + 'tkCommonDialog': 'six.moves.tkinter_commondialog', |
| 49 | + 'Tkconstants': 'six.moves.tkinter_constants', |
| 50 | + 'Tkdnd': 'six.moves.tkinter_dnd', |
| 51 | + 'tkFileDialog': 'six.moves.tkinter_filedialog', |
| 52 | + 'tkFont': 'six.moves.tkinter_font', |
| 53 | + 'Tkinter': 'six.moves.tkinter', |
| 54 | + 'tkMessageBox': 'six.moves.tkinter_messagebox', |
| 55 | + 'tkSimpleDialog': 'six.moves.tkinter_tksimpledialog', |
| 56 | + 'ttk': 'six.moves.tkinter_ttk', |
| 57 | + # urllib |
| 58 | + # UserDict.UserDict |
| 59 | + # UserList.UserList |
| 60 | + # UserString.UserString |
| 61 | + 'xmlrpclib': 'six.moves.xmlrpc_client', |
| 62 | + } |
0 commit comments