From de805696e24f3c68b1e9baf57ea3fa4f01cde749 Mon Sep 17 00:00:00 2001 From: Nichlas Severinsen Date: Sat, 7 Jul 2018 11:12:05 +0200 Subject: [PATCH] Weird bug --- .gitignore | 1 + libray/core.py | 3 +++ libray/ird.py | 6 +++--- requirements.txt | 4 +++- setup.py | 6 +++++- 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 33a1a67..a04272c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ *.iso *.ird +*.gz # Byte-compiled / optimized / DLL files __pycache__/ diff --git a/libray/core.py b/libray/core.py index 4e08801..c1c6e2b 100644 --- a/libray/core.py +++ b/libray/core.py @@ -20,6 +20,9 @@ import os import sys +import requests +from bs4 import BeautifulSoup + try: from libray import iso diff --git a/libray/ird.py b/libray/ird.py index b64103c..6b1c4fd 100644 --- a/libray/ird.py +++ b/libray/ird.py @@ -110,13 +110,13 @@ class IRD: with open(filename, 'rb') as input_ird: if input_ird.read(4) != self.MAGIC_STRING: uncompress = True - + if uncompress: with gzip.open(filename, 'rb') as gzfile: with open(self.TEMP_FILE, 'wb') as tmpfile: tmpfile.write(gzfile.read()) - else: - shutil.copyfile(filename, self.TEMP_FILE) + + shutil.copyfile(filename, self.TEMP_FILE) diff --git a/requirements.txt b/requirements.txt index d033bb0..f8fe951 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,3 @@ -pycrypto==2.6.1 \ No newline at end of file +pycrypto==2.6.1 +requests==2.19.1 +beautifulsoup4==4.6.0 \ No newline at end of file diff --git a/setup.py b/setup.py index 2b72a64..9db9e0a 100755 --- a/setup.py +++ b/setup.py @@ -12,5 +12,9 @@ setup( url="https://notabug.org/necklace/libray", packages=['libray'], scripts=['libray/libray'], - install_requires=['pycrypto==2.6.1'], + install_requires=[ + 'pycrypto==2.6.1', + 'requests==2.19.1', + 'beautifulsoup4==4.6.0' + ], ) \ No newline at end of file