More pylint-related changes.
authorJoel Rosdahl <joel@rosdahl.net>
Tue, 27 Sep 2005 22:07:11 +0000 (22:07 +0000)
committerJoel Rosdahl <joel@rosdahl.net>
Tue, 27 Sep 2005 22:07:11 +0000 (22:07 +0000)
18 files changed:
check.py
misc/pylintrc
src/packages/kofoto/gkofoto/albumdialog.py
src/packages/kofoto/gkofoto/albummembers.py
src/packages/kofoto/gkofoto/categorydialog.py
src/packages/kofoto/gkofoto/clipboard.py
src/packages/kofoto/gkofoto/environment.py
src/packages/kofoto/gkofoto/handleimagesdialog.py
src/packages/kofoto/gkofoto/main.py
src/packages/kofoto/gkofoto/mainwindow.py
src/packages/kofoto/gkofoto/objectcollection.py
src/packages/kofoto/gkofoto/objectcollectionfactory.py
src/packages/kofoto/gkofoto/objectselection.py
src/packages/kofoto/gkofoto/registerimagesdialog.py
src/packages/kofoto/gkofoto/searchresult.py
src/packages/kofoto/gkofoto/singleobjectview.py
src/packages/kofoto/gkofoto/tableview.py
src/packages/kofoto/output/woolly.py

index c703500..1777260 100755 (executable)
--- a/check.py
+++ b/check.py
@@ -34,7 +34,9 @@ else:
 normally_disabled_tests = [
     "C0101", # "Too short variable name."
     "I0011", # "Locally disabling ..."
+    "W0131", # "Missing docstring."
     "W0142", # "Used * or ** magic."
+    "W0511", # "TODO ..."
     "W0704", # "Except doesn't do anything."
 ]
 
index f8f69d1..428f389 100644 (file)
@@ -27,7 +27,7 @@ cache-size=500
 
 [REPORTS]
 # Tells wether to display a full report or only the messages
-reports=yes
+reports=no
 
 # Use HTML as output format instead of text
 html=no
@@ -74,7 +74,7 @@ enable-variables=yes
 init-import=no
 
 # List of variable names used for dummy variables (i.e. not used).
-dummy-variables=_,dummy
+dummy-variables=_,dummy,unused,unused1,unused2,unused3,unused4,unused5,unused6
 
 # List of additional names supposed to be defined in builtins. Remember that you
 # should avoid to define new builtins when possible.
index 291b8d9..26c7344 100644 (file)
@@ -1,8 +1,7 @@
-import gtk
-import string
-import re
-from environment import env
-from kofoto.gkofoto.taganddescriptiondialog import *
+from kofoto.gkofoto.environment import env
+from kofoto.gkofoto.taganddescriptiondialog import TagAndDescriptionDialog
+from kofoto.shelf import \
+    AlbumDoesNotExistError, BadAlbumTagError, verifyValidAlbumTag
 
 class AlbumDialog(TagAndDescriptionDialog):
     def __init__(self, title, albumId=None):
@@ -22,8 +21,8 @@ class AlbumDialog(TagAndDescriptionDialog):
 
     def _isTagOkay(self, tagString):
         try:
-           # Check that the tag name is valid.
-           verifyValidAlbumTag(tagString)
+            # Check that the tag name is valid.
+            verifyValidAlbumTag(tagString)
         except BadAlbumTagError:
             return False
         try:
index 6490560..b8c9592 100644 (file)
@@ -1,5 +1,5 @@
-from objectcollection import *
-from environment import env
+from kofoto.gkofoto.objectcollection import ObjectCollection
+from kofoto.gkofoto.environment import env
 
 class AlbumMembers(ObjectCollection):
 
@@ -27,11 +27,11 @@ class AlbumMembers(ObjectCollection):
     def getContainer(self):
         return self.__album
 
-    def cut(self, *foo):
+    def cut(self, *unused):
         self.copy()
         self.delete()
 
-    def paste(self, *foo):
+    def paste(self, *unused):
         # This method assumes that self.getModel() returns an unsorted
         # and mutable model.
         self._freezeViews()
@@ -59,7 +59,7 @@ class AlbumMembers(ObjectCollection):
         self.getObjectSelection().unselectAll()
         self._thawViews()
 
-    def delete(self, *foo):
+    def delete(self, *unused):
         # This method assumes that self.getModel() returns an unsorted
         # and mutable model
         model = self.getModel()
