commit 1d380f9f8765e35bc4200b18700316cd44be6405
parent 09020eb2b377bc5dcff9b38fc9b8e1d5bc982f6d
Author: Marcel <MTRNord@users.noreply.github.com>
Date: Sun, 13 Nov 2016 14:53:30 +0100
cleanup code
Diffstat:
1 file changed, 0 insertions(+), 20 deletions(-)
diff --git a/__init__.py b/__init__.py
@@ -22,18 +22,6 @@ def _initialise(bot):
def _open_file(name):
logger.debug("opening screenshot file: {}".format(name))
return open(name, 'rb')
-@asyncio.coroutine
-def _replace(file_path, pattern, subst):
- #Create temp file
- abs_path = tempfile.NamedTemporaryFile(suffix=".js", delete=False).name
- with open(abs_path,'w') as new_file:
- with open(file_path) as old_file:
- for line in old_file:
- new_file.write(line.replace(pattern, subst))
- #Remove original file
- remove(file_path)
- #Move new file
- move(abs_path, file_path)
def _parse_onlineRepos(url, ext=''):
logger.debug("parsing github or gitlab or http(s)")
@@ -276,14 +264,6 @@ def iitc(bot, event, *args):
plugins.append(plugin_objects["url"])
else:
plugins = ''
-
- #iitc render fix
- r = requests.get('https://secure.jonatkins.com/iitc/release/total-conversion-build.user.js', stream=True)
- with open('hangupsbot/plugins/intel_screenbot/total-conversion-build.user.js', 'wb') as f:
- for chunk in r.iter_content(chunk_size=1024):
- if chunk: # filter out keep-alive new chunks
- f.write(chunk)
- _replace('hangupsbot/plugins/intel_screenbot/total-conversion-build.user.js', '//L_PREFER_CANVAS = false;', 'L_PREFER_CANVAS = true;')
try:
loop = asyncio.get_event_loop()