From 794efa5dcccf8e7b6e33e1f12f9a25fbda4b4740 Mon Sep 17 00:00:00 2001 From: "gasperfele@fri1.uni-lj.si" Date: Mon, 24 Nov 2014 15:25:26 +0000 Subject: The first working version of test_task.py git-svn-id: https://svn.lusy.fri.uni-lj.si/kpov-public-svn/kpov-public@9 5cf9fbd1-b2bc-434c-b4b7-e852f4f63414 --- kpov_judge/tasks/set_motd/task.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'kpov_judge/tasks/set_motd') diff --git a/kpov_judge/tasks/set_motd/task.py b/kpov_judge/tasks/set_motd/task.py index 5367577..f329773 100644 --- a/kpov_judge/tasks/set_motd/task.py +++ b/kpov_judge/tasks/set_motd/task.py @@ -50,7 +50,7 @@ computers = { networks = { 'net1': {'public': False}, 'test-net': {'public': True} } params_meta = { - 'peer_ip': {'descriptions': {'si': 'IP računalnika'}, 'w': True, 'public':True, 'type': 'IP', 'generated': False}, + 'peer_ip': {'descriptions': {'si': u'IP računalnika'}, 'w': True, 'public':True, 'type': 'IP', 'generated': False}, 'peer_user': {'descriptions': {'si': 'ime uporabnika'}, 'w': False, 'public': True, 'type': 'username', 'generated': True}, 'peer_passwd': {'descriptions': {'si': 'geslo uporabnika'}, 'w': True, 'public': True, 'type': 'alnumstr', 'generated': False}, 'niz': {'w': False, 'public': True, 'type': 'short_text', 'generated': True}, @@ -63,7 +63,7 @@ def task(peer_ip, peer_user, peer_passwd, niz): results = dict() s = pxssh.pxssh() s.login (peer_ip, peer_user, peer_passwd, original_prompt=r'{0}@.*:\~\$'.format(peer_user),auto_prompt_reset=False) - temp = s.before # print everything before the prompt. + temp = s.before # print everything before the prompt. results['motd'] = temp.replace("#","") #zamenja vse pojavitve "#" s praznim stringom #results['motd'] = s.before # print everything before the prompt. prvotna verzija return results @@ -73,7 +73,7 @@ def gen_params(user_id, params_meta): def task_check(results, params): niz = params['niz'] - niz=niz.replace("#","") + niz=niz.replace("#","") score = 0 if (results['motd'].find(niz) > -1): score += 10 -- cgit v1.2.1