diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-10-27 22:17:38 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-10-27 22:17:38 +0200 |
commit | f15476c6a055edca312192769bbab2712758fe84 (patch) | |
tree | a9278e51573992c8b62222b15ba9df9e964814b4 /module/plugins/Plugin.py | |
parent | GUI: no borders on settings tab (diff) | |
download | pyload-f15476c6a055edca312192769bbab2712758fe84.tar.xz |
dump all loads in debug mode
Diffstat (limited to 'module/plugins/Plugin.py')
-rw-r--r-- | module/plugins/Plugin.py | 15 |
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 """ |