]> git.phdru.name Git - bookmarks_db.git/blobdiff - Robots/bkmk_rurllib.py
Minor refactoring: reorder return values
[bookmarks_db.git] / Robots / bkmk_rurllib.py
index ceaf67bd7218f5eb2b90203d2fdb0257d3b582e3..d9908b83292ab92fcfd107710446555cd3aab712 100644 (file)
@@ -74,7 +74,7 @@ urllib.ftpwrapper = myftpwrapper
 
 
 class robot_urllib(robot_base):
-   def urlretrieve(self, bookmark, url, accept_charset=False):
+   def get(self, bookmark, url, accept_charset=False):
       try:
          # Set fake referer to the base URL
          urllib._urlopener.addheaders[2] = ('Referer', url)
@@ -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