[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 02/08: examples: plot_flops use ArgumentPar
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 02/08: examples: plot_flops use ArgumentParser |
Date: |
Wed, 11 May 2016 17:41:08 +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 2b602da7ea6a7ce005e8e9ef371278bcd9ff9ed9
Author: Jiří Pinkava <address@hidden>
Date: Sat Oct 10 20:44:05 2015 +0200
examples: plot_flops use ArgumentParser
---
gnuradio-runtime/examples/mp-sched/plot_flops.py | 15 ++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/gnuradio-runtime/examples/mp-sched/plot_flops.py
b/gnuradio-runtime/examples/mp-sched/plot_flops.py
index d9d810a..c80820b 100755
--- a/gnuradio-runtime/examples/mp-sched/plot_flops.py
+++ b/gnuradio-runtime/examples/mp-sched/plot_flops.py
@@ -28,7 +28,7 @@ import re
import sys
import os
import tempfile
-from optparse import OptionParser
+from argparse import ArgumentParser
def parse_file(input_filename, output):
@@ -84,14 +84,11 @@ def handle_file(input_filename):
def main():
- usage = "usage: %prog [options] file.dat"
- parser = OptionParser(usage=usage)
- (options, args) = parser.parse_args()
- if len(args) != 1:
- parser.print_help()
- raise SystemExit, 1
-
- handle_file(args[0])
+ parser = ArgumentParser()
+ parser.add_argument('file', help='Input file', nargs=1)
+ args = parser.parse_args()
+
+ handle_file(args.file[0])
if __name__ == '__main__':
- [Commit-gnuradio] [gnuradio] branch next updated (493a19e -> 02b6805), git, 2016/05/11
- [Commit-gnuradio] [gnuradio] 01/08: examples: affinity_set use ArgParse, git, 2016/05/11
- [Commit-gnuradio] [gnuradio] 07/08: Merge branch 'master' into next, git, 2016/05/11
- [Commit-gnuradio] [gnuradio] 08/08: Merge remote-tracking branch 'pinkavaj/argparse-01' into next, git, 2016/05/11
- [Commit-gnuradio] [gnuradio] 03/08: grc: gnuradio-companion use ArgumentParser, git, 2016/05/11
- [Commit-gnuradio] [gnuradio] 06/08: examples: run_synthetic.py use ArgumentParser, git, 2016/05/11
- [Commit-gnuradio] [gnuradio] 04/08: grc: flow graph templates use ArgumentParser, git, 2016/05/11
- [Commit-gnuradio] [gnuradio] 02/08: examples: plot_flops use ArgumentParser,
git <=
- [Commit-gnuradio] [gnuradio] 05/08: grcc: replace OptionParser by ArgumentParser, git, 2016/05/11