# HG changeset patch # User Oleg Oshmyan # Date 1295262661 0 # Node ID ee8a99dcaaedcf843ad90c59804d04b586f4c7ad # Parent d46bd7ee3e697e4c57d7f0a1468ac99a05290646 Renamed configuration variable tasknames to problems diff -r d46bd7ee3e69 -r ee8a99dcaaed config.py --- 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 diff -r d46bd7ee3e69 -r ee8a99dcaaed testcases.py --- 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) diff -r d46bd7ee3e69 -r ee8a99dcaaed upreckon-vcs --- 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()