From 76019d92265a85197d9d6bccfbbdb725a58d8d5a Mon Sep 17 00:00:00 2001 From: jblum Date: Thu, 22 Jan 2009 01:00:12 +0000 Subject: params must exist for option parser git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@10283 221aa14e-8319-0410-a670-987f0aec2ac5 --- grc/data/platforms/python/flow_graph.tmpl | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'grc/data/platforms') 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() -- cgit