summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Armin <Armin@Armin-PC.diedering.lan> 2015-04-22 00:00:13 +0200
committerGravatar Armin <Armin@Armin-PC.diedering.lan> 2015-04-22 00:00:13 +0200
commit22d531c192d4b2b3159788d514377c43f8fdde6b (patch)
tree607d6023bc0e1068415aceefdf54fb611ac30b47
parentsome fixes (diff)
downloadpyload-22d531c192d4b2b3159788d514377c43f8fdde6b.tar.xz
now the plugin attribute '__name' is no more used it is reduntant and
obsolete
-rw-r--r--pyload/plugin/Extractor.py6
-rw-r--r--pyload/plugin/addon/ExtractArchive.py2
-rw-r--r--pyload/plugin/extractor/SevenZip.py5
-rw-r--r--pyload/plugin/extractor/UnRar.py21
-rw-r--r--pyload/plugin/extractor/UnZip.py3
5 files changed, 18 insertions, 19 deletions
diff --git a/pyload/plugin/Extractor.py b/pyload/plugin/Extractor.py
index e50ab8818..539ab624d 100644
--- a/pyload/plugin/Extractor.py
+++ b/pyload/plugin/Extractor.py
@@ -31,16 +31,12 @@ class Extractor:
EXTENSIONS = []
+ NAME = __name__
VERSION = ""
REPAIR = False
@classmethod
- def NAME(self):
- return getattr(self, "_" + self.__name__ + "__name")
-
-
- @classmethod
def isArchive(cls, filename):
name = os.path.basename(filename).lower()
return any(name.endswith(ext) for ext in cls.EXTENSIONS)
diff --git a/pyload/plugin/addon/ExtractArchive.py b/pyload/plugin/addon/ExtractArchive.py
index b0a24446a..616334af2 100644
--- a/pyload/plugin/addon/ExtractArchive.py
+++ b/pyload/plugin/addon/ExtractArchive.py
@@ -186,7 +186,7 @@ class ExtractArchive(Addon):
traceback.print_exc()
if self.extractors:
- self.logDebug(*["Found %s %s" % (Extractor.NAME(), Extractor.VERSION) for Extractor in self.extractors])
+ self.logDebug(*["Found %s %s" % (Extractor.NAME, Extractor.VERSION) for Extractor in self.extractors])
self.extractQueued() #: Resume unfinished extractions
else:
self.logInfo(_("No Extract plugins activated"))
diff --git a/pyload/plugin/extractor/SevenZip.py b/pyload/plugin/extractor/SevenZip.py
index 3c5e86602..587db5563 100644
--- a/pyload/plugin/extractor/SevenZip.py
+++ b/pyload/plugin/extractor/SevenZip.py
@@ -15,11 +15,12 @@ class SevenZip(UnRar):
__description = """7-Zip extractor plugin"""
__license = "GPLv3"
- __authors = [("Michael Nowak" , "" ),
- ("Walter Purcaro", "vuolter@gmail.com")]
+ __authors = [("Michael Nowak" , ""),
+ ("Walter Purcaro", "vuolter@gmail.com")]
CMD = "7z"
+ NAME = __name__
VERSION = ""
EXTENSIONS = [".7z", ".xz", ".zip", ".gz", ".gzip", ".tgz", ".bz2", ".bzip2",
diff --git a/pyload/plugin/extractor/UnRar.py b/pyload/plugin/extractor/UnRar.py
index 38ae4e8f2..d1fc3728e 100644
--- a/pyload/plugin/extractor/UnRar.py
+++ b/pyload/plugin/extractor/UnRar.py
@@ -27,20 +27,21 @@ class UnRar(Extractor):
__description = """Rar extractor plugin"""
__license = "GPLv3"
- __authors = [("RaNaN" , "RaNaN@pyload.org" ),
- ("Walter Purcaro", "vuolter@gmail.com"),
- ("Immenz" , "immenz@gmx.net" )]
+ __authors = [("RaNaN", "RaNaN@pyload.org"),
+ ("Walter Purcaro", "vuolter@gmail.com"),
+ ("Immenz", "immenz@gmx.net")]
- CMD = "unrar"
- VERSION = ""
+ CMD = "unrar"
+ NAME = __name__
+ VERSION = ""
EXTENSIONS = [".rar"]
- re_multipart = re.compile(r'\.(part|r)(\d+)(?:\.rar)?(\.rev|\.bad)?',re.I)
+ re_multipart = re.compile(r'\.(part|r)(\d+)(?:\.rar)?(\.rev|\.bad)?', re.I)
re_filefixed = re.compile(r'Building (.+)')
- re_filelist = re.compile(r'^(.)(\s*[\w\.\-]+)\s+(\d+\s+)+(?:\d+\%\s+)?[\d\-]{8}\s+[\d\:]{5}', re.M|re.I)
+ re_filelist = re.compile(r'^(.)(\s*[\w\.\-]+)\s+(\d+\s+)+(?:\d+\%\s+)?[\d\-]{8}\s+[\d\:]{5}', re.M | re.I)
re_wrongpwd = re.compile(r'password', re.I)
re_wrongcrc = re.compile(r'encrypted|damaged|CRC failed|checksum error|corrupt', re.I)
@@ -55,7 +56,7 @@ class UnRar(Extractor):
cls.CMD = os.path.join(pypath, "RAR.exe")
p = subprocess.Popen([cls.CMD], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out, err = p.communicate()
- cls.__name = "RAR"
+ cls.NAME = "RAR"
cls.REPAIR = True
except OSError:
@@ -66,7 +67,7 @@ class UnRar(Extractor):
try:
p = subprocess.Popen(["rar"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out, err = p.communicate()
- cls.__name = "RAR"
+ cls.NAME = "RAR"
cls.REPAIR = True
except OSError: #: fallback to unrar
@@ -177,7 +178,7 @@ class UnRar(Extractor):
# eventually Multipart Files
files.extend(fs_join(dir, os.path.basename(file)) for file in filter(self.isMultipart, os.listdir(dir))
- if re.sub(self.re_multipart,".rar",name) == re.sub(self.re_multipart,".rar",file))
+ if re.sub(self.re_multipart, ".rar", name) == re.sub(self.re_multipart, ".rar", file))
return files
diff --git a/pyload/plugin/extractor/UnZip.py b/pyload/plugin/extractor/UnZip.py
index b4fa637f0..f5cbe9402 100644
--- a/pyload/plugin/extractor/UnZip.py
+++ b/pyload/plugin/extractor/UnZip.py
@@ -21,7 +21,8 @@ class UnZip(Extractor):
EXTENSIONS = [".zip", ".zip64"]
- VERSION ="(python %s.%s.%s)" % (sys.version_info[0], sys.version_info[1], sys.version_info[2])
+ NAME = __name__
+ VERSION = "(python %s.%s.%s)" % (sys.version_info[0], sys.version_info[1], sys.version_info[2])
@classmethod