From 7210b74d6241a4264532aaaa2e1d771eaca4e073 Mon Sep 17 00:00:00 2001 From: "gasperfele@fri1.uni-lj.si" Date: Sat, 1 Oct 2016 06:40:12 +0000 Subject: Update create_disk_image so it works with the current pymongo git-svn-id: https://svn.lusy.fri.uni-lj.si/kpov-public-svn/kpov-public@350 5cf9fbd1-b2bc-434c-b4b7-e852f4f63414 --- kpov_judge/create_disk_images.py | 2 +- kpov_judge/tasks/basic_network_gcc/task.py | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/kpov_judge/create_disk_images.py b/kpov_judge/create_disk_images.py index 3e59ed4..8b357ed 100755 --- a/kpov_judge/create_disk_images.py +++ b/kpov_judge/create_disk_images.py @@ -61,7 +61,7 @@ if __name__ == '__main__': if len(sys.argv) != 1: print "Usage: {0}" print "Create the neccessarry disk images" - db = pymongo.Connection(settings.DB_HOST).kpov + db = pymongo.MongoClient(settings.DB_HOST).kpov try: db.authenticate(settings.USERNAME, settings.PASSWORD) except Exception, e: diff --git a/kpov_judge/tasks/basic_network_gcc/task.py b/kpov_judge/tasks/basic_network_gcc/task.py index 6aa2144..8311503 100644 --- a/kpov_judge/tasks/basic_network_gcc/task.py +++ b/kpov_judge/tasks/basic_network_gcc/task.py @@ -22,9 +22,11 @@ Izvorna koda je namenoma pokvarjena tako, da so vanjo vrinjeni nepotrebni znaki. Pred prevajanjem jo morate popraviti. Napišite skripto ali program {P_script} v domačem imeniku uporabnika student, ki: -- požene {P_executable} z argumentom "{arg_c}" in mu na standardni vhod pripelje vrednost spremenljivke {env_c} +- požene {P_executable} z argumentom "{arg_c}" in mu na standardni vhod + pripelje vrednost spremenljivke {env_c} - vse, kar {P_executable} izpiše na stderr, spravi v datoteko {out_stderr_c}. -- vse vrstice, ki jih {P_executable} izpiše na stdout in vsebujejo zaporedje znakov "ma", zapiše v {out_stdout_c}. +- vse vrstice, ki jih {P_executable} izpiše na stdout in vsebujejo + zaporedje znakov "ma", zapiše v {out_stdout_c}. Lastnik vseh ustvarjenih datotek mora biti uporabnik student. @@ -176,11 +178,11 @@ def task_check(results, params): for i in xrange(100): s_out += chr(32 + ((ord(arg[i % arg_len]) ^ ord(var[i % env_len])) % 64)) r += ord(arg[i % arg_len]) + ord(var[i % env_len]) + i; - if (i % 20 == 0): + if (i % 17 == 0): s_out += "RAUS\r\n"; - if (i % 31 == 0): + if (i % 29 == 0): s_out += 'ma' - s_err += chr((r % 32) + ord('A')); + s_err += chr((r % 31) + ord('A')); if (i % 23 == 0): s_err += "PATACIS\r\n" retval = r % 16 -- cgit v1.2.1