diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2012-01-03 20:41:23 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2012-01-03 20:41:23 +0100 |
commit | 4a3a81b63cd85cc3dcd9669868a2079da65838a2 (patch) | |
tree | fab8d99437bfc8d0fbd9deba18aa2da0f61aaae4 /module/threads | |
parent | update mediafire, easybytez (diff) | |
download | pyload-4a3a81b63cd85cc3dcd9669868a2079da65838a2.tar.xz |
fixes for old style decrypter
Diffstat (limited to 'module/threads')
-rw-r--r-- | module/threads/BaseThread.py | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/module/threads/BaseThread.py b/module/threads/BaseThread.py index 1ba3f7a9f..f4885aadc 100644 --- a/module/threads/BaseThread.py +++ b/module/threads/BaseThread.py @@ -12,7 +12,7 @@ from types import MethodType from pprint import pformat from traceback import format_exc -from module.utils.fs import listdir, join, save_join, stat +from module.utils.fs import listdir, join, save_join, stat, exists class BaseThread(Thread): """abstract base class for thread types""" @@ -37,17 +37,22 @@ class BaseThread(Thread): zip = zipfile.ZipFile(dump_name, "w") - for f in listdir(join("tmp", name)): - try: - # avoid encoding errors - zip.write(join("tmp", name, f), save_join(name, f)) - except: - pass + if exists(join("tmp", name)): + for f in listdir(join("tmp", name)): + try: + # avoid encoding errors + zip.write(join("tmp", name, f), save_join(name, f)) + except: + pass info = zipfile.ZipInfo(save_join(name, "debug_Report.txt"), gmtime()) info.external_attr = 0644 << 16L # change permissions - zip.writestr(info, dump) + + info = zipfile.ZipInfo(save_join(name, "system_Report.txt"), gmtime()) + info.external_attr = 0644 << 16L + zip.writestr(info, self.getSystemDump()) + zip.close() if not stat(dump_name).st_size: |