index 6ead557..0ec58a9 100644 (file)
@@ -1,8 +1,7 @@
-import gtk
-import string
-import re
-from environment import env
-from kofoto.gkofoto.taganddescriptiondialog import *
+from kofoto.gkofoto.environment import env
+from kofoto.gkofoto.taganddescriptiondialog import TagAndDescriptionDialog
+from kofoto.shelf import \
+    BadCategoryTagError, CategoryDoesNotExistError, verifyValidCategoryTag
 
 class CategoryDialog(TagAndDescriptionDialog):
     def __init__(self, title, categoryId=None):
@@ -18,8 +17,8 @@ class CategoryDialog(TagAndDescriptionDialog):
 
     def _isTagOkay(self, tagString):
         try:
-           # Check that the tag name is valid.
-           verifyValidCategoryTag(tagString)
+            # Check that the tag name is valid.
+            verifyValidCategoryTag(tagString)
         except BadCategoryTagError:
             return False
         try:
index d364377..c551b7f 100644 (file)
@@ -1,8 +1,6 @@
 from sets import Set
-from environment import env
-from kofoto.shelf import Image
-from kofoto.shelf import Album
-from categories import ClipboardCategories
+from kofoto.shelf import Album, Image
+from kofoto.gkofoto.categories import ClipboardCategories
 
 class Clipboard:
 
@@ -11,6 +9,8 @@ class Clipboard:
     CATEGORIES = 1 # shelf.Category
 
     def __init__(self):
+        self.__objects = None
+        self.__types = None
         self.__changedCallbacks = Set()
         self.clear()
 
@@ -20,15 +20,15 @@ class Clipboard:
     def removeChangedCallback(self, callback):
         self.__changedCallbacks.remove(callback)
 
-    def setObjects(self, iter):
+    def setObjects(self, iterable):
         self.__objects = []
         self.__types = Clipboard.OBJECTS
-        for object in iter:
-            if (isinstance(object, Image) or isinstance(object, Album)):
+        for obj in iterable:
+            if (isinstance(obj, Image) or isinstance(obj, Album)):
                 self.__objects.append(object)
             else:
                 self.clear()
-                raise "Object is not an Image nor an Album" # TODO
+                raise Exception("Object is not an Image nor an Album") # TODO
         self.__invokeChangedCallbacks()
 
     def setCategories(self, clipboardCategories):
@@ -37,7 +37,7 @@ class Clipboard:
             self.__objects.append(clipboardCategories)
         else:
             self.clear()
-            raise "Object is not a ClipboardCategories" # TODO
+            raise Exception("Object is not a ClipboardCategories") # TODO
         self.__types = Clipboard.CATEGORIES
         self.__invokeChangedCallbacks()
 
@@ -46,8 +46,8 @@ class Clipboard:
         self.__types = None
         self.__invokeChangedCallbacks()
 
-    def removeObjects(self, object):
-        self.__objects = [x for x in self.__objects if x != object]
+    def removeObjects(self, obj):
+        self.__objects = [x for x in self.__objects if x != obj]
         self.__invokeChangedCallbacks()
 
     def hasCategories(self):
index 62b5265..9ce7df1 100644 (file)
@@ -1,24 +1,19 @@
+# pylint: disable-msg=W0222
+
 import sys
 import os
-import getopt
-import locale
 import re
 
 import pygtk
 if sys.platform != "win32":
-    pygtk.require('2.0')
+    pygtk.require("2.0")
 import gtk
-import gobject
 import gtk.gdk
 import gtk.glade
 from kofoto.gkofoto import crashdialog
 sys.excepthook = crashdialog.show
 
-from kofoto.clientenvironment import *
-from kofoto.common import *
-from kofoto.shelf import *
-from kofoto.config import *
-from kofoto.imagecache import *
+from kofoto.clientenvironment import ClientEnvironment, ClientEnvironmentError
 
 class WidgetsWrapper:
     def __init__(self):
@@ -31,6 +26,22 @@ class Environment(ClientEnvironment):
     def __init__(self):
         ClientEnvironment.__init__(self)
         self.startupNotices = []
