]> git.phdru.name Git - bookmarks_db.git/commitdiff
Minor refactoring: rename msg to e
authorOleg Broytman <phd@phdru.name>
Sun, 6 Jul 2014 01:34:29 +0000 (05:34 +0400)
committerOleg Broytman <phd@phdru.name>
Sun, 6 Jul 2014 01:50:45 +0000 (05:50 +0400)
Robots/bkmk_robot_base.py
Robots/bkmk_rurllib.py

index 210d092b6509603c60832cc38b40cbfdcec058cc..30a26bf137138ef40b4da218efeab4be64acc399 100644 (file)
@@ -32,13 +32,13 @@ reloc_dict = {
 }
 
 
 }
 
 
-def get_error(msg):
-   if isinstance(msg, str):
-      return msg
+def get_error(e):
+   if isinstance(e, str):
+      return e
 
    else:
       s = []
 
    else:
       s = []
-      for i in msg:
+      for i in e:
          s.append("'%s'" % str(i).replace('\n', "\\n"))
       return "(%s)" % ' '.join(s)
 
          s.append("'%s'" % str(i).replace('\n', "\\n"))
       return "(%s)" % ' '.join(s)
 
index 9acbd883d8ef84ac4df1b03bba08f94a866486c0..e0d5c2cba9cfdfae19d56a72057da8cd3c0867f5 100644 (file)
@@ -102,13 +102,13 @@ class robot_urllib(robot_base):
       except RedirectException, e:
          return None, e.errcode, e.newurl, None, None
 
       except RedirectException, e:
          return None, e.errcode, e.newurl, None, None
 
-      except IOError, msg:
-         if (msg[0] == "http error") and (msg[1] == -1):
+      except IOError, e:
+         if (e[0] == "http error") and (e[1] == -1):
             error = None
             bookmark.no_error = "The server did not return any header - it is not an error, actually"
             self.log('   no headers: %s' % bookmark.no_error)
          else:
             error = None
             bookmark.no_error = "The server did not return any header - it is not an error, actually"
             self.log('   no headers: %s' % bookmark.no_error)
          else:
-            error = get_error(msg)
+            error = get_error(e)
             self.log('   Error: %s' % error)
 
          return error, None, None, None, None
             self.log('   Error: %s' % error)
 
          return error, None, None, None, None