Changeset 2621 for 2011


Ignore:
Timestamp:
2011-08-08 10:26:29 (12 years ago)
Author:
tekrjant
Message:

--write-results -optio.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 2011/31/build_games.py

    r2620 r2621  
    1010import re 
    1111 
     12should_write_results = False 
    1213 
    1314output_dir = abspath("pelit") 
     
    5960        path = abspath(d) 
    6061        time = datetime(2000, 1, 1) 
    61         if exists(join(path, ".svn")): 
     62        if should_write_results and exists(join(path, ".svn")): 
    6263            call("svn update " + path, shell=True) 
    6364            outputs = Popen("svn info " + path, stdout=PIPE).communicate() 
     
    7879    if n == 6: return "Sunnuntai" 
    7980    raise Exception("Invalid weekday number") 
     81 
    8082 
    8183def write_result(author, name, success, last_changed_date): 
     
    106108 
    107109            success = build(projects[0]) 
    108             write_result(author, project_name, success, last_changed_date) 
     110 
     111            if should_write_results: 
     112                write_result(author, project_name, success, last_changed_date) 
    109113 
    110114            if success: 
     
    131135 
    132136 
     137def parse_arguments(): 
     138    for arg in sys.argv[1:]: 
     139        if arg == "--write-results": 
     140            global should_write_results 
     141            should_write_results = True 
     142        else: 
     143            raise Exception("Unknown argument: " + arg) 
     144 
     145 
    133146def main(): 
    134147    try: 
     148        parse_arguments() 
    135149        check_requirements() 
    136150        create_output_directory() 
    137         create_build_result_directory() 
     151        if should_write_results: create_build_result_directory() 
    138152        build_games() 
    139153    except KeyboardInterrupt: 
Note: See TracChangeset for help on using the changeset viewer.