+        self.openCommand = None
+        self.loadingPixbuf = None
+        self.gladeFile = None
+        self.unknownImageIconFileName = None
+        self.albumIconFileName = None
+        self.thumbnailSize = None
+        self.albumIconPixbuf = None
+        self.unknownImageIconPixbuf = None
+        self.defaultSortColumn = None
+        self.isDebug = None
+        self.clipboard = None
+        self.defaultTableViewColumns = None
+        self.iconDir = None
+        self.widgets = None
+        self.rotateRightCommand = None
+        self.rotateLeftCommand = None
 
     def setup(self, bindir, isDebug=False, configFileLocation=None,
               shelfLocation=None):
@@ -73,7 +84,7 @@ class Environment(ClientEnvironment):
         self.loadingPixbuf = self.albumIconPixbuf # TODO: create another icon with a hour-glass or something
         self.unknownImageIconFileName = os.path.join(self.iconDir, "unknownimage.png")
         self.unknownImageIconPixbuf = gtk.gdk.pixbuf_new_from_file(self.unknownImageIconFileName)
-        from clipboard import Clipboard
+        from kofoto.gkofoto.clipboard import Clipboard
         self.clipboard = Clipboard()
 
         self.widgets = WidgetsWrapper()
index 6b8097a..f70e960 100644 (file)
@@ -1,11 +1,11 @@
 import gtk
 import gobject
 import os
-from environment import env
+from kofoto.gkofoto.environment import env
 from kofoto.shelf import \
-     ImageVersionDoesNotExistError, ImageVersionExistsError, \
+     ImageVersionDoesNotExistError, \
      MultipleImageVersionsAtOneLocationError, \
-     makeValidTag, computeImageHash
+     computeImageHash
 from kofoto.clientutils import walk_files
 
 class HandleImagesDialog(gtk.FileChooserDialog):
@@ -19,7 +19,7 @@ class HandleImagesDialog(gtk.FileChooserDialog):
                 gtk.STOCK_OK, gtk.RESPONSE_OK))
         self.connect("response", self._response)
 
-    def _response(self, widget, responseId):
+    def _response(self, unused, responseId):
         if responseId != gtk.RESPONSE_OK:
             return
         widgets = gtk.glade.XML(env.gladeFile, "handleImagesProgressDialog")
index 6cfeb52..513e62c 100644 (file)
@@ -5,7 +5,7 @@ from kofoto.gkofoto.environment import env
 from kofoto.gkofoto.controller import Controller
 from optparse import OptionParser
 
-def setupWindowsEnvironment(bindir):
+def setupWindowsEnvironment():
     # Allow (default) datafile location to be determined under Windows 98.
     if os.path.expanduser("~") == "~":
         # Probably running under Windows 98 or similar OS where the
@@ -61,7 +61,7 @@ def main(bindir, argv):
         parser.error("incorrect number of arguments")
 
     if sys.platform == "win32":
-        setupWindowsEnvironment(bindir)
+        setupWindowsEnvironment()
 
     setupOk = env.setup(
         bindir, options.debug, options.configfile, options.database)
index ee8b286..bcf9a64 100644 (file)
@@ -2,14 +2,13 @@ import gtk
 import gtk.gdk
 import os
 
-from kofoto.gkofoto.categories import *
-from kofoto.gkofoto.albums import *
-from environment import env
-from kofoto.gkofoto.tableview import *
-from kofoto.gkofoto.thumbnailview import *
-from kofoto.gkofoto.singleobjectview import *
-from kofoto.gkofoto.objectcollectionfactory import *
-from kofoto.gkofoto.objectcollection import *
+from kofoto.gkofoto.categories import Categories
+from kofoto.gkofoto.albums import Albums
+from kofoto.gkofoto.environment import env
+from kofoto.gkofoto.tableview import TableView
+from kofoto.gkofoto.thumbnailview import ThumbnailView
+from kofoto.gkofoto.singleobjectview import SingleObjectView
+from kofoto.gkofoto.objectcollectionfactory import ObjectCollectionFactory
 from kofoto.gkofoto.registerimagesdialog import RegisterImagesDialog
 from kofoto.gkofoto.handleimagesdialog import HandleImagesDialog
 from kofoto.gkofoto.generatehtmldialog import GenerateHTMLDialog
@@ -18,6 +17,8 @@ from kofoto.gkofoto.imagepreloader import ImagePreloader
 
 class MainWindow(gtk.Window):
     def __init__(self):
+        self._hiddenViews = None
+        self.__query = None
         env.mainwindow = self
         self._toggleLock = False
         self.__currentObjectCollection = None
