Ñò §ÚêLc @€ s© d Z d d k l Z d d k Z d d k Z d d k Z d d k Z d d k Z d d k Z d d k l Z d „ Z d e i f d „ ƒ YZ d „ Z d d „ Z d S( s Main program for 2to3. iÿÿÿÿ( t with_statementNi ( t refactorc C€ s: | i ƒ } | i ƒ } t i | | | | d d d d ƒS( s% Return a unified diff of two strings.s (original)s (refactored)t linetermt ( t splitlinest difflibt unified_diff( t at bt filename( ( s$ /usr/lib64/python2.6/lib2to3/main.pyt diff_texts s t StdoutRefactoringToolc B€ s2 e Z d Z d „ Z d „ Z d „ Z d „ Z RS( s" Prints output to stdout. c C€ s2 | | _ | | _ t t | ƒ i | | | ƒ d S( N( t nobackupst show_diffst superR t __init__( t selft fixerst optionst explicitR R ( ( s$ /usr/lib64/python2.6/lib2to3/main.pyR s c O€ s3 | i i | | | f ƒ | i i | | | Ž d S( N( t errorst appendt loggert error( R t msgt argst kwargs( ( s$ /usr/lib64/python2.6/lib2to3/main.pyt log_error$ s c C€ sô | i p£ | d } t i i | ƒ o@ y t i | ƒ Wqg t i j o } | i d | ƒ qg Xn y t i | | ƒ Wq t i j o } | i d | | ƒ q Xn t t | ƒ i } | | | | | ƒ | i p t i | | ƒ n d S( Ns .baks Can't remove backup %ss Can't rename %s to %s( R t ost patht lexistst removeR t log_messaget renameR R t write_filet shutilt copymode( R t new_textR t old_textt encodingt backupt errt write( ( s$ /usr/lib64/python2.6/lib2to3/main.pyR" ( s c C€ sã | o | i d | ƒ nÅ | i d | ƒ | i oª t | | | ƒ } yl | i d j oB | i i i ƒ z' x | D] } | GHqv Wt i i ƒ Wd QXn x | D] } | GHq£ WWqß t j o t d | f ƒ d SXn d S( Ns No changes to %ss Refactored %ss+ couldn't encode %s's diff for your terminal( R R R t output_lockt Nonet __exit__t __enter__t syst stdoutt flusht UnicodeEncodeErrort warn( R t oldt newR t equalt diff_linest line( ( s$ /usr/lib64/python2.6/lib2to3/main.pyt print_output; s&