From b46ce13d4e5421990dbc709b42398786c179d40e Mon Sep 17 00:00:00 2001 From: "gasperfele@fri1.uni-lj.si" Date: Wed, 28 Jan 2015 11:37:31 +0000 Subject: 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 --- kpov_judge/kpov_random_helpers.py | 4 ++-- kpov_judge/test_task.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'kpov_judge') 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' -- cgit v1.2.1