From 03c9d6d8441e3293b058fed270866419781b734c Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Wed, 26 Sep 2018 16:23:29 +0200 Subject: Run 2to3 Some stuff is broken now. --- kpov_judge/tasks/nat_port_forward/task.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'kpov_judge/tasks/nat_port_forward') diff --git a/kpov_judge/tasks/nat_port_forward/task.py b/kpov_judge/tasks/nat_port_forward/task.py index 645b20f..2688268 100644 --- a/kpov_judge/tasks/nat_port_forward/task.py +++ b/kpov_judge/tasks/nat_port_forward/task.py @@ -4,7 +4,7 @@ # kpov_random_helpers should be imported by add_assignment.py instructions = { - 'si':u""" + 'si':""" Postavi tri računalnike - SimpleArbiter z diska simpleArbiter, TestClient z diska testClient in NATServer. NATServer naj ima dva omrežna vmesnika - z enim naj bo povezan na omrežje, od koder bo imel dostop do Interneta, z drugim pa na SimpleArbiter. TestClient naj bo povezan na isto omrežje z dostopom do Interneta kot NATServer. Poskrbi, da bo NATServer služil kot DHCP strežnik ter privzeti prehod za SimpleArbiter. @@ -66,7 +66,7 @@ params_meta = { 'IP_NAT': {'descriptions': {'si': 'Naslov NATServer, dostopen s TestClient'}, 'w': True, 'public':True, 'type': 'IP', 'generated': False}, 'PORT_OUTER': {'descriptions': {'si': 'Zunanja vrata'}, 'w': False, 'public':True, 'type': 'port', 'generated': True}, 'PORT_INNER': {'descriptions': {'si': 'Notranja vrata'}, 'w': False, 'public': True, 'type': 'port', 'generated': True}, - 'NET': {'descriptions': {'si': u'Področje naslovov med SimpleArbiter in TestClient'}, 'w': False, 'public': True, 'type': 'NET', 'generated': True}, + 'NET': {'descriptions': {'si': 'Področje naslovov med SimpleArbiter in TestClient'}, 'w': False, 'public': True, 'type': 'NET', 'generated': True}, } def task(IP_TEST_CLIENT, IP_NAT, PORT_OUTER, PORT_INNER, NET): @@ -86,7 +86,7 @@ def task(IP_TEST_CLIENT, IP_NAT, PORT_OUTER, PORT_INNER, NET): k = r.randint(10, 15) results['pre_nc'] = str(k) results['nc_pre'] = "" - for i in xrange(k): + for i in range(k): sshconn.sendline("nc {} {}".format(IP_NAT, PORT_OUTER)) sshconn.sendline() sshconn.sendintr() @@ -96,7 +96,7 @@ def task(IP_TEST_CLIENT, IP_NAT, PORT_OUTER, PORT_INNER, NET): sshconn.sendline() sshconn.prompt() sshconn.sendline("nc {} {}".format(IP_NAT, PORT_OUTER)) - results['post_nc'] = "".join([r.choice("abcd\n") for i in xrange(100)]) + results['post_nc'] = "".join([r.choice("abcd\n") for i in range(100)]) sshconn.sendline(results['post_nc']) time.sleep(1) sshconn.sendintr() @@ -126,7 +126,7 @@ def gen_params(user_id, params_meta): def task_check(results, params): import re - import cPickle + import pickle #if results is None: # with open('bla.pickle') as f: # results = cPickle.load(f) -- cgit v1.2.1