Allow newer filters to add items to older filters, and still work

svn: r16205
This commit is contained in:
Doug Blank 2010-11-18 12:22:06 +00:00
parent b7bebc856d
commit 2b5c8814bd
2 changed files with 14 additions and 5 deletions

View File

@ -28,6 +28,14 @@
#-------------------------------------------------------------------------
from gen.ggettext import gettext as _
#-------------------------------------------------------------------------
#
# enable logging for error handling
#
#-------------------------------------------------------------------------
import logging
log = logging.getLogger(".")
#-------------------------------------------------------------------------
#
# Rule
@ -88,10 +96,10 @@ class Rule(object):
def set_list(self, arg):
assert isinstance(arg, list) or arg is None, "Argument is not a list"
assert len(arg) == len(self.labels), \
"ERROR: Number of arguments does not match number of labels.\n"\
" list: %s\n"\
" labels: %s" % (arg,self.labels)
if len(arg) != len(self.labels):
log.warning(("Number of arguments does not match number of labels.\n" +
" list: %s\n" +
" labels: %s") % (arg,self.labels))
self.list = arg
def values(self):

View File

@ -569,7 +569,8 @@ class EditRule(ManagedWindow.ManagedWindow):
(class_obj, vallist, tlist) = self.page[page]
r = self.active_rule.values()
for i in range(0, len(tlist)):
tlist[i].set_text(r[i])
if i < len(r):
tlist[i].set_text(r[i])
self.selection.connect('changed', self.on_node_selected)
self.rname.connect('button-press-event', self._button_press)