# HG changeset patch # User Oleg Oshmyan # Date 1291559855 -3600 # Node ID 81f58c938ec5c7a6633273d840e4b00227a1b171 # Parent 44609b41868b09072ccb81be64c6a6aaf81016e8 Fixed the -s option diff -r 44609b41868b -r 81f58c938ec5 2.00/config.py --- a/2.00/config.py Sun Dec 05 15:29:17 2010 +0100 +++ b/2.00/config.py Sun Dec 05 15:37:35 2010 +0100 @@ -42,6 +42,9 @@ 'ansname': ''} defaults_global = {'tasknames': None, 'force_zero_exitcode': True} +defaults_noerase = {'inname': '%.in', + 'outname': '%.out', + 'ansname': '%.ans'} patterns = ('inname', 'outname', 'ansname', 'testcaseinname', 'testcaseoutname', 'dummyinname', 'dummyoutname') @@ -170,6 +173,9 @@ del sys.modules['testconf'] for name in defaults_global: setattr(module, name, getattr(module, name, defaults_global[name])) + if not options.erase: + for name in defaults_noerase: + setattr(module, name, getattr(module, name, defaults_noerase[name])) global globalconf globalconf = module sys.dont_write_bytecode = dwb diff -r 44609b41868b -r 81f58c938ec5 2.00/testcases.py --- a/2.00/testcases.py Sun Dec 05 15:29:17 2010 +0100 +++ b/2.00/testcases.py Sun Dec 05 15:37:35 2010 +0100 @@ -1,6 +1,8 @@ #! /usr/bin/env python # Copyright (c) 2010 Chortos-2 +# TODO: copy the ansfile if not options.erase even if no validator is used + from __future__ import division, with_statement try: @@ -353,7 +355,7 @@ case.open_infile() case.time_started = None if case.problem.config.stdio: - if options.erase and not case.validator: + if options.erase and not case.validator and case.problem.config.inname: # TODO: re-use the same file name if possible # FIXME: 2.5 lacks the delete parameter with tempfile.NamedTemporaryFile(delete=False) as f: