Mercurial > ~astiob > upreckon > hgweb
changeset 79:ee8a99dcaaed
Renamed configuration variable tasknames to problems
author | Oleg Oshmyan <chortos@inbox.lv> |
---|---|
date | Mon, 17 Jan 2011 11:11:01 +0000 |
parents | d46bd7ee3e69 |
children | 809b77302b21 |
files | config.py testcases.py upreckon-vcs |
diffstat | 3 files changed, 7 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/config.py Thu Jan 13 19:48:33 2011 +0200 +++ b/config.py Mon Jan 17 11:11:01 2011 +0000 @@ -42,7 +42,7 @@ 'maxexitcode': 0, 'inname': '', 'ansname': ''} -defaults_global = {'tasknames': None, +defaults_global = {'problems': None, 'force_zero_exitcode': True} defaults_noerase = {'inname': '%.in', 'outname': '%.out', @@ -194,6 +194,8 @@ if not options.erase: for name in defaults_noerase: setattr(module, name, getattr(module, name, defaults_noerase[name])) + if hasattr(module, 'tasknames'): + module.problems = module.tasknames global globalconf globalconf = module sys.dont_write_bytecode = dwb
--- a/testcases.py Thu Jan 13 19:48:33 2011 +0200 +++ b/testcases.py Mon Jan 17 11:11:01 2011 +0000 @@ -579,8 +579,7 @@ inputdatafname = case.problem.config.inname contextmgr = Copying(case.infile, inputdatafname) with contextmgr: - # FIXME: this U doesn't do anything good for the child process, does it? - with open(inputdatafname, 'rU') as infile: + with open(inputdatafname) as infile: with tempfile.TemporaryFile('w+') if options.erase and not case.validator else open(case.problem.config.outname, 'w+') as outfile: if call is not None: call(case.problem.config.path, case=case, stdin=infile, stdout=outfile, stderr=devnull, universal_newlines=True, bufsize=-1, preexec_fn=preexec_fn)
--- a/upreckon-vcs Thu Jan 13 19:48:33 2011 +0200 +++ b/upreckon-vcs Mon Jan 17 11:11:01 2011 +0000 @@ -113,10 +113,10 @@ import_error(sys.exc_info()[1]) # Support single-problem configurations - if globalconf.tasknames is None: + if globalconf.problems is None: shouldprintnames = False globalconf.multiproblem = False - globalconf.tasknames = os.path.curdir, + globalconf.problems = os.path.curdir, else: globalconf.multiproblem = True shouldprintnames = True @@ -126,7 +126,7 @@ maxscore = 0 realscore = 0 - for taskname in (globalconf.tasknames if not options.problems else options.problems): + for taskname in (globalconf.problems if not options.problems else options.problems): problem = Problem(taskname) if ntasks and not options.copyonly: say()