summaryrefslogtreecommitdiffstats
path: root/module/plugins/internal/SimpleHoster.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-10-26 19:36:46 +0100
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-10-26 19:36:46 +0100
commit8f0303277fce7471539508f7a8fad033e5e87076 (patch)
tree8d464ad29d56226d6a3cd1d5ca0440c2115d07b2 /module/plugins/internal/SimpleHoster.py
parent[XFSPAccount] Improve VALID_UNTIL_PATTERN (diff)
downloadpyload-8f0303277fce7471539508f7a8fad033e5e87076.tar.xz
[SimpleHoster][SimpleCrypter] Clean error method
Diffstat (limited to 'module/plugins/internal/SimpleHoster.py')
-rw-r--r--module/plugins/internal/SimpleHoster.py19
1 files changed, 15 insertions, 4 deletions
diff --git a/module/plugins/internal/SimpleHoster.py b/module/plugins/internal/SimpleHoster.py
index 135d3c9d9..84a77a312 100644
--- a/module/plugins/internal/SimpleHoster.py
+++ b/module/plugins/internal/SimpleHoster.py
@@ -13,6 +13,20 @@ from module.plugins.Plugin import Fail
from module.utils import fixup, html_unescape, parseFileSize
+#@TODO: Remove in 0.4.10 and redirect to self.error instead
+def _error(self, reason="", type=""):
+ if not reason and not type:
+ type = "unknown"
+
+ msg = _("%s error") % type.strip().capitalize() if type else _("Error")
+ msg += ": " + reason.strip() if reason else ""
+ msg += _(" | Plugin may be out of date")
+
+ if self.core.debug:
+ print_exc()
+ raise Fail(msg)
+
+
def replace_patterns(string, ruleslist):
for r in ruleslist:
rf, rt = r
@@ -324,8 +338,5 @@ class SimpleHoster(Hoster):
super(SimpleHoster, self).wait()
- #@TODO: remove in 0.4.10
def error(self, reason="", type="parse"):
- if self.core.debug:
- print_exc()
- raise Fail("%s error%s | Plugin may be out of date" % (type.strip().capitalize(), ': ' + reason.strip() if reason else ""))
+ return _error(reason, type)