Mercurial > ~astiob > upreckon > hgweb
comparison upreckon/exceptions.py @ 146:d5b6708c1955
Distutils support, reorganization and cleaning up
* Removed command-line options -t and -u.
* Reorganized code:
o all modules are now in package upreckon;
o TestCaseNotPassed and its descendants now live in a separate
module exceptions;
o load_problem now lives in module problem.
* Commented out mentions of command-line option -c in --help.
* Added a distutils-based setup.py.
author | Oleg Oshmyan <chortos@inbox.lv> |
---|---|
date | Sat, 28 May 2011 14:24:25 +0100 |
parents | |
children | 65b5c9390010 |
comparison
equal
deleted
inserted
replaced
145:d2c266c8d820 | 146:d5b6708c1955 |
---|---|
1 # Copyright (c) 2010-2011 Chortos-2 <chortos@inbox.lv> | |
2 | |
3 __all__ = ('TestCaseNotPassed', 'TestCaseSkipped', 'TimeLimitExceeded', | |
4 'CPUTimeLimitExceeded', 'WallTimeLimitExceeded', | |
5 'MemoryLimitExceeded', 'CanceledByUser', 'WrongAnswer', | |
6 'NonZeroExitCode', 'ExceptionWrapper', 'CannotStartTestee', | |
7 'CannotStartValidator', 'CannotReadOutputFile', | |
8 'CannotReadInputFile', 'CannotReadAnswerFile') | |
9 | |
10 class TestCaseNotPassed(Exception): __slots__ = () | |
11 class TestCaseSkipped(TestCaseNotPassed): __slots__ = () | |
12 class TimeLimitExceeded(TestCaseNotPassed): __slots__ = () | |
13 class CPUTimeLimitExceeded(TimeLimitExceeded): __slots__ = () | |
14 class WallTimeLimitExceeded(TimeLimitExceeded): __slots__ = () | |
15 class MemoryLimitExceeded(TestCaseNotPassed): __slots__ = () | |
16 class CanceledByUser(TestCaseNotPassed): __slots__ = () | |
17 | |
18 class WrongAnswer(TestCaseNotPassed): | |
19 __slots__ = 'comment' | |
20 def __init__(self, comment=''): | |
21 self.comment = comment | |
22 | |
23 class NonZeroExitCode(TestCaseNotPassed): | |
24 __slots__ = 'exitcode' | |
25 def __init__(self, exitcode): | |
26 self.exitcode = exitcode | |
27 | |
28 class ExceptionWrapper(TestCaseNotPassed): | |
29 __slots__ = 'upstream' | |
30 def __init__(self, upstream): | |
31 self.upstream = upstream | |
32 | |
33 class CannotStartTestee(ExceptionWrapper): __slots__ = () | |
34 class CannotStartValidator(ExceptionWrapper): __slots__ = () | |
35 class CannotReadOutputFile(ExceptionWrapper): __slots__ = () | |
36 class CannotReadInputFile(ExceptionWrapper): __slots__ = () | |
37 class CannotReadAnswerFile(ExceptionWrapper): __slots__ = () |