summaryrefslogtreecommitdiff
path: root/kpov_judge/instructions_extractor.py
diff options
context:
space:
mode:
Diffstat (limited to 'kpov_judge/instructions_extractor.py')
-rw-r--r--kpov_judge/instructions_extractor.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/kpov_judge/instructions_extractor.py b/kpov_judge/instructions_extractor.py
new file mode 100644
index 0000000..5574389
--- /dev/null
+++ b/kpov_judge/instructions_extractor.py
@@ -0,0 +1,24 @@
+#!/usr/bin/env python
+
+import glob
+import os.path
+from bson.son import SON
+import sys
+
+
+if __name__ == '__main__':
+ l = glob.glob(sys.argv[1])
+ l.sort()
+ for week in l:
+ print "---------------"
+ for part in ['preparation', 'evaluation']:
+ try:
+ print week.split('/')[2], '-' , part, ':'
+ with open(os.path.join(week, part, 'task.py')) as f:
+ task_code = compile(f.read(), 'task.py', 'exec')
+ exec(task_code)
+ print instructions['si'].encode('utf-8')
+ except Exception, e:
+ print e
+ pass
+