diff options
Diffstat (limited to 'grc/data')
-rw-r--r-- | grc/data/platforms/python/flow_graph.tmpl | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/grc/data/platforms/python/flow_graph.tmpl b/grc/data/platforms/python/flow_graph.tmpl index a9256574c..3589e564c 100644 --- a/grc/data/platforms/python/flow_graph.tmpl +++ b/grc/data/platforms/python/flow_graph.tmpl @@ -179,15 +179,17 @@ class $(class_name)(gr.hier_block2): ######################################################## #if $generate_options != 'hb' if __name__ == '__main__': - parser = OptionParser() #set $args = list() - #for $param in $parameters - #if $param.get_param('type').get_value() + #if $parameters + parser = OptionParser() + #for $param in $parameters + #if $param.get_param('type').get_value() parser.add_option("--$param.get_id()", dest="$param.get_id()", type="$param.get_param('type').get_value()", default=$param.get_make()) - #silent $args.append('%s=options.%s'%($param.get_id(), $param.get_id())) - #end if - #end for + #silent $args.append('%s=options.%s'%($param.get_id(), $param.get_id())) + #end if + #end for (options, args) = parser.parse_args() + #end if tb = $(class_name)($(', '.join($args))) #if $generate_options == 'wx_gui' tb.Run() |