Tidy up warnings and change error to warning in flat model

svn: r15688
This commit is contained in:
Nick Hall 2010-08-08 18:59:09 +00:00
parent 0fb8ef6da4
commit c0944d5df0
2 changed files with 6 additions and 4 deletions

View File

@ -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:

View File

@ -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: