From c0944d5df076135574f3c2178c582e0a6f1326ea Mon Sep 17 00:00:00 2001 From: Nick Hall Date: Sun, 8 Aug 2010 18:59:09 +0000 Subject: [PATCH] Tidy up warnings and change error to warning in flat model svn: r15688 --- src/gui/views/treemodels/flatbasemodel.py | 5 +++-- src/gui/views/treemodels/treebasemodel.py | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/gui/views/treemodels/flatbasemodel.py b/src/gui/views/treemodels/flatbasemodel.py index 8a1f40a5f..22235e05f 100644 --- a/src/gui/views/treemodels/flatbasemodel.py +++ b/src/gui/views/treemodels/flatbasemodel.py @@ -304,8 +304,9 @@ class FlatNodeMap(object): :Returns type: integer or None """ if srtkey_hndl[1] in self._hndl2index: - raise ValueError, 'Attempt to add row twice to the model (%s)' % \ - srtkey_hndl[1] + print ('WARNING: Attempt to add row twice to the model (%s)' % + srtkey_hndl[1]) + return if not self._identical: bisect.insort_left(self._fullhndl, srtkey_hndl) if allkeyonly: diff --git a/src/gui/views/treemodels/treebasemodel.py b/src/gui/views/treemodels/treebasemodel.py index f65bb858a..277bfb7a4 100644 --- a/src/gui/views/treemodels/treebasemodel.py +++ b/src/gui/views/treemodels/treebasemodel.py @@ -102,7 +102,8 @@ class Node(object): if not self.handle: self.handle = handle else: - print 'WARNING: attempt to add twice a node to the model' + print ('WARNING: Attempt to add handle twice to the node (%s)' % + handle) def add_child(self, node, nodemap): """ @@ -590,7 +591,7 @@ class TreeBaseModel(gtk.GenericTreeModel): Otherwise, a node should never be added twice! """ if not self.group_can_have_handle: - print ('WARINING: Attempt to add node twice to the model (%s: %s)' + print ('WARNING: Attempt to add node twice to the model (%s: %s)' % (str(parent), str(child))) return if handle: