From d2c2975d4cd9375460c7bbaaa3b6dbb855e84b86 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Sat, 5 Jul 2014 00:39:25 +0400 Subject: [PATCH] Minor refactoring: reorder return values --- Robots/bkmk_robot_base.py | 6 ++---- Robots/bkmk_rurllib.py | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Robots/bkmk_robot_base.py b/Robots/bkmk_robot_base.py index 057fcef..dce5933 100644 --- a/Robots/bkmk_robot_base.py +++ b/Robots/bkmk_robot_base.py @@ -61,12 +61,10 @@ class robot_base(Robot): url_path, url_tag = urllib.splittag(url_path) url = "%s://%s%s" % (url_type, url_host, url_path) - headers, content, error = self.get(bookmark, url, True) + error, headers, content = self.get(bookmark, url, True) if error: bookmark.error = error - - if content is None: return 1 size = 0 @@ -145,7 +143,7 @@ class robot_base(Robot): _icon_url = icon_url for i in range(8): try: - icon_headers, icon_data, error = self.get(bookmark, _icon_url) + error, icon_headers, icon_data = self.get(bookmark, _icon_url) except RedirectException, e: _icon_url = e.url self.log(" redirect to : %s" % _icon_url) diff --git a/Robots/bkmk_rurllib.py b/Robots/bkmk_rurllib.py index 839e373..d9908b8 100644 --- a/Robots/bkmk_rurllib.py +++ b/Robots/bkmk_rurllib.py @@ -91,7 +91,7 @@ class robot_urllib(robot_base): content = infile.read() infile.close() - return headers, content, None + return None, headers, content except IOError, msg: if (msg[0] == "http error") and (msg[1] == -1): @@ -102,7 +102,7 @@ class robot_urllib(robot_base): error = get_error(msg) self.log(' Error: %s' % error) - return None, None, error + return error, None, None def get_ftp_welcome(self): global ftpcache_key -- 2.39.5