From 5a7b72bd128b026446edd57c5bd5c21d75935e80 Mon Sep 17 00:00:00 2001
From: RaNaN <Mast3rRaNaN@hotmail.de>
Date: Wed, 22 Sep 2010 19:54:00 +0200
Subject: win unrar fixes

---
 module/plugins/hooks/UnRar.py | 7 +++++++
 1 file changed, 7 insertions(+)

(limited to 'module/plugins')

diff --git a/module/plugins/hooks/UnRar.py b/module/plugins/hooks/UnRar.py
index 4f989e804..5d1dff1a5 100644
--- a/module/plugins/hooks/UnRar.py
+++ b/module/plugins/hooks/UnRar.py
@@ -22,6 +22,7 @@ import sys
 
 from module.plugins.Hook import Hook
 from module.pyunrar import Unrar, WrongPasswordError, CommandError, UnknownError
+from traceback import print_exc
 
 from os.path import exists, join
 from os import remove
@@ -118,6 +119,8 @@ class UnRar(Hook):
                 self.core.log.info("Unrar of %s failed (wrong password)" % fname)
                 continue
             except CommandError, e:
+                if self.core.debug:
+                    print_exc()
                 if re.search("Cannot find volume", e.stderr):
                     self.core.log.info("Unrar of %s failed (missing volume)" % fname)
                     continue
@@ -126,9 +129,13 @@ class UnRar(Hook):
                         self.core.log.info("Unrar of %s ok" % fname)
                         self.removeFiles(pack, fname)
                 except:
+                    if self.core.debug:
+                        print_exc()
                     self.core.log.info("Unrar of %s failed" % fname)
                     continue
             except UnknownError:
+                if self.core.debug:
+                    print_exc()
                 self.core.log.info("Unrar of %s failed" % fname)
                 continue
             else:
-- 
cgit v1.2.3