From: W. Trevor King Date: Tue, 10 Aug 2010 15:09:00 +0000 (-0400) Subject: Collapse None entries for Argument.count == -1 in the GUI X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=628b6d1ac1655449b102fe645d7faf286ff71f8c;p=hooke.git Collapse None entries for Argument.count == -1 in the GUI --- diff --git a/hooke/ui/gui/__init__.py b/hooke/ui/gui/__init__.py index 6d17a7c..1c646f4 100644 --- a/hooke/ui/gui/__init__.py +++ b/hooke/ui/gui/__init__.py @@ -338,6 +338,12 @@ class HookeFrame (wx.Frame): assert keys == range(count), keys args[arg.name] = [args[arg.name][i] for i in range(count)] + if arg.count == -1: + while (len(args[arg.name]) > 0 + and args[arg.name][-1] == None): + args[arg.name].pop() + if len(args[arg.name]) == 0: + args[arg.name] = arg.default self.log.debug('executing %s with %s' % (command.name, args)) self.inqueue.put(CommandMessage(command, args)) results = []