Mercurial > ~astiob > upreckon > hgweb
view 2.00/testcases.py @ 20:5bfa23cd638d
More ZIP archive fixes
One typo and one Windows incompatibility fixed.
author | Oleg Oshmyan <chortos@inbox.lv> |
---|---|
date | Mon, 14 Jun 2010 21:02:06 +0000 |
parents | f2279b7602d3 |
children | ec6f1a132109 |
line wrap: on
line source
#!/usr/bin/python # Copyright (c) 2010 Chortos-2 <chortos@inbox.lv> try: import files as _files, problem as _problem except ImportError as e: import __main__ __main__.import_error(e) class TestCase(object): __slots__ = 'problem', 'infile', 'outfile' def __init__(case, prob, infile, outfile): case.problem = prob case.infile = infile case.outfile = outfile def __call__(case): os.copy() def load_problem(prob): if prob.config.usegroups: pass else: for i in prob.config.tests: s = str(i).zfill(prob.config.padwithzeroestolength) prob.cache.padoutputtolength = max(prob.cache.padoutputtolength, len(s)) infile = _files.TestCaseFile(prob, prob.config.testcaseinname.replace('$', s)) if infile: if prob.config.kind != _problem.BATCH: yield TestCase(prob, infile, None) else: outfile = _files.TestCaseFile(prob, prob.config.testcaseoutname.replace('$', s)) if outfile: yield TestCase(prob, infile, outfile)