summaryrefslogtreecommitdiffstats
path: root/module/plugins/internal/Plugin.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-07-25 09:34:18 +0200
committerGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-07-25 09:34:18 +0200
commita95c217627a1cb651b24e69f20640df40797aff9 (patch)
tree63fcbffd55b704b461446c1724022e76373dac12 /module/plugins/internal/Plugin.py
parentAccount rewritten (diff)
downloadpyload-a95c217627a1cb651b24e69f20640df40797aff9.tar.xz
Account rewritten (2)
Diffstat (limited to 'module/plugins/internal/Plugin.py')
-rw-r--r--module/plugins/internal/Plugin.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/module/plugins/internal/Plugin.py b/module/plugins/internal/Plugin.py
index 9ac89501c..02ef326d6 100644
--- a/module/plugins/internal/Plugin.py
+++ b/module/plugins/internal/Plugin.py
@@ -5,6 +5,7 @@ from __future__ import with_statement
import inspect
import os
import re
+import traceback
import urllib
from module.plugins.Plugin import Abort, Fail, Reconnect, Retry, SkipDownload as Skip #@TODO: Remove in 0.4.10
@@ -80,12 +81,12 @@ def parse_html_form(attr_str, html, input_names={}):
for form in re.finditer(r"(?P<TAG><form[^>]*%s[^>]*>)(?P<CONTENT>.*?)</?(form|body|html)[^>]*>" % attr_str,
html, re.S | re.I):
inputs = {}
- action = parseHtmlTagAttrValue("action", form.group('TAG'))
+ action = parse_html_tag_attr_value("action", form.group('TAG'))
for inputtag in re.finditer(r'(<(input|textarea)[^>]*>)([^<]*(?=</\2)|)', form.group('CONTENT'), re.S | re.I):
- name = parseHtmlTagAttrValue("name", inputtag.group(1))
+ name = parse_html_tag_attr_value("name", inputtag.group(1))
if name:
- value = parseHtmlTagAttrValue("value", inputtag.group(1))
+ value = parse_html_tag_attr_value("value", inputtag.group(1))
if not value:
inputs[name] = inputtag.group(3) or ""
else:
@@ -155,9 +156,10 @@ class Plugin(object):
def _log(self, level, args):
log = getattr(self.pyload.log, level)
msg = encode(" | ".join((a if isinstance(a, basestring) else str(a)).strip() for a in args if a)) #@NOTE: `fs_encode` -> `encode` in 0.4.10
- log("%(plugin)s%(id)s: %(msg)s" % {'plugin': self.__name__,
- 'id' : ("[%s]" % self.pyfile.id) if hasattr(self, 'pyfile') else "",
- 'msg' : msg or _(level.upper() + " MARK")})
+ log("%(type)s %(plugin)s%(id)s: %(msg)s" % {'type': self.__type__.upper(),
+ 'plugin': self.__name__,
+ 'id' : ("[%s]" % self.pyfile.id) if hasattr(self, 'pyfile') else "",
+ 'msg' : msg or _(level.upper() + " MARK")})
def log_debug(self, *args):
@@ -204,6 +206,7 @@ class Plugin(object):
except KeyError:
self.log_warning(_("Config option or plugin not found"))
+ traceback.print_exc()
return default