|
| 1 | +#!/usr/bin/perl |
| 2 | +use strict; |
| 3 | +use warnings; |
| 4 | + |
| 5 | +for my $fix (qw/ |
| 6 | +lib2to3.fixes.fix_apply |
| 7 | +lib2to3.fixes.fix_basestring |
| 8 | +lib2to3.fixes.fix_dict |
| 9 | +lib2to3.fixes.fix_except |
| 10 | +lib2to3.fixes.fix_exec |
| 11 | +lib2to3.fixes.fix_exitfunc |
| 12 | +lib2to3.fixes.fix_filter |
| 13 | +lib2to3.fixes.fix_funcattrs |
| 14 | +lib2to3.fixes.fix_getcwdu |
| 15 | +lib2to3.fixes.fix_has_key |
| 16 | +lib2to3.fixes.fix_idioms |
| 17 | +lib2to3.fixes.fix_input |
| 18 | +lib2to3.fixes.fix_intern |
| 19 | +lib2to3.fixes.fix_isinstance |
| 20 | +lib2to3.fixes.fix_itertools |
| 21 | +lib2to3.fixes.fix_itertools_imports |
| 22 | +lib2to3.fixes.fix_long |
| 23 | +lib2to3.fixes.fix_map |
| 24 | +lib2to3.fixes.fix_methodattrs |
| 25 | +lib2to3.fixes.fix_ne |
| 26 | +lib2to3.fixes.fix_nonzero |
| 27 | +lib2to3.fixes.fix_numliterals |
| 28 | +lib2to3.fixes.fix_operator |
| 29 | +lib2to3.fixes.fix_paren |
| 30 | +lib2to3.fixes.fix_raw_input |
| 31 | +lib2to3.fixes.fix_reduce |
| 32 | +lib2to3.fixes.fix_renames |
| 33 | +lib2to3.fixes.fix_repr |
| 34 | +lib2to3.fixes.fix_standarderror |
| 35 | +lib2to3.fixes.fix_sys_exc |
| 36 | +lib2to3.fixes.fix_throw |
| 37 | +lib2to3.fixes.fix_tuple_params |
| 38 | +lib2to3.fixes.fix_types |
| 39 | +lib2to3.fixes.fix_ws_comma |
| 40 | +lib2to3.fixes.fix_xreadlines |
| 41 | +lib2to3.fixes.fix_zip |
| 42 | +
|
| 43 | +libfuturize.fixes.fix_absolute_import |
| 44 | +libfuturize.fixes.fix_cmp |
| 45 | +libfuturize.fixes.fix_execfile |
| 46 | +libfuturize.fixes.fix_future_builtins |
| 47 | +libfuturize.fixes.fix_future_standard_library |
| 48 | +libfuturize.fixes.fix_future_standard_library_urllib |
| 49 | +libfuturize.fixes.fix_metaclass |
| 50 | +libfuturize.fixes.fix_next_call |
| 51 | +libfuturize.fixes.fix_object |
| 52 | +libfuturize.fixes.fix_print_with_import |
| 53 | +libfuturize.fixes.fix_raise |
| 54 | +libfuturize.fixes.fix_xrange_with_import |
| 55 | +
|
| 56 | +libpasteurize.fixes.fix_division |
| 57 | +libpasteurize.fixes.fix_newstyle |
| 58 | +/) { |
| 59 | + my($f) = $fix =~ /\.(fix_.*)$/; |
| 60 | + next if -f "scripts/qgis_fixes/$f.py"; |
| 61 | + |
| 62 | + my $p = $fix; |
| 63 | + $p =~ s#\.#/#g; |
| 64 | + |
| 65 | + open F, "/usr/lib/python2.7/$p.py" or open F, "/usr/lib/python2.7/dist-packages/$p.py" or die "$p not found"; |
| 66 | + my $c; |
| 67 | + while(<F>) { |
| 68 | + last if ($c) = /^class (Fix[^(:]+)[(:]/; |
| 69 | + } |
| 70 | + close F; |
| 71 | + |
| 72 | + print "$p.py => scripts/qgis_fixes/$f.py\n"; |
| 73 | + open F, ">scripts/qgis_fixes/$f.py"; |
| 74 | + print F "from $fix import $c\n"; |
| 75 | + close F; |
| 76 | +} |
0 commit comments