#!/usr/bin/env python
-
##
## This file is part of the sigrok-meter project.
##
parser = argparse.ArgumentParser(
description='Simple sigrok GUI for multimeters and dataloggers.',
epilog=textwrap.dedent('''\
- The DRIVER string is the same as for sigrok-cli(1). The nth
- CONFIG is applied to the nth DRIVER. If there are more drivers
- than configs, the remaining drivers use the default configuration.
+ The DRIVER string is the same as for sigrok-cli(1). Multiple
+ DRIVER and CONFIG items can be supplied. The nth CONFIG is applied
+ to the nth DRIVER. If there are more drivers than configs, the
+ remaining drivers use the default configuration.
- examples:
+ Examples:
%(prog)s --driver tecpel-dmm-8061-ser:conn=/dev/ttyUSB0
%(prog)s --driver demo:analog_channels=1 \\
--config samplerate=10
+
+ %(prog)s --driver voltcraft-k204:conn=/dev/ttyUSB0 \\
+ --driver uni-t-ut61d:conn=1a86.e008 \\
+ --driver uni-t-ut61e-ser:conn=/dev/ttyUSB1
'''),
formatter_class=argparse.RawDescriptionHelpFormatter)
args = parser.parse_args()
if len(args.config) > len(args.driver):
- sys.exit('error: more configurations than drivers given')
+ sys.exit('Error: More configurations than drivers given.')
- # merge drivers and configurations into a list of tuples
+ # Merge drivers and configurations into a list of tuples.
setattr(args, 'drivers', [])
if not args.driver:
args.drivers = default_drivers
- sys.stderr.write('no driver given, using demo driver\n')
+ sys.stderr.write('No driver given, using demo driver.\n')
if args.driver:
args.config.extend([''] * (len(args.driver) - len(args.config)))
args.drivers = zip(args.driver, args.config)
loglevel = sr.LogLevel.get(args.loglevel)
context.log_level = loglevel
except:
- sys.exit('error: invalid log level')
+ sys.exit('Error: invalid log level.')
app = QtGui.QApplication([])
s = mainwindow.MainWindow(context, args.drivers)