comparison 2.00/testcases.py @ 43:81f58c938ec5

Fixed the -s option
author Oleg Oshmyan <chortos@inbox.lv>
date Sun, 05 Dec 2010 15:37:35 +0100
parents 164395af969d
children
comparison
equal deleted inserted replaced
42:44609b41868b 43:81f58c938ec5
1 #! /usr/bin/env python 1 #! /usr/bin/env python
2 # Copyright (c) 2010 Chortos-2 <chortos@inbox.lv> 2 # Copyright (c) 2010 Chortos-2 <chortos@inbox.lv>
3
4 # TODO: copy the ansfile if not options.erase even if no validator is used
3 5
4 from __future__ import division, with_statement 6 from __future__ import division, with_statement
5 7
6 try: 8 try:
7 from compat import * 9 from compat import *
351 # Well, at least we tried 353 # Well, at least we tried
352 pass 354 pass
353 case.open_infile() 355 case.open_infile()
354 case.time_started = None 356 case.time_started = None
355 if case.problem.config.stdio: 357 if case.problem.config.stdio:
356 if options.erase and not case.validator: 358 if options.erase and not case.validator and case.problem.config.inname:
357 # TODO: re-use the same file name if possible 359 # TODO: re-use the same file name if possible
358 # FIXME: 2.5 lacks the delete parameter 360 # FIXME: 2.5 lacks the delete parameter
359 with tempfile.NamedTemporaryFile(delete=False) as f: 361 with tempfile.NamedTemporaryFile(delete=False) as f:
360 inputdatafname = f.name 362 inputdatafname = f.name
361 contextmgr = CopyDeleting(case, case.infile, inputdatafname) 363 contextmgr = CopyDeleting(case, case.infile, inputdatafname)