From: Oleg Broytman Date: Fri, 4 Jul 2014 20:39:25 +0000 (+0400) Subject: Minor refactoring: reorder return values X-Git-Tag: v4.6.0~16 X-Git-Url: https://git.phdru.name/?p=bookmarks_db.git;a=commitdiff_plain;h=d2c2975d4cd9375460c7bbaaa3b6dbb855e84b86 Minor refactoring: reorder return values --- 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