summaryrefslogtreecommitdiffstats
path: root/module/plugins/hooks/MergeFiles.py
diff options
context:
space:
mode:
authorGravatar Stefano <l.stickell@yahoo.it> 2013-07-24 14:24:51 +0200
committerGravatar Stefano <l.stickell@yahoo.it> 2013-07-24 14:24:51 +0200
commit669b1e0ec048e1ed8aeb842b2570376e9ad96863 (patch)
tree4703826f0c65f84ec5e9f1bac2d9dbd50e3376fa /module/plugins/hooks/MergeFiles.py
parentDebridItaliaCom: two more hosters supported (diff)
downloadpyload-669b1e0ec048e1ed8aeb842b2570376e9ad96863.tar.xz
Fixed PEP 8 violations in Hooks
Diffstat (limited to 'module/plugins/hooks/MergeFiles.py')
-rw-r--r--module/plugins/hooks/MergeFiles.py18
1 files changed, 7 insertions, 11 deletions
diff --git a/module/plugins/hooks/MergeFiles.py b/module/plugins/hooks/MergeFiles.py
index 613e6575a..060dae7a2 100644
--- a/module/plugins/hooks/MergeFiles.py
+++ b/module/plugins/hooks/MergeFiles.py
@@ -19,7 +19,6 @@
import os
import re
-import sys
import traceback
from os.path import join
@@ -28,13 +27,12 @@ from module.plugins.Hook import Hook
BUFFER_SIZE = 4096
+
class MergeFiles(Hook):
__name__ = "MergeFiles"
__version__ = "0.11"
__description__ = "Merges parts splitted with hjsplit"
- __config__ = [
- ("activated" , "bool" , "Activated" , "False"),
- ]
+ __config__ = [("activated", "bool", "Activated", "False")]
__threaded__ = ["packageFinished"]
__author_name__ = ("and9000")
__author_mail__ = ("me@has-no-mail.com")
@@ -42,7 +40,7 @@ class MergeFiles(Hook):
def setup(self):
# nothing to do
pass
-
+
def packageFinished(self, pack):
files = {}
fid_dict = {}
@@ -53,9 +51,9 @@ class MergeFiles(Hook):
files[data["name"][:-4]].append(data["name"])
files[data["name"][:-4]].sort()
fid_dict[data["name"]] = fid
-
+
download_folder = self.core.config['general']['download_folder']
-
+
if self.core.config['general']['folder_per_package']:
download_folder = save_join(download_folder, pack.folder)
@@ -76,7 +74,7 @@ class MergeFiles(Hook):
if f_buffer:
final_file.write(f_buffer)
size_written += BUFFER_SIZE
- pyfile.setProgress((size_written*100)/s_file_size)
+ pyfile.setProgress((size_written * 100) / s_file_size)
else:
break
s_file.close()
@@ -87,8 +85,6 @@ class MergeFiles(Hook):
pyfile.setProgress(100)
pyfile.setStatus("finished")
pyfile.release()
-
+
final_file.close()
self.logInfo("Finished merging of %s" % name)
-
-