forked from M-Labs/artiq
1
0
Fork 0

pdq2: rename url parameter to device and require it

This commit is contained in:
Robert Jördens 2015-03-21 00:33:50 -06:00
parent 05781699b8
commit 8cb77b0336
1 changed files with 4 additions and 5 deletions

View File

@ -11,10 +11,9 @@ def get_argparser():
parser = argparse.ArgumentParser(description="PDQ2 controller") parser = argparse.ArgumentParser(description="PDQ2 controller")
simple_network_args(parser, 3252) simple_network_args(parser, 3252)
parser.add_argument( parser.add_argument(
"-u", "--url", default="hwgrep://", "-d", "--device", required=True, help="device url/path/name")
help="device url [%(default)s]")
parser.add_argument( parser.add_argument(
"-d", "--dump", default=None, "-u", "--dump", default=None,
help="file to dump pdq2 data into, for later simulation") help="file to dump pdq2 data into, for later simulation")
verbosity_args(parser) verbosity_args(parser)
return parser return parser
@ -26,10 +25,10 @@ def main():
port = None port = None
if args.dump: if args.dump:
port = open(args.dump, "wb") port = open(args.dump, "wb")
dev = Pdq2(url=args.url, dev=port) dev = Pdq2(url=args.device, dev=port)
try: try:
simple_server_loop({"pdq2": dev}, args.bind, args.port, simple_server_loop({"pdq2": dev}, args.bind, args.port,
id_parameters="url=" + str(args.url)) id_parameters="device=" + str(args.device))
finally: finally:
dev.close() dev.close()