From 6637b832d74e0cf1fb96a1731daeb5832ea31822 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 2 Jun 2015 01:10:08 +0200 Subject: [SimpleCrypter] Update --- module/plugins/internal/Extractor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/internal/Extractor.py') diff --git a/module/plugins/internal/Extractor.py b/module/plugins/internal/Extractor.py index 159b65ffe..1a98060d9 100644 --- a/module/plugins/internal/Extractor.py +++ b/module/plugins/internal/Extractor.py @@ -29,8 +29,8 @@ class Extractor: EXTENSIONS = [] - VERSION = "" REPAIR = False + VERSION = "" @classmethod -- cgit v1.2.3 From d99d6eddb6af637580bb6fc72013f913077525d6 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 17 Jun 2015 11:23:08 +0200 Subject: Spare fixes --- module/plugins/internal/Extractor.py | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) (limited to 'module/plugins/internal/Extractor.py') diff --git a/module/plugins/internal/Extractor.py b/module/plugins/internal/Extractor.py index 1a98060d9..2aa26e64a 100644 --- a/module/plugins/internal/Extractor.py +++ b/module/plugins/internal/Extractor.py @@ -4,6 +4,7 @@ import os import re from module.PyFile import PyFile +from module.plugins.internal.Plugin import Plugin class ArchiveError(Exception): @@ -18,8 +19,9 @@ class PasswordError(Exception): pass -class Extractor: +class Extractor(Plugin): __name__ = "Extractor" + __type__ = "extractor" __version__ = "0.24" __description__ = """Base extractor plugin""" @@ -46,7 +48,8 @@ class Extractor: @classmethod def isUsable(cls): - """ Check if system statisfy dependencies + """ + Check if system statisfy dependencies :return: boolean """ return None @@ -54,7 +57,8 @@ class Extractor: @classmethod def getTargets(cls, files_ids): - """ Filter suited targets from list of filename id tuple list + """ + Filter suited targets from list of filename id tuple list :param files_ids: List of filepathes :return: List of targets, id tuple list """ @@ -78,7 +82,7 @@ class Extractor: delete='No', keepbroken=False, fid=None): - """ Initialize extractor for specific file """ + """Initialize extractor for specific file""" self.manager = manager self.filename = filename self.out = out @@ -95,12 +99,13 @@ class Extractor: def init(self): - """ Initialize additional data structures """ + """Initialize additional data structures""" pass def check(self): - """Quick Check by listing content of archive. + """ + Quick Check by listing content of archive. Raises error if password is needed, integrity is questionable or else. :raises PasswordError @@ -109,8 +114,10 @@ class Extractor: """ raise NotImplementedError + def verify(self): - """Testing with Extractors buildt-in method + """ + Testing with Extractors buildt-in method Raises error if password is needed, integrity is questionable or else. :raises PasswordError @@ -125,7 +132,8 @@ class Extractor: def extract(self, password=None): - """Extract the archive. Raise specific errors in case of failure. + """ + Extract the archive. Raise specific errors in case of failure. :param progress: Progress function, call this to update status :param password password to use @@ -138,7 +146,8 @@ class Extractor: def getDeleteFiles(self): - """Return list of files to delete, do *not* delete them here. + """ + Return list of files to delete, do *not* delete them here. :return: List with paths of files to delete """ -- cgit v1.2.3 From 164512b6a74c94a731fcee7435dce1ccfa2f71e7 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 17 Jun 2015 18:29:50 +0200 Subject: Spare code cosmetics --- module/plugins/internal/Extractor.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'module/plugins/internal/Extractor.py') diff --git a/module/plugins/internal/Extractor.py b/module/plugins/internal/Extractor.py index 2aa26e64a..f73388d8c 100644 --- a/module/plugins/internal/Extractor.py +++ b/module/plugins/internal/Extractor.py @@ -82,7 +82,9 @@ class Extractor(Plugin): delete='No', keepbroken=False, fid=None): - """Initialize extractor for specific file""" + """ + Initialize extractor for specific file + """ self.manager = manager self.filename = filename self.out = out @@ -99,7 +101,9 @@ class Extractor(Plugin): def init(self): - """Initialize additional data structures""" + """ + Initialize additional data structures + """ pass @@ -155,5 +159,7 @@ class Extractor(Plugin): def list(self, password=None): - """Populate self.files at some point while extracting""" + """ + Populate self.files at some point while extracting + """ return self.files -- cgit v1.2.3 From b1759bc440cd6013837697eb8de540914f693ffd Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 7 Jul 2015 01:23:55 +0200 Subject: No camelCase style anymore --- module/plugins/internal/Extractor.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'module/plugins/internal/Extractor.py') diff --git a/module/plugins/internal/Extractor.py b/module/plugins/internal/Extractor.py index f73388d8c..60d8b3b3b 100644 --- a/module/plugins/internal/Extractor.py +++ b/module/plugins/internal/Extractor.py @@ -22,7 +22,7 @@ class PasswordError(Exception): class Extractor(Plugin): __name__ = "Extractor" __type__ = "extractor" - __version__ = "0.24" + __version__ = "0.25" __description__ = """Base extractor plugin""" __license__ = "GPLv3" @@ -36,18 +36,18 @@ class Extractor(Plugin): @classmethod - def isArchive(cls, filename): + def is_archive(cls, filename): name = os.path.basename(filename).lower() return any(name.endswith(ext) for ext in cls.EXTENSIONS) @classmethod - def isMultipart(cls, filename): + def is_multipart(cls, filename): return False @classmethod - def isUsable(cls): + def is_usable(cls): """ Check if system statisfy dependencies :return: boolean @@ -56,7 +56,7 @@ class Extractor(Plugin): @classmethod - def getTargets(cls, files_ids): + def get_targets(cls, files_ids): """ Filter suited targets from list of filename id tuple list :param files_ids: List of filepathes @@ -97,7 +97,7 @@ class Extractor(Plugin): self.files = [] #: Store extracted files here pyfile = self.manager.core.files.getFile(fid) if fid else None - self.notifyProgress = lambda x: pyfile.setProgress(x) if pyfile else lambda x: None + self.notify_progress = lambda x: pyfile.setProgress(x) if pyfile else lambda x: None def init(self): @@ -149,7 +149,7 @@ class Extractor(Plugin): raise NotImplementedError - def getDeleteFiles(self): + def get_delete_files(self): """ Return list of files to delete, do *not* delete them here. -- cgit v1.2.3 From 502517f37c7540b0bddb092e69386d9d6f08800c Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 19 Jul 2015 09:42:34 +0200 Subject: Fix addons --- module/plugins/internal/Extractor.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'module/plugins/internal/Extractor.py') diff --git a/module/plugins/internal/Extractor.py b/module/plugins/internal/Extractor.py index 60d8b3b3b..929ef5378 100644 --- a/module/plugins/internal/Extractor.py +++ b/module/plugins/internal/Extractor.py @@ -99,6 +99,8 @@ class Extractor(Plugin): pyfile = self.manager.core.files.getFile(fid) if fid else None self.notify_progress = lambda x: pyfile.setProgress(x) if pyfile else lambda x: None + self.init() + def init(self): """ -- cgit v1.2.3 From ff9383bfe06d14d23bc0ed6af79aa8967965d078 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 19 Jul 2015 10:59:52 +0200 Subject: Code cosmetics (3) --- module/plugins/internal/Extractor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/internal/Extractor.py') diff --git a/module/plugins/internal/Extractor.py b/module/plugins/internal/Extractor.py index 929ef5378..39220508e 100644 --- a/module/plugins/internal/Extractor.py +++ b/module/plugins/internal/Extractor.py @@ -67,7 +67,7 @@ class Extractor(Plugin): for fname, id, fout in files_ids: if cls.isArchive(fname): - pname = re.sub(cls.re_multipart, '', fname) if cls.isMultipart(fname) else os.path.splitext(fname)[0] + pname = re.sub(cls.re_multipart, "", fname) if cls.isMultipart(fname) else os.path.splitext(fname)[0] if pname not in processed: processed.append(pname) targets.append((fname, id, fout)) -- cgit v1.2.3 From 56389e28ba5d2f5658278bc7f486d73be747f135 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 19 Jul 2015 11:44:49 +0200 Subject: Rename self.core to self.pyload (plugins only) --- module/plugins/internal/Extractor.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'module/plugins/internal/Extractor.py') diff --git a/module/plugins/internal/Extractor.py b/module/plugins/internal/Extractor.py index 39220508e..97c2c63b1 100644 --- a/module/plugins/internal/Extractor.py +++ b/module/plugins/internal/Extractor.py @@ -85,7 +85,9 @@ class Extractor(Plugin): """ Initialize extractor for specific file """ - self.manager = manager + self.pyload = manager.core + self.info = {} #: Provide information in dict here + self.filename = filename self.out = out self.fullpath = fullpath @@ -96,7 +98,7 @@ class Extractor(Plugin): self.keepbroken = keepbroken self.files = [] #: Store extracted files here - pyfile = self.manager.core.files.getFile(fid) if fid else None + pyfile = self.pyload.files.getFile(fid) if fid else None self.notify_progress = lambda x: pyfile.setProgress(x) if pyfile else lambda x: None self.init() -- cgit v1.2.3 From d38e830b7c0b3c6561a0072c74bbccb5fcdf4a61 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 19 Jul 2015 14:43:42 +0200 Subject: New __status__ magic key --- module/plugins/internal/Extractor.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/internal/Extractor.py') diff --git a/module/plugins/internal/Extractor.py b/module/plugins/internal/Extractor.py index 97c2c63b1..e1fb2332d 100644 --- a/module/plugins/internal/Extractor.py +++ b/module/plugins/internal/Extractor.py @@ -23,6 +23,7 @@ class Extractor(Plugin): __name__ = "Extractor" __type__ = "extractor" __version__ = "0.25" + __status__ = "stable" __description__ = """Base extractor plugin""" __license__ = "GPLv3" -- cgit v1.2.3 From c2091ebec0ce394ec847f82db9bbaddc150d5fca Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 21 Jul 2015 22:55:54 +0200 Subject: [Extractor] is_usable -> find --- module/plugins/internal/Extractor.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/internal/Extractor.py') diff --git a/module/plugins/internal/Extractor.py b/module/plugins/internal/Extractor.py index e1fb2332d..3d2859f54 100644 --- a/module/plugins/internal/Extractor.py +++ b/module/plugins/internal/Extractor.py @@ -22,7 +22,7 @@ class PasswordError(Exception): class Extractor(Plugin): __name__ = "Extractor" __type__ = "extractor" - __version__ = "0.25" + __version__ = "0.26" __status__ = "stable" __description__ = """Base extractor plugin""" @@ -48,12 +48,12 @@ class Extractor(Plugin): @classmethod - def is_usable(cls): + def find(cls): """ Check if system statisfy dependencies :return: boolean """ - return None + pass @classmethod -- cgit v1.2.3 From 12cbb11279ebfa2f2945c5adb093b97924a8cfc3 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 24 Jul 2015 00:33:19 +0200 Subject: Small __init__ fixes --- module/plugins/internal/Extractor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/internal/Extractor.py') diff --git a/module/plugins/internal/Extractor.py b/module/plugins/internal/Extractor.py index 3d2859f54..7189ddc25 100644 --- a/module/plugins/internal/Extractor.py +++ b/module/plugins/internal/Extractor.py @@ -75,7 +75,7 @@ class Extractor(Plugin): return targets - def __init__(self, manager, filename, out, + def __init__(self, plugin, filename, out, fullpath=True, overwrite=False, excludefiles=[], @@ -86,7 +86,7 @@ class Extractor(Plugin): """ Initialize extractor for specific file """ - self.pyload = manager.core + self.pyload = plugin.pyload self.info = {} #: Provide information in dict here self.filename = filename -- cgit v1.2.3 From 94d017cd2a5c1f194960827a8c7e46afc3682008 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 24 Jul 2015 06:55:49 +0200 Subject: Hotfixes (2) --- module/plugins/internal/Extractor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/internal/Extractor.py') diff --git a/module/plugins/internal/Extractor.py b/module/plugins/internal/Extractor.py index 7189ddc25..668207ea3 100644 --- a/module/plugins/internal/Extractor.py +++ b/module/plugins/internal/Extractor.py @@ -23,7 +23,7 @@ class Extractor(Plugin): __name__ = "Extractor" __type__ = "extractor" __version__ = "0.26" - __status__ = "stable" + __status__ = "testing" __description__ = """Base extractor plugin""" __license__ = "GPLv3" -- cgit v1.2.3 From f83389333ec10376452aa5f6d5ccd3963c6bafa1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 27 Jul 2015 10:28:30 +0200 Subject: Update internal plugins --- module/plugins/internal/Extractor.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'module/plugins/internal/Extractor.py') diff --git a/module/plugins/internal/Extractor.py b/module/plugins/internal/Extractor.py index 668207ea3..cf9a1f6e3 100644 --- a/module/plugins/internal/Extractor.py +++ b/module/plugins/internal/Extractor.py @@ -22,7 +22,7 @@ class PasswordError(Exception): class Extractor(Plugin): __name__ = "Extractor" __type__ = "extractor" - __version__ = "0.26" + __version__ = "0.27" __status__ = "testing" __description__ = """Base extractor plugin""" @@ -87,6 +87,7 @@ class Extractor(Plugin): Initialize extractor for specific file """ self.pyload = plugin.pyload + self.plugin = plugin self.info = {} #: Provide information in dict here self.filename = filename @@ -112,6 +113,10 @@ class Extractor(Plugin): pass + def _log(self, level, args): + return self.plugin._log(level, (self.__name__,) + args) + + def check(self): """ Quick Check by listing content of archive. -- cgit v1.2.3 From ecf37227de05c73b7ffe2da89a5eda1259a72543 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 28 Jul 2015 01:09:59 +0200 Subject: Improve _log method --- module/plugins/internal/Extractor.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/internal/Extractor.py') diff --git a/module/plugins/internal/Extractor.py b/module/plugins/internal/Extractor.py index cf9a1f6e3..cbfae5a4d 100644 --- a/module/plugins/internal/Extractor.py +++ b/module/plugins/internal/Extractor.py @@ -22,7 +22,7 @@ class PasswordError(Exception): class Extractor(Plugin): __name__ = "Extractor" __type__ = "extractor" - __version__ = "0.27" + __version__ = "0.28" __status__ = "testing" __description__ = """Base extractor plugin""" @@ -113,8 +113,8 @@ class Extractor(Plugin): pass - def _log(self, level, args): - return self.plugin._log(level, (self.__name__,) + args) + def _log(self, level, plugintype, pluginname, messages): + return self.plugin._log(level, plugintype, pluginname, (self.__name__,) + messages) def check(self): -- cgit v1.2.3 From 5a2781c923ecd13f3e671366fa6fa311d92d8547 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 29 Jul 2015 08:21:04 +0200 Subject: Fix https://github.com/pyload/pyload/issues/1586 --- module/plugins/internal/Extractor.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'module/plugins/internal/Extractor.py') diff --git a/module/plugins/internal/Extractor.py b/module/plugins/internal/Extractor.py index cbfae5a4d..907113a7e 100644 --- a/module/plugins/internal/Extractor.py +++ b/module/plugins/internal/Extractor.py @@ -22,7 +22,7 @@ class PasswordError(Exception): class Extractor(Plugin): __name__ = "Extractor" __type__ = "extractor" - __version__ = "0.28" + __version__ = "0.29" __status__ = "testing" __description__ = """Base extractor plugin""" @@ -33,7 +33,7 @@ class Extractor(Plugin): EXTENSIONS = [] REPAIR = False - VERSION = "" + VERSION = None @classmethod @@ -114,7 +114,10 @@ class Extractor(Plugin): def _log(self, level, plugintype, pluginname, messages): - return self.plugin._log(level, plugintype, pluginname, (self.__name__,) + messages) + return self.plugin._log(level, + plugintype, + "%s: %s" % (self.plugin.__name__, self.__name__), + messages) def check(self): -- cgit v1.2.3 From 66d5610dff9b7a5e56075e195f88dc0f60441e72 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 29 Jul 2015 12:37:00 +0200 Subject: Fix https://github.com/pyload/pyload/issues/1594 --- module/plugins/internal/Extractor.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/internal/Extractor.py') diff --git a/module/plugins/internal/Extractor.py b/module/plugins/internal/Extractor.py index 907113a7e..d511b7602 100644 --- a/module/plugins/internal/Extractor.py +++ b/module/plugins/internal/Extractor.py @@ -22,7 +22,7 @@ class PasswordError(Exception): class Extractor(Plugin): __name__ = "Extractor" __type__ = "extractor" - __version__ = "0.29" + __version__ = "0.30" __status__ = "testing" __description__ = """Base extractor plugin""" @@ -67,8 +67,8 @@ class Extractor(Plugin): processed = [] for fname, id, fout in files_ids: - if cls.isArchive(fname): - pname = re.sub(cls.re_multipart, "", fname) if cls.isMultipart(fname) else os.path.splitext(fname)[0] + if cls.is_archive(fname): + pname = re.sub(cls.re_multipart, "", fname) if cls.is_multipart(fname) else os.path.splitext(fname)[0] if pname not in processed: processed.append(pname) targets.append((fname, id, fout)) -- cgit v1.2.3 From 91e0803c1f47444072ca7381d789a8e98160ae78 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 29 Jul 2015 21:11:29 +0200 Subject: Still improving _log methods --- module/plugins/internal/Extractor.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/internal/Extractor.py') diff --git a/module/plugins/internal/Extractor.py b/module/plugins/internal/Extractor.py index d511b7602..c16b1a846 100644 --- a/module/plugins/internal/Extractor.py +++ b/module/plugins/internal/Extractor.py @@ -22,7 +22,7 @@ class PasswordError(Exception): class Extractor(Plugin): __name__ = "Extractor" __type__ = "extractor" - __version__ = "0.30" + __version__ = "0.31" __status__ = "testing" __description__ = """Base extractor plugin""" @@ -116,8 +116,8 @@ class Extractor(Plugin): def _log(self, level, plugintype, pluginname, messages): return self.plugin._log(level, plugintype, - "%s: %s" % (self.plugin.__name__, self.__name__), - messages) + self.plugin.__name__, + (self.__name__,) + messages) def check(self): -- cgit v1.2.3 From 84f2193d76f7c6f47c834dc8902d8ead8e45a11a Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 2 Aug 2015 07:44:07 +0200 Subject: Fix https://github.com/pyload/pyload/issues/1640 (2) --- module/plugins/internal/Extractor.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'module/plugins/internal/Extractor.py') diff --git a/module/plugins/internal/Extractor.py b/module/plugins/internal/Extractor.py index c16b1a846..7d1f9ced5 100644 --- a/module/plugins/internal/Extractor.py +++ b/module/plugins/internal/Extractor.py @@ -22,7 +22,7 @@ class PasswordError(Exception): class Extractor(Plugin): __name__ = "Extractor" __type__ = "extractor" - __version__ = "0.31" + __version__ = "0.32" __status__ = "testing" __description__ = """Base extractor plugin""" @@ -86,9 +86,7 @@ class Extractor(Plugin): """ Initialize extractor for specific file """ - self.pyload = plugin.pyload - self.plugin = plugin - self.info = {} #: Provide information in dict here + self._init(plugin.pyload) self.filename = filename self.out = out -- cgit v1.2.3 From fd2b928c08f0e1d1c54096696ef75bf899557db8 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 2 Aug 2015 08:56:00 +0200 Subject: Fix https://github.com/pyload/pyload/issues/1649 --- module/plugins/internal/Extractor.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'module/plugins/internal/Extractor.py') diff --git a/module/plugins/internal/Extractor.py b/module/plugins/internal/Extractor.py index 7d1f9ced5..7f5212090 100644 --- a/module/plugins/internal/Extractor.py +++ b/module/plugins/internal/Extractor.py @@ -22,7 +22,7 @@ class PasswordError(Exception): class Extractor(Plugin): __name__ = "Extractor" __type__ = "extractor" - __version__ = "0.32" + __version__ = "0.33" __status__ = "testing" __description__ = """Base extractor plugin""" @@ -88,6 +88,7 @@ class Extractor(Plugin): """ self._init(plugin.pyload) + self.plugin = plugin self.filename = filename self.out = out self.fullpath = fullpath -- cgit v1.2.3