diff options
author | jr1224@student.uni-lj.si <jr1224@student.uni-lj.si@5cf9fbd1-b2bc-434c-b4b7-e852f4f63414> | 2015-01-26 03:16:51 +0000 |
---|---|---|
committer | jr1224@student.uni-lj.si <jr1224@student.uni-lj.si@5cf9fbd1-b2bc-434c-b4b7-e852f4f63414> | 2015-01-26 03:16:51 +0000 |
commit | 956969d56e8e8ce7a16f9f3a8be962216da6ff77 (patch) | |
tree | 99a29519e0953262488884c2df7a5c9b9fb5eed9 | |
parent | b42f94299c93fbfbcf0e0a4982417692eaa4dfcc (diff) |
git-svn-id: https://svn.lusy.fri.uni-lj.si/kpov-public-svn/kpov-public@236 5cf9fbd1-b2bc-434c-b4b7-e852f4f63414
-rw-r--r-- | kpov_judge/tasks/copy_rename_20_files_tail_env/task.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/kpov_judge/tasks/copy_rename_20_files_tail_env/task.py b/kpov_judge/tasks/copy_rename_20_files_tail_env/task.py index d1b67a4..7b113a2 100644 --- a/kpov_judge/tasks/copy_rename_20_files_tail_env/task.py +++ b/kpov_judge/tasks/copy_rename_20_files_tail_env/task.py @@ -128,8 +128,8 @@ def gen_params(user_id, params_meta): params['DNS_static'] = r.choice(dns_servers) count = 0 while(count<user_id): - params[count]=random.randInt(10000000,99999999) - count=count+1 + params[count]=random.randInt(10000000,99999999) + count=count+1 return params def task_check(results, params): @@ -182,8 +182,9 @@ def preimenuj(): #napisi cimkrajsi ukaz, ki vse datoteke iz /home/user/mapa/mojimenik premakne v /hostuser/novi def premakni(): import os - for filename in os.filename("/home/user/mapa/mojimenik/"): - os.rename('/home/user/mapa/mojimenik/' + filename, '/home/user/novi/' + filename) + + for filename in os.filename("/home/user/mapa/mojimenik/"): + os.rename('/home/user/mapa/mojimenik/' + filename, '/home/user/novi/' + filename) #napisi ukaz, ki s pomocjo ukaza grep v datoteko "mama.txt" izpise vse navadne (ne skrite) datoteke v trenutnem imeniku, ki vsebujejo niz "mama", v datoteko "napake.txt" pa izpise vse morebitne napake @@ -210,7 +211,7 @@ def izpisi(): open('napake.txt','w').write(napaka) #napisi ukaz, ki bo 5s sledil vsebini /var/log/syslog. V primeru, da se pojavi niz "zmeda", naj program izpise "imam ga". Polega tega naj program med sledenjem odsteva od 5 do 1 -def sledi() +def sledi(): import time import re import mmap |