@@ -93,7 +94,7 @@ class MainWindow(gtk.Window):
     def saveState(self):
         self.__persistentState.save()
 
-    def _queryChanged(self, *foo):
+    def _queryChanged(self, *unused):
         query = self.__sourceEntry.get_text().decode("utf-8")
         self.loadQuery(query)
         self.__sourceEntry.grab_remove()
@@ -125,13 +126,13 @@ class MainWindow(gtk.Window):
     def unselectAlbumTree(self):
         self.__albums.unselect()
 
-    def registerImages(self, widget, data):
+    def registerImages(self, *unused):
         dialog = RegisterImagesDialog()
         if dialog.run() == gtk.RESPONSE_OK:
             self.reload() # TODO: don't reload everything.
         dialog.destroy()
 
-    def handleModifiedOrRenamedImages(self, widget, data):
+    def handleModifiedOrRenamedImages(self, *unused):
         dialog = HandleImagesDialog()
         dialog.run()
         dialog.destroy()
index b6081be..2e0fa9e 100644 (file)
@@ -2,16 +2,16 @@ import os
 import gtk
 import gobject
 import gc
-from sets import *
-from kofoto.shelf import *
-from menuhandler import *
-from environment import env
-from objectselection import *
-from albumdialog import AlbumDialog
-from registerimagesdialog import RegisterImagesDialog
-from imageversionsdialog import ImageVersionsDialog
-from registerimageversionsdialog import RegisterImageVersionsDialog
-from duplicateandopenimagedialog import DuplicateAndOpenImageDialog
+from sets import Set
+from kofoto.gkofoto.environment import env
+from kofoto.gkofoto.objectselection import ObjectSelection
+from kofoto.gkofoto.albumdialog import AlbumDialog
+from kofoto.gkofoto.registerimagesdialog import RegisterImagesDialog
+from kofoto.gkofoto.imageversionsdialog import ImageVersionsDialog
+from kofoto.gkofoto.registerimageversionsdialog import \
+    RegisterImageVersionsDialog
+from kofoto.gkofoto.duplicateandopenimagedialog import \
+    DuplicateAndOpenImageDialog
 
 class ObjectCollection(object):
 
@@ -45,6 +45,8 @@ class ObjectCollection(object):
             self.__addAttribute(name)
         self.__treeModel = gtk.ListStore(*self.__columnsType)
         self.__frozen = False
+        self.__nrOfAlbums = 0
+        self.__nrOfImages = 0
 
     # Return true if the objects has a defined order and may
     # be reordered. An object that is reorderable is not
@@ -169,19 +171,19 @@ class ObjectCollection(object):
         if freeze:
             self._thawViews()
 
-    def cut(self, *foo):
+    def cut(self, *unused):
         raise Exception("Error. Not allowed to cut objects into objectCollection.") # TODO
 
-    def copy(self, *foo):
+    def copy(self, *unused):
         env.clipboard.setObjects(self.__objectSelection.getSelectedObjects())
 
-    def paste(self, *foo):
+    def paste(self, *unused):
         raise Exception("Error. Not allowed to paste objects into objectCollection.") # TODO
 
-    def delete(self, *foo):
+    def delete(self, *unused):
         raise Exception("Error. Not allowed to delete objects from objectCollection.") # TODO
 
-    def destroy(self, *foo):
+    def destroy(self, *unused):
         model = self.getModel()
 
         albumsSelected = False
@@ -389,7 +391,7 @@ class ObjectCollection(object):
 ###############################################################################
 ### Callback functions
 
-    def _attributeEdited(self, renderer, path, value, column, attributeName):
+    def _attributeEdited(self, unused1, path, value, unused2, attributeName):
         model = self.getModel()
         columnNumber = self.__objectMetadataMap["@" + attributeName][self.COLUMN_NR]
         iterator = model.get_iter(path)
@@ -405,7 +407,7 @@ class ObjectCollection(object):
             model.set_value(iterator, columnNumber, value)
             env.debug("Object attribute edited")
 
-    def _albumTagEdited(self, renderer, path, value, column, columnNumber):
+    def _albumTagEdited(self, unused1, path, value, unused2, columnNumber):
         model = self.getModel()
         iterator = model.get_iter(path)
         assert model.get_value(iterator, self.COLUMN_IS_ALBUM)
@@ -483,27 +485,27 @@ class ObjectCollection(object):
         env.mainwindow.reloadAlbumTree()
         # TODO: Update objectCollection.
 
