diff options
author | Tom Rondeau | 2012-12-12 18:45:53 -0500 |
---|---|---|
committer | Tom Rondeau | 2012-12-12 18:45:53 -0500 |
commit | f1de74af9270235126b67e9507111df5752a3e5c (patch) | |
tree | 61bb10c9a73d03d1e9016d9c2de84e6e2c28aeca /gr-utils/src/python | |
parent | 9ac98067a8529d80501ab3c8122b3ce11e896657 (diff) | |
download | gnuradio-f1de74af9270235126b67e9507111df5752a3e5c.tar.gz gnuradio-f1de74af9270235126b67e9507111df5752a3e5c.tar.bz2 gnuradio-f1de74af9270235126b67e9507111df5752a3e5c.zip |
core: add new options to GRC for file_meta_sink.
Also updates gr_read_file_metadata to add a -D option that properly parses a detached header.
Diffstat (limited to 'gr-utils/src/python')
-rw-r--r-- | gr-utils/src/python/gr_read_file_metadata | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/gr-utils/src/python/gr_read_file_metadata b/gr-utils/src/python/gr_read_file_metadata index ba530ca54..efbf8d15d 100644 --- a/gr-utils/src/python/gr_read_file_metadata +++ b/gr-utils/src/python/gr_read_file_metadata @@ -26,7 +26,7 @@ from optparse import OptionParser from gnuradio import gr from gnuradio import parse_file_metadata -def main(filename): +def main(filename, detached=False): handle = open(filename, "rb") nheaders = 0 @@ -63,7 +63,9 @@ def main(filename): extra_info = parse_file_metadata.parse_extra_dict(extra, info, True) nheaders += 1 - nread += info['nbytes'] + parse_file_metadata.HEADER_LENGTH + info["extra_len"] + nread += parse_file_metadata.HEADER_LENGTH + info["extra_len"] + if(not detached): + nread += info['nbytes'] handle.seek(nread, 0) print "\n\n" @@ -73,6 +75,8 @@ if __name__ == "__main__": parser = OptionParser(conflict_handler="resolve", usage=usage, description=description) + parser.add_option("-D", "--detached", action="store_true", default=False, + help="Used if header is detached.") (options, args) = parser.parse_args () if(len(args) < 1): @@ -80,4 +84,4 @@ if __name__ == "__main__": sys.exit(1) filename = args[0] - main(filename) + main(filename, options.detached) |