Mercurial > ~astiob > upreckon > hgweb
comparison upreckon/problem.py @ 179:a55a1e00e121
Renamed load_problem to load_testcases
author | Oleg Oshmyan <chortos@inbox.lv> |
---|---|
date | Mon, 20 Jun 2011 17:56:47 +0300 |
parents | a1286da36d29 |
children | 0480dfa50366 |
comparison
equal
deleted
inserted
replaced
178:0d657576b1ac | 179:a55a1e00e121 |
---|---|
110 # This shouldn't happen, of course | 110 # This shouldn't happen, of course |
111 raise TypeError('Problem() argument 1 must be string, not ' + type(name).__name__) | 111 raise TypeError('Problem() argument 1 must be string, not ' + type(name).__name__) |
112 prob.name = name | 112 prob.name = name |
113 prob.config = config.load_problem(name) | 113 prob.config = config.load_problem(name) |
114 prob.cache = Cache({'padoutput': 0}) | 114 prob.cache = Cache({'padoutput': 0}) |
115 prob.testcases = load_problem(prob) | 115 prob.testcases = load_testcases(prob) |
116 | 116 |
117 # TODO | 117 # TODO |
118 def build(prob): | 118 def build(prob): |
119 raise NotImplementedError | 119 raise NotImplementedError |
120 | 120 |
234 os.remove(prob.config.ansname) | 234 os.remove(prob.config.ansname) |
235 except Exception: | 235 except Exception: |
236 pass | 236 pass |
237 | 237 |
238 | 238 |
239 def load_problem(prob, _types={'batch' : testcases.BatchTestCase, | 239 def load_testcases(prob, _types={'batch' : testcases.BatchTestCase, |
240 'outonly': testcases.OutputOnlyTestCase}): | 240 'outonly': testcases.OutputOnlyTestCase}): |
241 # We will need to iterate over these configuration variables twice | 241 # We will need to iterate over these configuration variables twice |
242 try: | 242 try: |
243 len(prob.config.dummies) | 243 len(prob.config.dummies) |
244 except Exception: | 244 except Exception: |
245 prob.config.dummies = tuple(prob.config.dummies) | 245 prob.config.dummies = tuple(prob.config.dummies) |