-    def imageVersions(self, widget, *unused):
+    def imageVersions(self, *unused):
         selectedObjects = self.__objectSelection.getSelectedObjects()
         assert len(selectedObjects) == 1
         dialog = ImageVersionsDialog(self)
         dialog.runViewImageVersions(selectedObjects[0])
         self.reloadSingleObjectView()
 
-    def registerImageVersions(self, widget, *unused):
+    def registerImageVersions(self, *unused):
         selectedObjects = self.__objectSelection.getSelectedObjects()
         assert len(selectedObjects) == 1
         dialog = RegisterImageVersionsDialog(self)
         dialog.run(selectedObjects[0])
         self.reloadSingleObjectView()
 
-    def mergeImages(self, widget, *unused):
+    def mergeImages(self, *unused):
         selectedObjects = self.__objectSelection.getSelectedObjects()
         assert len(selectedObjects) > 1
         dialog = ImageVersionsDialog(self)
         dialog.runMergeImages(selectedObjects)
 
-    def rotateImage(self, widget, angle):
+    def rotateImage(self, unused, angle):
         env.mainwindow.getImagePreloader().clearCache()
         for (rowNr, obj) in self.__objectSelection.getMap().items():
             if not obj.isAlbum():
@@ -538,7 +540,7 @@ class ObjectCollection(object):
     def rotateImageRight(self, widget, *unused):
         self.rotateImage(widget, 90)
 
-    def openImage(self, widget, *unused):
+    def openImage(self, *unused):
         locations = ""
         for obj in self.__objectSelection.getSelectedObjects():
             if not obj.isAlbum():
@@ -559,7 +561,7 @@ class ObjectCollection(object):
                 dialog.run()
                 dialog.destroy()
 
-    def duplicateAndOpenImage(self, widget, *unused):
+    def duplicateAndOpenImage(self, *unused):
         selectedObjects = self.__objectSelection.getSelectedObjects()
         assert len(selectedObjects) == 1
         assert not selectedObjects[0].isAlbum()
index 40248a5..ecbea36 100644 (file)
@@ -1,9 +1,11 @@
-import string
-from searchresult import *
-from albummembers import *
-from environment import env
-from kofoto.search import *
-from kofoto.shelf import *
+import gtk
+from kofoto.gkofoto.searchresult import SearchResult
+from kofoto.gkofoto.albummembers import AlbumMembers
+from kofoto.gkofoto.environment import env
+from kofoto.search import BadTokenError, ParseError, UnterminatedStringError
+from kofoto.shelf import \
+    AlbumDoesNotExistError, BadAlbumTagError, CategoryDoesNotExistError, \
+    verifyValidAlbumTag
 
 class ObjectCollectionFactory:
 
index 6478c08..455e15c 100644 (file)
@@ -1,4 +1,4 @@
-from environment import env
+from kofoto.gkofoto.environment import env
 from sets import Set
 
 class ObjectSelection:
index 0f33d50..a27b94b 100644 (file)
@@ -1,10 +1,10 @@
+import pygtk
+pygtk.require("2.0")
 import gtk
-import os
 import time
-from environment import env
+from kofoto.gkofoto.environment import env
 from kofoto.shelf import \
-     ImageVersionExistsError, ImageVersionType, NotAnImageFileError, \
-     makeValidTag
+    ImageVersionExistsError, ImageVersionType, NotAnImageFileError
 from kofoto.clientutils import walk_files
 
 class RegisterImagesDialog(gtk.FileChooserDialog):
@@ -19,7 +19,7 @@ class RegisterImagesDialog(gtk.FileChooserDialog):
         self.__albumToAddTo = albumToAddTo
         self.connect("response", self._response)
 
-    def _response(self, widget, responseId):
+    def _response(self, unused, responseId):
         if responseId != gtk.RESPONSE_OK:
             return
         widgets = gtk.glade.XML(env.gladeFile, "registrationProgressDialog")
index 71c0e85..0050cbf 100644 (file)
@@ -1,7 +1,6 @@
-from kofoto.shelf import *
-from kofoto.search import *
-from sortableobjectcollection import *
-from environment import env
+from kofoto.search import Parser
+from kofoto.gkofoto.sortableobjectcollection import SortableObjectCollection
+from kofoto.gkofoto.environment import env
 
 class SearchResult(SortableObjectCollection):
 
