From 4e974dc0e14376cb393ab31311b1f57dc18fb71f Mon Sep 17 00:00:00 2001 From: Benny Malengier Date: Mon, 29 Jun 2009 18:15:28 +0000 Subject: [PATCH] add missing Makefile and suggestions by Gerald svn: r12730 --- src/gui/views/treemodels/Makefile.am | 25 +++++++++++++++++++++++ src/gui/views/treemodels/flatbasemodel.py | 6 ++---- 2 files changed, 27 insertions(+), 4 deletions(-) create mode 100644 src/gui/views/treemodels/Makefile.am diff --git a/src/gui/views/treemodels/Makefile.am b/src/gui/views/treemodels/Makefile.am new file mode 100644 index 000000000..421da5e6b --- /dev/null +++ b/src/gui/views/treemodels/Makefile.am @@ -0,0 +1,25 @@ +# This is the src/DataViews level Makefile for Gramps +# We could use GNU make's ':=' syntax for nice wildcard use, +# but that is not necessarily portable. +# If not using GNU make, then list all .py files individually + +pkgdatadir = $(datadir)/@PACKAGE@/treemodels + +pkgdata_PYTHON = \ + __init__.py \ + flatbasemodel.py + +pkgpyexecdir = @pkgpyexecdir@/treemodels +pkgpythondir = @pkgpythondir@/treemodels + +# Clean up all the byte-compiled files +MOSTLYCLEANFILES = *pyc *pyo + +GRAMPS_PY_MODPATH = "../" + +pycheck: + (export PYTHONPATH=$(GRAMPS_PY_MODPATH); \ + pychecker $(pkgdata_PYTHON)); + +pylint: + PYTHONPATH=$(GRAMPS_PY_MODPATH) pylint $(pkgdata_PYTHON) > pylint.out diff --git a/src/gui/views/treemodels/flatbasemodel.py b/src/gui/views/treemodels/flatbasemodel.py index 90de9bed5..85442a09e 100644 --- a/src/gui/views/treemodels/flatbasemodel.py +++ b/src/gui/views/treemodels/flatbasemodel.py @@ -57,7 +57,6 @@ import locale import logging import bisect import time -import copy _LOG = logging.getLogger(".gui.basetreemodel") @@ -524,8 +523,7 @@ class FlatBaseModel(gtk.GenericTreeModel): if self.search: ident = False if ignore is None: - tmp = copy.copy(allkeys) - dlist = self.search.apply(self.db, tmp, tupleind=1) + dlist = self.search.apply(self.db, allkeys, tupleind=1) else: dlist = self.search.apply(self.db, [ k for k in allkeys if k[1] != ignore], @@ -616,7 +614,7 @@ class FlatBaseModel(gtk.GenericTreeModel): """ try: return self.node_map.get_handle(path[0]) - except: + except IndexError: return None def on_get_value(self, handle, col):