forked from M-Labs/artiq
afws_client: improve compatibility with older versions of prettytable. Closes #2264
This commit is contained in:
parent
6640bf0e82
commit
c0a6252e77
|
@ -146,7 +146,8 @@ class Client:
|
||||||
print(error_msg)
|
print(error_msg)
|
||||||
table = PrettyTable()
|
table = PrettyTable()
|
||||||
table.field_names = ["Variant", "Expiry date"]
|
table.field_names = ["Variant", "Expiry date"]
|
||||||
table.add_rows(variants)
|
for variant in variants:
|
||||||
|
table.add_row(variant)
|
||||||
print(table)
|
print(table)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
return variants[0][0]
|
return variants[0][0]
|
||||||
|
@ -244,10 +245,11 @@ def main():
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
zip_unarchive(contents, args.directory)
|
zip_unarchive(contents, args.directory)
|
||||||
elif args.action == "get_variants":
|
elif args.action == "get_variants":
|
||||||
data = client.get_variants()
|
variants = client.get_variants()
|
||||||
table = PrettyTable()
|
table = PrettyTable()
|
||||||
table.field_names = ["Variant", "Expiry date"]
|
table.field_names = ["Variant", "Expiry date"]
|
||||||
table.add_rows(data)
|
for variant in variants:
|
||||||
|
table.add_row(variant)
|
||||||
print(table)
|
print(table)
|
||||||
elif args.action == "get_json":
|
elif args.action == "get_json":
|
||||||
if args.variant:
|
if args.variant:
|
||||||
|
|
Loading…
Reference in New Issue