index 1c7d89b..cd4d514 100644 (file)
@@ -1,8 +1,7 @@
 import gtk
-import sys
-from environment import env
-from kofoto.gkofoto.imageview import *
-from kofoto.gkofoto.objectcollectionview import *
+from kofoto.gkofoto.environment import env
+from kofoto.gkofoto.imageview import ImageView
+from kofoto.gkofoto.objectcollectionview import ObjectCollectionView
 from kofoto.gkofoto.imageversionslist import ImageVersionsList
 
 class SingleObjectView(ObjectCollectionView, gtk.HPaned):
@@ -39,7 +38,9 @@ class SingleObjectView(ObjectCollectionView, gtk.HPaned):
         env.widgets["menubarZoomOut"].connect("activate", self.__imageView.zoomOut)
         env.widgets["mainWindow"].connect("key_press_event", self._key_pressed)
         env.widgets["menubarViewDetailsPane"].set_sensitive(True)
+        self.__loadedObject = False
         self.__selectionLocked = False
+        self.__selectedRowNr = None
 
     def showDetailsPane(self):
         self.__imageVersionsFrame.show()
@@ -173,11 +174,11 @@ class SingleObjectView(ObjectCollectionView, gtk.HPaned):
         self._objectCollection.addInsertedRowCallback(self._modelUpdated)
         env.exit("SingleObjectView.thawHelper()")
 
-    def _modelUpdated(self, *foo):
+    def _modelUpdated(self, *unused):
         env.debug("SingleObjectView is handling model update")
         self.importSelection(self._objectCollection.getObjectSelection())
 
-    def _goto(self, button, direction):
+    def _goto(self, unused, direction):
         objectSelection = self._objectCollection.getObjectSelection()
         objectSelection.setSelection([self.__selectedRowNr + direction])
 
@@ -193,7 +194,7 @@ class SingleObjectView(ObjectCollectionView, gtk.HPaned):
         env.mainwindow.getImagePreloader().preloadImages(
             filenames, maxWidth, maxHeight)
 
-    def _key_pressed(self, widget, event):
+    def _key_pressed(self, unused, event):
         # TODO use UiManager instead of this...
         if event.state & gtk.gdk.CONTROL_MASK:
             if (event.keyval == gtk.gdk.keyval_from_name("space") and
index d232a1e..b60d2a4 100644 (file)
@@ -1,10 +1,9 @@
 import gtk
-from environment import env
-from sets import Set
-from kofoto.gkofoto.objectcollectionview import *
-from sets import Set
-from objectcollection import *
-from menuhandler import *
+import gobject
+from kofoto.gkofoto.environment import env
+from kofoto.gkofoto.objectcollectionview import ObjectCollectionView
+from kofoto.gkofoto.objectcollection import ObjectCollection
+from kofoto.gkofoto.menuhandler import MenuGroup
 
 class TableView(ObjectCollectionView):
 
@@ -16,6 +15,7 @@ class TableView(ObjectCollectionView):
         ObjectCollectionView.__init__(self, env.widgets["tableView"])
         selection = self._viewWidget.get_selection()
         selection.set_mode(gtk.SELECTION_MULTIPLE)
+        self.__viewGroup = None
         self.__selectionLocked = False
         self._viewWidget.connect("drag_data_received", self._onDragDataReceived)
         self._viewWidget.connect("drag-data-get", self._onDragDataGet)
@@ -85,7 +85,7 @@ class TableView(ObjectCollectionView):
         columnLocationList = self.__userChosenColumns.items()
         columnLocationList.sort(lambda x, y: cmp(x[1], y[1]))
         env.debug("Column locations: " + str(columnLocationList))
-        for (columnName, columnLocation) in columnLocationList:
+        for (columnName, _) in columnLocationList:
             if (columnName in objectMetadataMap and
                 columnName not in disabledFields):
                 self.__createColumn(columnName, objectMetadataMap)
@@ -153,7 +153,7 @@ class TableView(ObjectCollectionView):
 ###############################################################################
 ### Callback functions registered by this class but invoked from other classes.
 
-    def _treeViewFocusInEvent(self, widget, event, data):
+    def _treeViewFocusInEvent(self, widget, unused1, unused2):
         if self.__hasFocus:
             # Work-around for some bug that makes the focus-out signal
             # disappear.
@@ -192,7 +192,7 @@ class TableView(ObjectCollectionView):
                 ]:
             env.widgets[widgetName].set_sensitive(True)
 
