summaryrefslogtreecommitdiffstats
path: root/module/plugins/Plugin.py
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-06-02 13:00:20 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-06-02 13:00:20 +0200
commit9415f17b63a1167c5f933e2ef7784d1aa4cf3e30 (patch)
tree4ccfefac0cea6622381f0abddf62bc94557552ea /module/plugins/Plugin.py
parentwupload plugin (free) (diff)
downloadpyload-9415f17b63a1167c5f933e2ef7784d1aa4cf3e30.tar.xz
wupload premium (untested), new log functions for plugins, decode kwarg for requests
Diffstat (limited to 'module/plugins/Plugin.py')
-rw-r--r--module/plugins/Plugin.py20
1 files changed, 14 insertions, 6 deletions
diff --git a/module/plugins/Plugin.py b/module/plugins/Plugin.py
index d8bd3bcd0..e4ec532d4 100644
--- a/module/plugins/Plugin.py
+++ b/module/plugins/Plugin.py
@@ -299,15 +299,12 @@ class Plugin(object):
return result
- def load(self, url, get={}, post={}, ref=True, cookies=True, just_header=False, utf8=False):
+ def load(self, url, get={}, post={}, ref=True, cookies=True, just_header=False, utf8=False, decode=False):
""" returns the content loaded """
if self.pyfile.abort: raise Abort
+ #utf8 vs decode -> please use decode attribute in all future plugins
- res = self.req.load(url, get, post, ref, cookies, just_header)
-
- if utf8:
- res = self.req.http.decodeResponse(res)
- #res = decode(res)
+ res = self.req.load(url, get, post, ref, cookies, just_header, decode=utf8 or decode)
if self.core.debug:
from inspect import currentframe
@@ -473,6 +470,17 @@ class Plugin(object):
self.log.debug("File %s not skipped, because it does not exists." % self.pyfile.name)
+
+ #log functions
+ def logInfo(self, msg):
+ self.log.info("%s: %s" % (self.__name__, msg))
+ def logWarning(self, msg):
+ self.log.warning("%s: %s" % (self.__name__, msg))
+ def logError(self, msg):
+ self.log.error("%s: %s" % (self.__name__, msg))
+ def logDebug(self, msg):
+ self.log.debug("%s: %s" % (self.__name__, msg))
+
def clean(self):
""" clean everything and remove references """
if hasattr(self, "pyfile"):