Download Install Tutorial Docs FAQ Tools WikiLicense Team IRC Planet Involvement Shop Book

Changeset 2588

Show
Ignore:
Timestamp:
02/22/10 12:08:41
Author:
jaraco
Message:

Created convert_file to codify purpose

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/sphinx/util/convert-links.py

    r2587 r2588  
    3131        ] 
    3232 
    33 def handle_command_line(): 
    34         options = get_options() 
    35         text = open(options.filename).read() 
     33def convert_file(filename): 
     34        text = open(filename).read() 
    3635        new_text = text 
    3736        for repl in replacements: 
     
    3938                new_text = pattern.sub(repl, text) 
    4039 
    41         open(options.filename, 'w').write(new_text) 
     40        open(filename, 'w').write(new_text) 
    4241        print("done") 
     42 
     43 
     44def handle_command_line(): 
     45        options = get_options() 
     46        convert_file(options.filename) 
    4347 
    4448if __name__ == '__main__': 

Hosted by WebFaction

Log in as guest/cpguest to create tickets