forked from M-Labs/artiq
json: factor handling of deprecated 'base'
This commit is contained in:
parent
20d4712815
commit
a792bc5456
|
@ -32,4 +32,7 @@ def load(description_path):
|
||||||
global validator
|
global validator
|
||||||
validator.validate(result)
|
validator.validate(result)
|
||||||
|
|
||||||
|
if result["base"] != "use_drtio_role":
|
||||||
|
result["drtio_role"] = result["base"]
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
|
@ -687,14 +687,10 @@ def main():
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
primary_description = jsondesc.load(args.primary_description)
|
primary_description = jsondesc.load(args.primary_description)
|
||||||
if primary_description["base"] != "use_drtio_role":
|
|
||||||
primary_description["drtio_role"] = primary_description["base"]
|
|
||||||
|
|
||||||
satellites = []
|
satellites = []
|
||||||
for destination, description_path in args.satellite:
|
for destination, description_path in args.satellite:
|
||||||
satellite_description = jsondesc.load(description_path)
|
satellite_description = jsondesc.load(description_path)
|
||||||
if satellite_description["base"] != "use_drtio_role":
|
|
||||||
satellite_description["drtio_role"] = satellite_description["base"]
|
|
||||||
satellites.append((int(destination, 0), satellite_description))
|
satellites.append((int(destination, 0), satellite_description))
|
||||||
|
|
||||||
if args.output is not None:
|
if args.output is not None:
|
||||||
|
|
|
@ -150,8 +150,6 @@ def main():
|
||||||
help="Override ROM identifier")
|
help="Override ROM identifier")
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
description = jsondesc.load(args.description)
|
description = jsondesc.load(args.description)
|
||||||
if description["base"] != "use_drtio_role":
|
|
||||||
description["drtio_role"] = description["base"]
|
|
||||||
|
|
||||||
min_artiq_version = description.get("min_artiq_version", "0")
|
min_artiq_version = description.get("min_artiq_version", "0")
|
||||||
if Version(artiq_version) < Version(min_artiq_version):
|
if Version(artiq_version) < Version(min_artiq_version):
|
||||||
|
|
Loading…
Reference in New Issue