From 6badd4f1f210d2e9385c4d73c5b41ee5a6f04e65 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 22 Oct 2014 09:59:16 +0200 Subject: Improve error method + fix TEXT_ENCODING in SimpleCrypter --- module/plugins/Plugin.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'module/plugins/Plugin.py') diff --git a/module/plugins/Plugin.py b/module/plugins/Plugin.py index 57da4d114..83571345c 100644 --- a/module/plugins/Plugin.py +++ b/module/plugins/Plugin.py @@ -13,6 +13,7 @@ if os.name != "nt": from grp import getgrnam from itertools import islice +from traceback import print_exc from module.utils import save_join, save_path, fs_encode, fs_decode @@ -284,6 +285,11 @@ class Plugin(Base): """ fail and give reason """ raise Fail(reason) + def error(self, reason=None, type="parse"): + raise Fail("%s error%s | Plugin out of date" % (type.capitalize(), ':' + str(reason) if reason else "")) + if self.core.debug: + print_exc() + def offline(self): """ fail and indicate file is offline """ raise Fail("offline") -- cgit v1.2.3