diff options
author | gasperfele@fri1.uni-lj.si <gasperfele@fri1.uni-lj.si@5cf9fbd1-b2bc-434c-b4b7-e852f4f63414> | 2014-11-24 15:25:26 +0000 |
---|---|---|
committer | gasperfele@fri1.uni-lj.si <gasperfele@fri1.uni-lj.si@5cf9fbd1-b2bc-434c-b4b7-e852f4f63414> | 2014-11-24 15:25:26 +0000 |
commit | 794efa5dcccf8e7b6e33e1f12f9a25fbda4b4740 (patch) | |
tree | a405da8814e152e32dc3f38922b4b85cf423960b /kpov_judge/tasks/set_motd | |
parent | 4ce9fe9a726b148c13fb98e8ac00715d438516a0 (diff) |
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
Diffstat (limited to 'kpov_judge/tasks/set_motd')
-rw-r--r-- | kpov_judge/tasks/set_motd/task.py | 6 |
1 files changed, 3 insertions, 3 deletions
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 |