commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] [gnuradio] 07/10: grc: add description to the optparse


From: git
Subject: [Commit-gnuradio] [gnuradio] 07/10: grc: add description to the optparse call
Date: Thu, 14 Apr 2016 20:43:08 +0000 (UTC)

This is an automated email from the git hooks/post-receive script.

jcorgan pushed a commit to branch master
in repository gnuradio.

commit 79f6dc8b3e1d63efb514b3704c7b0ca60aa46c2e
Author: Chris Kuethe <address@hidden>
Date:   Mon Apr 11 19:32:00 2016 -0700

    grc: add description to the optparse call
    
    this allows the "Description" field from the GRC Options block to
    set the program description to something helpful when you run
    ./my_gnuradio_program.py --help
---
 grc/python/flow_graph.tmpl | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/grc/python/flow_graph.tmpl b/grc/python/flow_graph.tmpl
index bd8025b..ecdb893 100644
--- a/grc/python/flow_graph.tmpl
+++ b/grc/python/flow_graph.tmpl
@@ -274,8 +274,8 @@ gr.io_signaturev($(len($io_sigs)), $(len($io_sigs)), [$(', 
'.join($size_strs))])
         self.settings = Qt.QSettings("GNU Radio", "$class_name")
         self.settings.setValue("geometry", self.saveGeometry())
         event.accept()
-
     #if $flow_graph.get_option('qt_qss_theme')
+
     def setStyleSheetFromFile(self, filename):
         try:
             if not os.path.exists(filename):
@@ -336,7 +336,12 @@ $short_id#slurp
 
 
 def argument_parser():
-    parser = OptionParser(option_class=eng_option, usage="%prog: [options]")
+    #set $desc_args = 'usage="%prog: [options]", option_class=eng_option'
+    #if $flow_graph.get_option('description')
+        #set $desc_args += ', description=description'
+    description = $repr($flow_graph.get_option('description'))
+    #end if
+    parser = OptionParser($desc_args)
     #for $param in $parameters
         #set $type = $param.get_param('type').get_value()
         #if $type



reply via email to

[Prev in Thread] Current Thread [Next in Thread]