summaryrefslogtreecommitdiff
path: root/kpov_judge/instructions_extractor.py
diff options
context:
space:
mode:
authorgasperfele@fri1.uni-lj.si <gasperfele@fri1.uni-lj.si@5cf9fbd1-b2bc-434c-b4b7-e852f4f63414>2014-10-21 21:35:40 +0000
committergasperfele@fri1.uni-lj.si <gasperfele@fri1.uni-lj.si@5cf9fbd1-b2bc-434c-b4b7-e852f4f63414>2014-10-21 21:35:40 +0000
commitf3e2c6f2add893710dc9a54098acff13c5934a90 (patch)
tree7e03f8787f9cc383a2b7b0c51cd30b9b66a61c13 /kpov_judge/instructions_extractor.py
parentbe32ceb69271797a38b24d07930ac9afcd0c729f (diff)
Separated tasks from lectures
git-svn-id: https://svn.lusy.fri.uni-lj.si/kpov-public-svn/kpov-public@2 5cf9fbd1-b2bc-434c-b4b7-e852f4f63414
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
+