diff options
| author | Fulgen301 <tokmajigeorge@gmailc.om> | 2017-07-09 18:33:52 +0200 |
|---|---|---|
| committer | Fulgen301 <tokmajigeorge@gmail.com> | 2017-07-11 11:10:33 +0200 |
| commit | 08cbb39aaf8f66945d85657628fed261a6132bde (patch) | |
| tree | 80a4ce3beddb83d767335915c12bf22073082f7d | |
| parent | 044c1e2b19df418e947bea2c6724313d62b08441 (diff) | |
| download | pycrctrl-08cbb39aaf8f66945d85657628fed261a6132bde.tar.gz pycrctrl-08cbb39aaf8f66945d85657628fed261a6132bde.zip | |
Remove unused imports
| -rw-r--r-- | pycrctrl/pycrctrl.py | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/pycrctrl/pycrctrl.py b/pycrctrl/pycrctrl.py index dd4b148..19a482b 100644 --- a/pycrctrl/pycrctrl.py +++ b/pycrctrl/pycrctrl.py @@ -18,8 +18,6 @@ import sys import subprocess import urllib.request -import urllib.error -import urllib.parse from _thread import start_new_thread import queue @@ -27,13 +25,11 @@ import os import re import json import base64 -import supybot.log import supybot.ircmsgs as ircmsgs from pickle import Pickler, Unpickler from time import sleep from platform import architecture from io import BytesIO -from copy import deepcopy #iostream import try: @@ -131,19 +127,19 @@ class Updater(object): cout << "Regex didn't match" << endl except Exception as e: - supybot.log.exception(str(e)) + cerr << str(e) << endl finally: sleep(10) def loadNewSnapshot(self, reg): - supybot.log.info("Downloading snapshot...") + cout << "Downloading snapshot..." << endl with open(os.path.join(self.parent.path, "snapshot"), "wb") as fobj: fobj.write(urllib.request.urlopen("http://openclonk.org/builds/nightly/snapshots/{}".format(reg.group(0).split("' title")[0])).read()) #extract the snapshot tar = tarfile.open(os.path.join(self.parent.path, "snapshot"), mode="r:bz2") tar.extractall(path=self.parent.path) - supybot.log.info("New snapshot has been extracted.") + cout << "New snapshot has been extracted." << endl #get the openclonk-server autobuild site = json.loads(urllib.request.urlopen("https://autobuild.openclonk.org/api/v1/jobs").read().decode("utf-8")) @@ -159,14 +155,14 @@ class Updater(object): # cout << self.current_revision << sys.platform << self.lookuptable[architecture()[0]] << endl # cout << endl if reg and (reg.group(1), reg.group(2), reg.group(3)) == (self.current_revision[:-3], sys.platform, self.lookuptable[architecture()[0]]): - supybot.log.info("Downloading openclonk-server build...") + cout << "Downloading openclonk-server build..." << endl buffer = BytesIO() buffer.write(urllib.request.urlopen("https://autobuild.openclonk.org/static/binaries/{}".format(b["path"])).read()) buffer.seek(0) with open(os.path.join(self.parent.path, "openclonk-server"), "wb") as fobj: fobj.write(GzipFile(fileobj=buffer).read()) - supybot.log.info("New openclonk-server build has been extracted.") + cout << "New openclonk-server build has been extracted." << endl os.chmod(os.path.join(self.parent.path, "openclonk-server"), os.stat(os.path.join(self.parent.path, "openclonk-server")).st_mode | 64) return True |
