mirror of https://github.com/m-labs/artiq.git
pdq2: rename url parameter to device and require it
This commit is contained in:
parent
05781699b8
commit
8cb77b0336
|
@ -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()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue