summaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2010-10-27 22:17:38 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2010-10-27 22:17:38 +0200
commitf15476c6a055edca312192769bbab2712758fe84 (patch)
treea9278e51573992c8b62222b15ba9df9e964814b4 /module
parentGUI: no borders on settings tab (diff)
downloadpyload-f15476c6a055edca312192769bbab2712758fe84.tar.xz
dump all loads in debug mode
Diffstat (limited to 'module')
-rw-r--r--module/plugins/Plugin.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/module/plugins/Plugin.py b/module/plugins/Plugin.py
index 5058ebdc8..0e78686c7 100644
--- a/module/plugins/Plugin.py
+++ b/module/plugins/Plugin.py
@@ -280,8 +280,19 @@ class Plugin(object):
def load(self, url, get={}, post={}, ref=True, cookies=True, just_header=False):
""" returns the content loaded """
if self.pyfile.abort: raise Abort
-
- return self.req.load(url, get, post, ref, cookies, just_header)
+
+ res = self.req.load(url, get, post, ref, cookies, just_header)
+ if self.core.debug:
+ from inspect import currentframe
+ frame = currentframe()
+ if not exists(join("tmp", self.__name__)):
+ makedirs(join("tmp", self.__name__))
+
+ f = open(join("tmp", self.__name__, "%s_line%s.dump" % (frame.f_back.f_code.co_name, frame.f_back.f_lineno)), "wb")
+ f.write(res)
+ f.close()
+
+ return res
def download(self, url, get={}, post={}, ref=True, cookies=True):
""" downloads the url content to disk """