annotate zipfiles/zipfile.py @ 205:166a23999bf7

Added confvar okexitcodemask; changed the validator protocol Callable validators now return three-tuples (number granted, bool correct, str comment) instead of two-tuples (number granted, str comment). They are still allowed to return single numbers. Callable validators must now explicitly raise upreckon.exceptions.WrongAnswer if they want the verdict to be Wrong Answer rather than Partly Correct. okexitcodemask specifies a bitmask ANDed with the exit code of the external validator to get a boolean flag showing whether the answer is to be marked as 'OK' rather than 'partly correct'. The bits covered by the bitmask are reset to zeroes before devising the number of points granted from the resulting number.
author Oleg Oshmyan <chortos@inbox.lv>
date Wed, 17 Aug 2011 20:44:54 +0300
parents 45d4a9dc707b
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
21
ec6f1a132109 A pretty usable version
Oleg Oshmyan <chortos@inbox.lv>
parents:
diff changeset
1 import sys
29
a8cc383b787c Clean up zipfiles and diff them to stock ones
Oleg Oshmyan <chortos@inbox.lv>
parents: 21
diff changeset
2 if sys.version_info[0] >= 3:
97
bbf9c434fa57 Added zipfile-with-bzip2 implementation for Python 3.2
Oleg Oshmyan <chortos@inbox.lv>
parents: 50
diff changeset
3 if sys.version_info[1] >= 2:
bbf9c434fa57 Added zipfile-with-bzip2 implementation for Python 3.2
Oleg Oshmyan <chortos@inbox.lv>
parents: 50
diff changeset
4 from zipfile32 import *
bbf9c434fa57 Added zipfile-with-bzip2 implementation for Python 3.2
Oleg Oshmyan <chortos@inbox.lv>
parents: 50
diff changeset
5 else:
bbf9c434fa57 Added zipfile-with-bzip2 implementation for Python 3.2
Oleg Oshmyan <chortos@inbox.lv>
parents: 50
diff changeset
6 from zipfile31 import *
21
ec6f1a132109 A pretty usable version
Oleg Oshmyan <chortos@inbox.lv>
parents:
diff changeset
7 else:
97
bbf9c434fa57 Added zipfile-with-bzip2 implementation for Python 3.2
Oleg Oshmyan <chortos@inbox.lv>
parents: 50
diff changeset
8 if sys.version_info[0] == 2 and sys.version_info[1] >= 7:
bbf9c434fa57 Added zipfile-with-bzip2 implementation for Python 3.2
Oleg Oshmyan <chortos@inbox.lv>
parents: 50
diff changeset
9 from zipfile27 import *
bbf9c434fa57 Added zipfile-with-bzip2 implementation for Python 3.2
Oleg Oshmyan <chortos@inbox.lv>
parents: 50
diff changeset
10 else:
bbf9c434fa57 Added zipfile-with-bzip2 implementation for Python 3.2
Oleg Oshmyan <chortos@inbox.lv>
parents: 50
diff changeset
11 from zipfile26 import *