diff options
author | Timotej Lazar <timotej.lazar@fri.uni-lj.si> | 2018-10-11 17:32:19 +0200 |
---|---|---|
committer | Timotej Lazar <timotej.lazar@fri.uni-lj.si> | 2018-10-11 17:32:19 +0200 |
commit | f44c247784ca524f9da861c9b264f0fdc5255629 (patch) | |
tree | aa8c9a56ed505eb29a66a32fed2b07fb872a6acd /kpov_judge | |
parent | fb9fc7185ad66ed7a2cc7549ba7d65ad932d0d5d (diff) |
Remove unused imports
Diffstat (limited to 'kpov_judge')
-rwxr-xr-x | kpov_judge/add_task.py | 17 | ||||
-rw-r--r-- | kpov_judge/instructions_extractor.py | 5 | ||||
-rwxr-xr-x | kpov_judge/kpov_util.py | 13 | ||||
-rwxr-xr-x | kpov_judge/rm_task.py | 12 | ||||
-rw-r--r-- | kpov_judge/tasks/copy_rename_20_files_tail_env/solution/solution.py | 2 | ||||
-rwxr-xr-x | kpov_judge/test_prepare_disks.py | 15 | ||||
-rwxr-xr-x | kpov_judge/test_task.py | 16 | ||||
-rwxr-xr-x | kpov_judge/web/kpov_judge/kpov_judge.py | 2 |
8 files changed, 37 insertions, 45 deletions
diff --git a/kpov_judge/add_task.py b/kpov_judge/add_task.py index 7839cce..9e25048 100755 --- a/kpov_judge/add_task.py +++ b/kpov_judge/add_task.py @@ -1,14 +1,15 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 -import pymongo -from bson.son import SON -from bson import Binary -import sys -import inspect -import kpov_util -import settings import glob +import inspect import os +import settings +import sys +import urllib + +import kpov_util +import pymongo +from bson import Binary def task_check(results, params): data = urllib.parse.urlencode({ diff --git a/kpov_judge/instructions_extractor.py b/kpov_judge/instructions_extractor.py index f747c1a..cc622f9 100644 --- a/kpov_judge/instructions_extractor.py +++ b/kpov_judge/instructions_extractor.py @@ -1,9 +1,7 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import glob -import os.path import os -from bson.son import SON import sys def print_instructions(p, fname): @@ -30,7 +28,6 @@ def print_instructions(p, fname): print("") except Exception as e: print(e) - pass if __name__ == '__main__': l = glob.glob(sys.argv[1]) diff --git a/kpov_judge/kpov_util.py b/kpov_judge/kpov_util.py index 2d8ec9e..ac7053f 100755 --- a/kpov_judge/kpov_util.py +++ b/kpov_judge/kpov_util.py @@ -1,16 +1,15 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import collections +import glob import itertools +import math +import os import random -import string +import re import socket +import string import struct -import math -import re -import subprocess -import glob -import os def ssh_test(host, user, password, commands=()): import pexpect diff --git a/kpov_judge/rm_task.py b/kpov_judge/rm_task.py index 8433f29..1752727 100755 --- a/kpov_judge/rm_task.py +++ b/kpov_judge/rm_task.py @@ -1,15 +1,9 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 -import pymongo -from bson.son import SON -from bson import Binary -import sys -import inspect -import kpov_util import settings -import glob -import os +import sys +import pymongo if __name__ == '__main__': if len(sys.argv) < 2: diff --git a/kpov_judge/tasks/copy_rename_20_files_tail_env/solution/solution.py b/kpov_judge/tasks/copy_rename_20_files_tail_env/solution/solution.py index 6036cd1..f661c4d 100644 --- a/kpov_judge/tasks/copy_rename_20_files_tail_env/solution/solution.py +++ b/kpov_judge/tasks/copy_rename_20_files_tail_env/solution/solution.py @@ -65,7 +65,7 @@ def env(): # S pomočjo programa cURL shrani vsebino spletne strani www.google.com v datoteko z imenom website.txt def googl(): - import urllib.request, urllib.error, urllib.parse + import urllib.request open('website.txt', 'w').write(urllib.request.urlopen('http://www.google.com').read()) # Napiši ukaz, ki bo število pojavitev značke <div> v datoteki website.txt dodal na konec te iste datoteke brez, da bi se ukaz zapisal v zgodovino ukazov "bash history" diff --git a/kpov_judge/test_prepare_disks.py b/kpov_judge/test_prepare_disks.py index 33f2479..7cfc5b5 100755 --- a/kpov_judge/test_prepare_disks.py +++ b/kpov_judge/test_prepare_disks.py @@ -1,16 +1,17 @@ #!/usr/bin/env python3 -import sys +import fcntl +import glob import inspect -import kpov_util -import guestfs import os -import glob -import subprocess -import fcntl +import sys +import urllib.request + +import guestfs import paramiko -import urllib.request, urllib.error, urllib.parse import yaml + +import kpov_util from test_task import http_auth from util import write_default_config diff --git a/kpov_judge/test_task.py b/kpov_judge/test_task.py index cbc564c..d3dcec7 100755 --- a/kpov_judge/test_task.py +++ b/kpov_judge/test_task.py @@ -1,20 +1,20 @@ #!/usr/bin/env python3 +import argparse import collections import getpass +import inspect import io -import yaml import json -import urllib.request, urllib.parse, urllib.error +import locale import os -import inspect -import sys -from bson.son import SON -import kpov_util import random -import argparse -import locale import readline +import sys +import urllib.request + +import yaml +import kpov_util locale.setlocale(locale.LC_ALL, ['C', 'utf8']) readline.set_completer_delims(readline.get_completer_delims().replace('/', '')) diff --git a/kpov_judge/web/kpov_judge/kpov_judge.py b/kpov_judge/web/kpov_judge/kpov_judge.py index 2231db0..1085b9b 100755 --- a/kpov_judge/web/kpov_judge/kpov_judge.py +++ b/kpov_judge/web/kpov_judge/kpov_judge.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import flask from flask import Flask, g, session, redirect, url_for, abort, render_template, flash, app, request, Response |