-    def _treeViewFocusOutEvent(self, widget, event, data):
+    def _treeViewFocusOutEvent(self, widget, unused1, unused2):
         self.__hasFocus = False
         for (widget, oid) in self._connectedOids:
             widget.disconnect(oid)
@@ -219,7 +219,7 @@ class TableView(ObjectCollectionView):
                 ]:
             env.widgets[widgetName].set_sensitive(False)
 
-    def _widgetSelectionChanged(self, selection, data):
+    def _widgetSelectionChanged(self, selection, unused):
         if not self.__selectionLocked:
             env.enter("TableView selection changed")
             self.__selectionLocked = True
@@ -232,7 +232,7 @@ class TableView(ObjectCollectionView):
             self.__selectionLocked = False
             env.exit("TableView selection changed")
 
-    def _onDragDataGet(self, widget, dragContext, selection, info, timestamp):
+    def _onDragDataGet(self, unused1, unused2, selection, unused3, unused4):
         selectedRows = []
         # TODO replace with "get_selected_rows()" when it is introduced in Pygtk 2.2 API
         self._viewWidget.get_selection().selected_foreach(lambda model,
@@ -249,7 +249,7 @@ class TableView(ObjectCollectionView):
             env.debug("Ignoring drag&drop when only one row is selected")
 
 
-    def _onDragDataReceived(self, treeview, dragContext, x, y, selection, info, eventtime):
+    def _onDragDataReceived(self, treeview, dragContext, x, y, selection, unused, eventtime):
         targetData = treeview.get_dest_row_at_pos(x, y)
         if selection.get_text() == None:
             dragContext.finish(False, False, eventtime)
@@ -367,28 +367,28 @@ class TableView(ObjectCollectionView):
         env.debug("Removed column " + columnName)
 
     def __removeColumnsAndUpdateLocation(self, columnNames=None):
-       # Remove columns and store their relative locations for next time
-       # they are re-created.
-       columnLocation = 0
-       for column in self._viewWidget.get_columns():
-           columnName = column.get_title()
-           # TODO Store the column width and reuse it when the column is
-           #      recreated. I don't know how to store the width since
-           #      column.get_width() return correct values for columns
-           #      containing a gtk.CellRendererPixbuf but only 0 for all
-           #      columns containing a gtk.CellRendererText. It is probably
-           #      a bug in gtk och pygtk. I have not yet reported the bug.
-           if columnNames is None or columnName in columnNames:
-               if columnName in self.__createdColumns:
-                   self.__removeColumn(columnName)
-                   self.__userChosenColumns[columnName] = columnLocation
-           columnLocation += 1
-
-    def __moveListItem(self, list, currentIndex, newIndex):
+        # Remove columns and store their relative locations for next time
+        # they are re-created.
+        columnLocation = 0
+        for column in self._viewWidget.get_columns():
+            columnName = column.get_title()
+            # TODO Store the column width and reuse it when the column is
+            #      recreated. I don't know how to store the width since
+            #      column.get_width() return correct values for columns
+            #      containing a gtk.CellRendererPixbuf but only 0 for all
+            #      columns containing a gtk.CellRendererText. It is probably
+            #      a bug in gtk och pygtk. I have not yet reported the bug.
+            if columnNames is None or columnName in columnNames:
+                if columnName in self.__createdColumns:
+                    self.__removeColumn(columnName)
+                    self.__userChosenColumns[columnName] = columnLocation
+            columnLocation += 1
+
+    def __moveListItem(self, lst, currentIndex, newIndex):
         if currentIndex == newIndex:
-            return list
+            return lst
         if currentIndex < newIndex:
             newIndex -= 1
-        movingChild = list[currentIndex]
-        del list[currentIndex]
-        return list[:newIndex] + [movingChild] + list[newIndex:]
+        movingChild = lst[currentIndex]
+        del lst[currentIndex]
+        return lst[:newIndex] + [movingChild] + lst[newIndex:]
index a5d1a22..f60ba4f 100644 (file)
@@ -336,7 +336,7 @@ class OutputGenerator(OutputEngine):
             pass
 
 
-    def preGeneration(self, _):
+    def preGeneration(self, unused):
         """Method called before generation of the output."""
         self.iconsdir = "@icons"
         self.makeDirectory(self.iconsdir)