summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgasperfele@fri1.uni-lj.si <gasperfele@fri1.uni-lj.si@5cf9fbd1-b2bc-434c-b4b7-e852f4f63414>2015-01-28 11:37:31 +0000
committergasperfele@fri1.uni-lj.si <gasperfele@fri1.uni-lj.si@5cf9fbd1-b2bc-434c-b4b7-e852f4f63414>2015-01-28 11:37:31 +0000
commitb46ce13d4e5421990dbc709b42398786c179d40e (patch)
tree37555b18e75ee1ee5baba029a119a35c525a7713
parentdca7ba5af36ab2358b55c19f12be1c174134239f (diff)
Fixed kpov_random_helpers
git-svn-id: https://svn.lusy.fri.uni-lj.si/kpov-public-svn/kpov-public@245 5cf9fbd1-b2bc-434c-b4b7-e852f4f63414
-rwxr-xr-xkpov_judge/kpov_random_helpers.py4
-rwxr-xr-xkpov_judge/test_task.py2
2 files changed, 3 insertions, 3 deletions
diff --git a/kpov_judge/kpov_random_helpers.py b/kpov_judge/kpov_random_helpers.py
index aadce0b..c94dcb3 100755
--- a/kpov_judge/kpov_random_helpers.py
+++ b/kpov_judge/kpov_random_helpers.py
@@ -103,7 +103,7 @@ with open('random_data/slovenian_surnames.txt') as f:
surnames = [i.strip() for i in f.readlines()]
def username_gen(r):
- return r.choice(names) + r.choice(surnames) + "{0}".format(r.randint(1, 99))
+ return ("{}{}{}".format(r.choice(names), r.choice(surnames), r.randint(1, 99))).lower()
def unknown_generator(r):
return ''
@@ -127,7 +127,7 @@ def default_gen(userID, param_meta):
params = dict()
for name, meta in param_meta.iteritems():
if meta.get('generated', False):
- params[name] = default_generators(
+ params[name] = default_generators.get(
meta.get('type', None), unknown_generator)(r)
return params
diff --git a/kpov_judge/test_task.py b/kpov_judge/test_task.py
index 79521d4..b59aebc 100755
--- a/kpov_judge/test_task.py
+++ b/kpov_judge/test_task.py
@@ -23,7 +23,7 @@ import argparse
#PARAMS_URL = SERVER_URL + '{task_id}/params.json'
#SUBMIT_URL = SERVER_URL + '{task_id}/results.json'
-TASK_URL = "file://./"
+TASK_URL = "file://" + os.getcwd() + '/tasks'
PARAMS_FILE = os.path.expanduser("~/.kpov_params.yaml")
DEFAULT_LANGUAGE = 'si'