summaryrefslogtreecommitdiffstats
path: root/module/plugins/internal
diff options
context:
space:
mode:
authorGravatar Pedro Algarvio <pedro@algarvio.me> 2012-01-22 18:03:08 +0100
committerGravatar Pedro Algarvio <pedro@algarvio.me> 2012-01-22 18:03:08 +0100
commite6d6b36e73b3247b072a171c7e3cab67db9c62cb (patch)
tree08065eafb2b78d0310e329243f510548807e0fec /module/plugins/internal
parentMerge branches. (diff)
parentremoved some fs_decode functions (diff)
downloadpyload-e6d6b36e73b3247b072a171c7e3cab67db9c62cb.tar.xz
Merge branches.
Diffstat (limited to 'module/plugins/internal')
-rw-r--r--module/plugins/internal/UnRar.py17
1 files changed, 8 insertions, 9 deletions
diff --git a/module/plugins/internal/UnRar.py b/module/plugins/internal/UnRar.py
index b3c2fe6af..a315fbea3 100644
--- a/module/plugins/internal/UnRar.py
+++ b/module/plugins/internal/UnRar.py
@@ -22,7 +22,7 @@ import re
from glob import glob
from subprocess import Popen, PIPE
-from module.utils.fs import save_join, decode, fs_decode, fs_encode
+from module.utils.fs import save_join, decode, fs_encode
from module.plugins.internal.AbstractExtractor import AbtractExtractor, WrongPassword, ArchiveError, CRCError
class UnRar(AbtractExtractor):
@@ -38,7 +38,7 @@ class UnRar(AbtractExtractor):
@staticmethod
def checkDeps():
if os.name == "nt":
- UnRar.CMD = safe_join(pypath, "UnRAR.exe")
+ UnRar.CMD = save_join(pypath, "UnRAR.exe")
p = Popen([UnRar.CMD], stdout=PIPE, stderr=PIPE)
p.communicate()
else:
@@ -65,9 +65,9 @@ class UnRar(AbtractExtractor):
if match:
#only add first parts
if int(match[0][1]) == 1:
- result.append((fs_decode(file), id))
+ result.append((file, id))
else:
- result.append((fs_decode(file), id))
+ result.append((file, id))
return result
@@ -134,9 +134,9 @@ class UnRar(AbtractExtractor):
def getDeleteFiles(self):
- if ".part" in fs_encode(self.file):
- return glob(re.sub("(?<=\.part)([01]+)", "*", fs_decode(self.file), re.IGNORECASE))
- return [fs_decode(self.file)]
+ if ".part" in self.file:
+ return glob(re.sub("(?<=\.part)([01]+)", "*", self.file, re.IGNORECASE))
+ return [self.file]
def listContent(self):
command = "vb" if self.fullpath else "lb"
@@ -175,7 +175,7 @@ class UnRar(AbtractExtractor):
#NOTE: return codes are not reliable, some kind of threading, cleanup whatever issue
call = [self.CMD, command] + args + list(xargs)
- self.m.logDebug(" ".join([decode(a) for a in call]))
+ self.m.logDebug(" ".join([decode(arg) for arg in call]))
p = Popen(call, stdout=PIPE, stderr=PIPE)
@@ -188,4 +188,3 @@ def renice(pid, value):
Popen(["renice", str(value), str(pid)], stdout=PIPE, stderr=PIPE, bufsize=-1)
except:
print "Renice failed"
-