Fixed some pylint warnings.
authorJoel Rosdahl <joel@rosdahl.net>
Tue, 5 Sep 2006 20:08:19 +0000 (20:08 +0000)
committerJoel Rosdahl <joel@rosdahl.net>
Tue, 5 Sep 2006 20:08:19 +0000 (20:08 +0000)
check.py
src/packages/kofoto/commandline/main.py
src/packages/kofoto/gkofoto/generatehtmldialog.py
src/packages/kofoto/gkofoto/objectcollectionfactory.py
src/packages/kofoto/iodict.py
src/packages/kofoto/search.py

index e4b3542..7032198 100755 (executable)
--- a/check.py
+++ b/check.py
@@ -36,8 +36,10 @@ normally_disabled_tests = [
     "C0103", # "Invalid name"
     "C0111", # "Missing docstring"
     "I0011", # "Locally disabling ..."
+    "R0201", # "Method could be a function"
     "R0801", # "Similar lines ..."
     "W0142", # "Used * or ** magic."
+    "W0212", # "Access to a protected member foo of a client class"
     "W0511", # "TODO ..."
     "W0704", # "Except doesn't do anything."
 ]
index 821fb53..074647d 100755 (executable)
@@ -1366,9 +1366,6 @@ def main(argv):
         printError(
             "Connecting %s to %s would make a loop in the categories.\n" % (
             x.args[0], x.args[1]))
-    except ParseError, x:
-        printError(
-            "While parsing search expression: %s.\n" % x.args[0])
     except UnterminatedStringError, x:
         printError(
             "While scanning search expression: unterminated string starting at"
@@ -1377,6 +1374,9 @@ def main(argv):
         printError(
             "While scanning search expression: bad token starting at character"
             " %d.\n" % x.args[0])
+    except ParseError, x:
+        printError(
+            "While parsing search expression: %s.\n" % x.args[0])
     except UnknownImageVersionTypeError, x:
         printError("Unknown image version type: \"%s\".\n" % x.args[0])
     except ExifImportError, x:
index f1fad3f..f85d9c6 100644 (file)
@@ -4,6 +4,7 @@ import re
 from sets import Set
 from kofoto.gkofoto.environment import env
 import kofoto.generate
+import kofoto.shelfexceptions
 
 class GenerateHTMLDialog:
     def __init__(self, album):
@@ -92,7 +93,7 @@ class GenerateHTMLDialog:
             progressBar.set_fraction(1)
             while gtk.events_pending():
                 gtk.main_iteration()
-        except (IOError, kofoto.shelf.KofotoError), e:
+        except (IOError, kofoto.shelfexceptions.KofotoError), e:
             dialog = gtk.MessageDialog(
                 type=gtk.MESSAGE_ERROR,
                 buttons=gtk.BUTTONS_OK,
index ecbea36..b82b5a2 100644 (file)
@@ -18,7 +18,7 @@ class ObjectCollectionFactory:
         self.__albumMembers = AlbumMembers()
 
     def getObjectCollection(self, query, filterText=""):
-        env.debug("Object collection factory loading query: " + query);
+        env.debug("Object collection factory loading query: " + query)
         self.__clear()
         validAlbumTag = False
         if query and query[0] == "/":
index 491461f..a36631f 100644 (file)
@@ -284,8 +284,6 @@ class InsertionOrderedDict:
 
 
 class _KeyListNode:
-    __slots__ = ["key", "next", "prev"]
-
     def __init__(self, key=None):
         self.key = key
         self.prev = None
index ea37603..41d9ec2 100644 (file)
@@ -429,13 +429,13 @@ class AttributeConditionSearchNode(SearchNode):
 class CategorySearchNode(SearchNode):
     """A node representing the search for a category."""
     def __init__(self, ids):
-        SearchNode.__init__(self)
         """Constructor.
 
         Arguments:
 
         ids -- A list of category IDs this node represents.
         """
+        SearchNode.__init__(self)
         self._ids = ids
 
     def __repr__(self):