From 0e1ef9bc01579328e17e79416fa3c1c7b77adcc8 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 8 Jun 2015 06:08:01 +0200 Subject: Update everything --- module/plugins/hooks/UnSkipOnFail.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks/UnSkipOnFail.py') diff --git a/module/plugins/hooks/UnSkipOnFail.py b/module/plugins/hooks/UnSkipOnFail.py index 9059d0350..b9ae93fee 100644 --- a/module/plugins/hooks/UnSkipOnFail.py +++ b/module/plugins/hooks/UnSkipOnFail.py @@ -1,13 +1,13 @@ # -*- coding: utf-8 -*- from module.PyFile import PyFile -from module.plugins.Hook import Hook +from module.plugins.internal.Hook import Hook class UnSkipOnFail(Hook): __name__ = "UnSkipOnFail" __type__ = "hook" - __version__ = "0.07" + __version__ = "0.08" __config__ = [("activated", "bool", "Activated", True)] -- cgit v1.2.3 From 5a139055ae658d3a05cbb658cbd66aeae0d01db5 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 15 Jun 2015 21:06:10 +0200 Subject: Spare code cosmetics --- module/plugins/hooks/UnSkipOnFail.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hooks/UnSkipOnFail.py') diff --git a/module/plugins/hooks/UnSkipOnFail.py b/module/plugins/hooks/UnSkipOnFail.py index b9ae93fee..234e1052b 100644 --- a/module/plugins/hooks/UnSkipOnFail.py +++ b/module/plugins/hooks/UnSkipOnFail.py @@ -23,7 +23,7 @@ class UnSkipOnFail(Hook): self.info = {} #@TODO: Remove in 0.4.10 - def downloadFailed(self, pyfile): + def download_failed(self, pyfile): #: Check if pyfile is still "failed", # maybe might has been restarted in meantime if pyfile.status != 8: -- 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/hooks/UnSkipOnFail.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hooks/UnSkipOnFail.py') diff --git a/module/plugins/hooks/UnSkipOnFail.py b/module/plugins/hooks/UnSkipOnFail.py index 234e1052b..9ba53a698 100644 --- a/module/plugins/hooks/UnSkipOnFail.py +++ b/module/plugins/hooks/UnSkipOnFail.py @@ -55,7 +55,7 @@ class UnSkipOnFail(Hook): def findDuplicate(self, pyfile): - """ Search all packages for duplicate links to "pyfile". + """Search all packages for duplicate links to "pyfile". Duplicates are links that would overwrite "pyfile". To test on duplicity the package-folder and link-name of twolinks are compared (link.name). -- cgit v1.2.3 From 20b6a2ec022202b0efb6cb69415239fb8f4d1445 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 17 Jun 2015 18:59:20 +0200 Subject: Spare code cosmetics (2) --- module/plugins/hooks/UnSkipOnFail.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'module/plugins/hooks/UnSkipOnFail.py') diff --git a/module/plugins/hooks/UnSkipOnFail.py b/module/plugins/hooks/UnSkipOnFail.py index 9ba53a698..cbfbff1b6 100644 --- a/module/plugins/hooks/UnSkipOnFail.py +++ b/module/plugins/hooks/UnSkipOnFail.py @@ -24,8 +24,7 @@ class UnSkipOnFail(Hook): def download_failed(self, pyfile): - #: Check if pyfile is still "failed", - # maybe might has been restarted in meantime + #: Check if pyfile is still "failed", maybe might has been restarted in meantime if pyfile.status != 8: return @@ -36,13 +35,13 @@ class UnSkipOnFail(Hook): if link: self.logInfo(_("Queue found duplicate: %s (pid:%s)") % (link.name, link.packageID)) - #: Change status of "link" to "new_status". - # "link" has to be a valid FileData object, - # "new_status" has to be a valid status name - # (i.e. "queued" for this Plugin) - # It creates a temporary PyFile object using - # "link" data, changes its status, and tells - # the core.files-manager to save its data. + # Change status of "link" to "new_status". + # "link" has to be a valid FileData object, + # "new_status" has to be a valid status name + # (i.e. "queued" for this Plugin) + # It creates a temporary PyFile object using + # "link" data, changes its status, and tells + # the core.files-manager to save its data. pylink = self._pyfile(link) pylink.setCustomStatus(_("unskipped"), "queued") -- 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/hooks/UnSkipOnFail.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'module/plugins/hooks/UnSkipOnFail.py') diff --git a/module/plugins/hooks/UnSkipOnFail.py b/module/plugins/hooks/UnSkipOnFail.py index cbfbff1b6..4e1e60f61 100644 --- a/module/plugins/hooks/UnSkipOnFail.py +++ b/module/plugins/hooks/UnSkipOnFail.py @@ -7,7 +7,7 @@ from module.plugins.internal.Hook import Hook class UnSkipOnFail(Hook): __name__ = "UnSkipOnFail" __type__ = "hook" - __version__ = "0.08" + __version__ = "0.09" __config__ = [("activated", "bool", "Activated", True)] @@ -29,11 +29,11 @@ class UnSkipOnFail(Hook): return msg = _("Looking for skipped duplicates of: %s (pid:%s)") - self.logInfo(msg % (pyfile.name, pyfile.package().id)) + self.log_info(msg % (pyfile.name, pyfile.package().id)) - link = self.findDuplicate(pyfile) + link = self.find_duplicate(pyfile) if link: - self.logInfo(_("Queue found duplicate: %s (pid:%s)") % (link.name, link.packageID)) + self.log_info(_("Queue found duplicate: %s (pid:%s)") % (link.name, link.packageID)) # Change status of "link" to "new_status". # "link" has to be a valid FileData object, @@ -50,10 +50,10 @@ class UnSkipOnFail(Hook): pylink.release() else: - self.logInfo(_("No duplicates found")) + self.log_info(_("No duplicates found")) - def findDuplicate(self, pyfile): + def find_duplicate(self, pyfile): """Search all packages for duplicate links to "pyfile". Duplicates are links that would overwrite "pyfile". To test on duplicity the package-folder and link-name -- cgit v1.2.3 From dad722ac7255640e7e0541c4094a4d2e4de79cd3 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 19 Jul 2015 00:05:58 +0200 Subject: Code cosmetics (2) --- module/plugins/hooks/UnSkipOnFail.py | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'module/plugins/hooks/UnSkipOnFail.py') diff --git a/module/plugins/hooks/UnSkipOnFail.py b/module/plugins/hooks/UnSkipOnFail.py index 4e1e60f61..5507cd20f 100644 --- a/module/plugins/hooks/UnSkipOnFail.py +++ b/module/plugins/hooks/UnSkipOnFail.py @@ -35,13 +35,13 @@ class UnSkipOnFail(Hook): if link: self.log_info(_("Queue found duplicate: %s (pid:%s)") % (link.name, link.packageID)) - # Change status of "link" to "new_status". - # "link" has to be a valid FileData object, - # "new_status" has to be a valid status name - # (i.e. "queued" for this Plugin) - # It creates a temporary PyFile object using - # "link" data, changes its status, and tells - # the core.files-manager to save its data. + #: Change status of "link" to "new_status". + #: "link" has to be a valid FileData object, + #: "new_status" has to be a valid status name + #: (i.e. "queued" for this Plugin) + #: It creates a temporary PyFile object using + #: "link" data, changes its status, and tells + #: The core.files-manager to save its data. pylink = self._pyfile(link) pylink.setCustomStatus(_("unskipped"), "queued") @@ -63,22 +63,22 @@ class UnSkipOnFail(Hook): the data for "pyfile" iotselöf. It does MOT check the link's status. """ - queue = self.core.api.getQueue() #: get packages (w/o files, as most file data is useless here) + queue = self.core.api.getQueue() #: Get packages (w/o files, as most file data is useless here) for package in queue: - #: check if package-folder equals pyfile's package folder + #: Check if package-folder equals pyfile's package folder if package.folder != pyfile.package().folder: continue - #: now get packaged data w/ files/links + #: Now get packaged data w/ files/links pdata = self.core.api.getPackageData(package.pid) for link in pdata.links: - #: check if link is "skipped" + #: Check if link is "skipped" if link.status != 4: continue - #: check if link name collides with pdata's name - #: AND at last check if it is not pyfile itself + #: Check if link name collides with pdata's name + #: and at last check if it is not pyfile itself if link.name == pyfile.name and link.fid != pyfile.id: return link -- 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/hooks/UnSkipOnFail.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'module/plugins/hooks/UnSkipOnFail.py') diff --git a/module/plugins/hooks/UnSkipOnFail.py b/module/plugins/hooks/UnSkipOnFail.py index 5507cd20f..c8e58294c 100644 --- a/module/plugins/hooks/UnSkipOnFail.py +++ b/module/plugins/hooks/UnSkipOnFail.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- from module.PyFile import PyFile -from module.plugins.internal.Hook import Hook +from module.plugins.internal.Addon import Addon -class UnSkipOnFail(Hook): +class UnSkipOnFail(Addon): __name__ = "UnSkipOnFail" __type__ = "hook" __version__ = "0.09" @@ -16,13 +16,6 @@ class UnSkipOnFail(Hook): __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] - interval = 0 #@TODO: Remove in 0.4.10 - - - def setup(self): - self.info = {} #@TODO: Remove in 0.4.10 - - def download_failed(self, pyfile): #: Check if pyfile is still "failed", maybe might has been restarted in meantime if pyfile.status != 8: -- 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/hooks/UnSkipOnFail.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/hooks/UnSkipOnFail.py') diff --git a/module/plugins/hooks/UnSkipOnFail.py b/module/plugins/hooks/UnSkipOnFail.py index c8e58294c..9adf13e3e 100644 --- a/module/plugins/hooks/UnSkipOnFail.py +++ b/module/plugins/hooks/UnSkipOnFail.py @@ -39,7 +39,7 @@ class UnSkipOnFail(Addon): pylink.setCustomStatus(_("unskipped"), "queued") - self.core.files.save() + self.pyload.files.save() pylink.release() else: @@ -56,7 +56,7 @@ class UnSkipOnFail(Addon): the data for "pyfile" iotselöf. It does MOT check the link's status. """ - queue = self.core.api.getQueue() #: Get packages (w/o files, as most file data is useless here) + queue = self.pyload.api.getQueue() #: Get packages (w/o files, as most file data is useless here) for package in queue: #: Check if package-folder equals pyfile's package folder @@ -64,7 +64,7 @@ class UnSkipOnFail(Addon): continue #: Now get packaged data w/ files/links - pdata = self.core.api.getPackageData(package.pid) + pdata = self.pyload.api.getPackageData(package.pid) for link in pdata.links: #: Check if link is "skipped" if link.status != 4: @@ -77,7 +77,7 @@ class UnSkipOnFail(Addon): def _pyfile(self, link): - return PyFile(self.core.files, + return PyFile(self.pyload.files, link.fid, link.url, link.name, -- 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/hooks/UnSkipOnFail.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/hooks/UnSkipOnFail.py') diff --git a/module/plugins/hooks/UnSkipOnFail.py b/module/plugins/hooks/UnSkipOnFail.py index 9adf13e3e..e6064eb7b 100644 --- a/module/plugins/hooks/UnSkipOnFail.py +++ b/module/plugins/hooks/UnSkipOnFail.py @@ -8,6 +8,7 @@ class UnSkipOnFail(Addon): __name__ = "UnSkipOnFail" __type__ = "hook" __version__ = "0.09" + __status__ = "stable" __config__ = [("activated", "bool", "Activated", True)] -- cgit v1.2.3 From 4fc28dc09f9632eb4a15a1ef48778427f9dcae33 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 23 Jul 2015 18:53:06 +0200 Subject: Code cosmetics --- module/plugins/hooks/UnSkipOnFail.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hooks/UnSkipOnFail.py') diff --git a/module/plugins/hooks/UnSkipOnFail.py b/module/plugins/hooks/UnSkipOnFail.py index e6064eb7b..74d778d59 100644 --- a/module/plugins/hooks/UnSkipOnFail.py +++ b/module/plugins/hooks/UnSkipOnFail.py @@ -35,7 +35,7 @@ class UnSkipOnFail(Addon): #: (i.e. "queued" for this Plugin) #: It creates a temporary PyFile object using #: "link" data, changes its status, and tells - #: The core.files-manager to save its data. + #: The pyload.files-manager to save its data. pylink = self._pyfile(link) pylink.setCustomStatus(_("unskipped"), "queued") -- 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/hooks/UnSkipOnFail.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hooks/UnSkipOnFail.py') diff --git a/module/plugins/hooks/UnSkipOnFail.py b/module/plugins/hooks/UnSkipOnFail.py index 74d778d59..0be1911b4 100644 --- a/module/plugins/hooks/UnSkipOnFail.py +++ b/module/plugins/hooks/UnSkipOnFail.py @@ -8,7 +8,7 @@ class UnSkipOnFail(Addon): __name__ = "UnSkipOnFail" __type__ = "hook" __version__ = "0.09" - __status__ = "stable" + __status__ = "testing" __config__ = [("activated", "bool", "Activated", True)] -- cgit v1.2.3 From 761ca5c66e07559925ebbdbc6531f9ca658b12ce Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 24 Jul 2015 16:11:58 +0200 Subject: Code cosmetics --- module/plugins/hooks/UnSkipOnFail.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hooks/UnSkipOnFail.py') diff --git a/module/plugins/hooks/UnSkipOnFail.py b/module/plugins/hooks/UnSkipOnFail.py index 0be1911b4..5c2e89a7b 100644 --- a/module/plugins/hooks/UnSkipOnFail.py +++ b/module/plugins/hooks/UnSkipOnFail.py @@ -61,19 +61,19 @@ class UnSkipOnFail(Addon): for package in queue: #: Check if package-folder equals pyfile's package folder - if package.folder != pyfile.package().folder: + if package.folder not is pyfile.package().folder: continue #: Now get packaged data w/ files/links pdata = self.pyload.api.getPackageData(package.pid) for link in pdata.links: - #: Check if link is "skipped" + #: Check if link == "skipped" if link.status != 4: continue #: Check if link name collides with pdata's name #: and at last check if it is not pyfile itself - if link.name == pyfile.name and link.fid != pyfile.id: + if link.name is pyfile.name and link.fid not is pyfile.id: return link -- cgit v1.2.3 From dd13825fbd3df9e441200638cd2a92e3924dfff6 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 24 Jul 2015 23:57:04 +0200 Subject: Fix typo --- module/plugins/hooks/UnSkipOnFail.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks/UnSkipOnFail.py') diff --git a/module/plugins/hooks/UnSkipOnFail.py b/module/plugins/hooks/UnSkipOnFail.py index 5c2e89a7b..d467b8a01 100644 --- a/module/plugins/hooks/UnSkipOnFail.py +++ b/module/plugins/hooks/UnSkipOnFail.py @@ -61,7 +61,7 @@ class UnSkipOnFail(Addon): for package in queue: #: Check if package-folder equals pyfile's package folder - if package.folder not is pyfile.package().folder: + if package.folder is not pyfile.package().folder: continue #: Now get packaged data w/ files/links @@ -73,7 +73,7 @@ class UnSkipOnFail(Addon): #: Check if link name collides with pdata's name #: and at last check if it is not pyfile itself - if link.name is pyfile.name and link.fid not is pyfile.id: + if link.name is pyfile.name and link.fid is not pyfile.id: return link -- cgit v1.2.3