[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 07/13: utils: gr_plot_const replace OptionP
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 07/13: utils: gr_plot_const replace OptionParser by ArgumentParser |
Date: |
Mon, 1 Aug 2016 21:58:58 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
jcorgan pushed a commit to branch next
in repository gnuradio.
commit c520bb0153352efcff5526749aa3906ee194ce5a
Author: Jiří Pinkava <address@hidden>
Date: Sun Jun 26 13:04:42 2016 +0200
utils: gr_plot_const replace OptionParser by ArgumentParser
---
gr-utils/python/utils/gr_plot_const | 30 +++++++++++++-----------------
1 file changed, 13 insertions(+), 17 deletions(-)
diff --git a/gr-utils/python/utils/gr_plot_const
b/gr-utils/python/utils/gr_plot_const
index e2580dd..28f6a54 100755
--- a/gr-utils/python/utils/gr_plot_const
+++ b/gr-utils/python/utils/gr_plot_const
@@ -33,7 +33,7 @@ except ImportError:
print "Please install Matplotlib to run this script
(http://matplotlib.sourceforge.net/)"
raise SystemExit, 1
-from optparse import OptionParser
+from argparse import ArgumentParser
class draw_constellation:
def __init__(self, filename, options):
@@ -221,24 +221,20 @@ def find(item_in, list_search):
def main():
- usage="%prog: [options] input_filename"
description = "Takes a GNU Radio complex binary file and displays the I&Q
data versus time and the constellation plot (I vs. Q). You can set the block
size to specify how many points to read in at a time and the start position in
the file. By default, the system assumes a sample rate of 1, so in time, each
sample is plotted versus the sample number. To set a true time axis, set the
sample rate (-R or --sample-rate) to the sample rate used when capturing the
samples."
- parser = OptionParser(conflict_handler="resolve", usage=usage,
description=description)
- parser.add_option("-B", "--block", type="int", default=1000,
- help="Specify the block size [default=%default]")
- parser.add_option("-s", "--start", type="int", default=0,
- help="Specify where to start in the file
[default=%default]")
- parser.add_option("-R", "--sample-rate", type="float", default=1.0,
- help="Set the sampler rate of the data
[default=%default]")
-
- (options, args) = parser.parse_args ()
- if len(args) != 1:
- parser.print_help()
- raise SystemExit, 1
- filename = args[0]
-
- dc = draw_constellation(filename, options)
+ parser = ArgumentParser(conflict_handler="resolve",
description=description)
+ parser.add_argument("-B", "--block", type=int, default=1000,
+ help="Specify the block size [default=%(default)r]")
+ parser.add_argument("-s", "--start", type=int, default=0,
+ help="Specify where to start in the file
[default=%(default)r]")
+ parser.add_argument("-R", "--sample-rate", type=float, default=1.0,
+ help="Set the sampler rate of the data
[default=%(default)r]")
+ parser.add_argument("file", metavar="FILE", nargs=1,
+ help="Input file with complex samples")
+ args = parser.parse_args()
+
+ dc = draw_constellation(args.file[0], args)
if __name__ == "__main__":
try:
- [Commit-gnuradio] [gnuradio] branch next updated (85012bb -> cfda705), git, 2016/08/01
- [Commit-gnuradio] [gnuradio] 13/13: Merge remote-tracking branch 'pinkavaj/argparse-modtool-02' into next, git, 2016/08/01
- [Commit-gnuradio] [gnuradio] 05/13: utils: plot_data - remove unused import, git, 2016/08/01
- [Commit-gnuradio] [gnuradio] 06/13: utils: gr_plot_char - replace OptionParser by ArgumentParser, git, 2016/08/01
- [Commit-gnuradio] [gnuradio] 07/13: utils: gr_plot_const replace OptionParser by ArgumentParser,
git <=
- [Commit-gnuradio] [gnuradio] 08/13: utils: gr_read_file_metadata replace OptionParser by ArgumentParser, git, 2016/08/01
- [Commit-gnuradio] [gnuradio] 03/13: filter: fir_filter_ccc.py - replace OptionParser by ArgumentParser, git, 2016/08/01
- [Commit-gnuradio] [gnuradio] 02/13: filter: fft_filter_ccc - replace OptionParser by ArgumentParser, git, 2016/08/01
- [Commit-gnuradio] [gnuradio] 10/13: modtool: replace OptionParser by ArgumentParser, git, 2016/08/01
- [Commit-gnuradio] [gnuradio] 09/13: qtgui: plot_base remove unused imports, git, 2016/08/01
- [Commit-gnuradio] [gnuradio] 01/13: fec: polar_channel_construction replace OptionParser by ArgumentParser + cleanup, git, 2016/08/01
- [Commit-gnuradio] [gnuradio] 11/13: Merge branch 'master' into next, git, 2016/08/01
- [Commit-gnuradio] [gnuradio] 12/13: Merge remote-tracking branch 'pinkavaj/argparse-filter-01' into next, git, 2016/08/01
- [Commit-gnuradio] [gnuradio] 04/13: filter: fir_filter_fff.py replace OptionParser by ArgumentParser, git, 2016/08/01