From 628b6d1ac1655449b102fe645d7faf286ff71f8c Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Tue, 10 Aug 2010 11:09:00 -0400 Subject: [PATCH] Collapse None entries for Argument.count == -1 in the GUI --- hooke/ui/gui/__init__.py | 6 ++++++ 1 file changed, 6 insertions(+) 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 = [] -- 2.26.2