diff options
author | Josh Blum <josh@joshknows.com> | 2011-04-29 15:56:44 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2011-04-29 15:56:44 -0700 |
commit | 1e57d1c0496ca6263652cd84c9eeacafde833915 (patch) | |
tree | e7b6557b55ee61458b11d3e5911eaeb5b809ac08 /host/utils/usrp2_card_burner.py | |
parent | 0479162ae39d3d4708ab332107c25f4710275232 (diff) | |
download | uhd-1e57d1c0496ca6263652cd84c9eeacafde833915.tar.gz uhd-1e57d1c0496ca6263652cd84c9eeacafde833915.tar.bz2 uhd-1e57d1c0496ca6263652cd84c9eeacafde833915.zip |
usrp2: move card burner code out of get_options so get_options can be used by the gui without interference
Diffstat (limited to 'host/utils/usrp2_card_burner.py')
-rwxr-xr-x | host/utils/usrp2_card_burner.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/host/utils/usrp2_card_burner.py b/host/utils/usrp2_card_burner.py index ae6198eef..26adb91c7 100755 --- a/host/utils/usrp2_card_burner.py +++ b/host/utils/usrp2_card_burner.py @@ -237,10 +237,17 @@ def get_options(): parser.add_option("--force", action="store_true", help="override safety check", default=False) (options, args) = parser.parse_args() + return options + +######################################################################## +# main +######################################################################## +if __name__=='__main__': + options = get_options() device_hints = get_raw_device_hints() show_listing = options.list - if not show_listing and not options.force and options.dev not in device_hints: + if not show_listing and not options.force and options.dev and options.dev not in device_hints: print('The device "%s" was not in the list of possible raw devices.'%options.dev) print('The card burner application will now exit without burning your card.') print('To override this safety check, specify the --force option.\n') @@ -251,12 +258,5 @@ def get_options(): print(' ' + '\n '.join(device_hints)) exit() - return options - -######################################################################## -# main -######################################################################## -if __name__=='__main__': - options = get_options() if not options.dev: raise Exception('no raw device path specified') print(burn_sd_card(dev=options.dev, fw=options.fw, fpga=options.fpga)) |