if not "type" in layer_description:
raise InputError(""type" is not given in a layer description.")
if not "name" in layer_description:
raise InputError(""name" is not given in a layer description.")
if not layer_description["inputs"]:
raise InputError(""input" is not given in a layer description.")
layers.append(layer_description)
After Change
input_description = dict()
for field in fields[1:]:
parts = field.split("=", 1)
if len(parts) != 2:
raise InputError(
""field=value" expected but "{}" found in an input "
"description in "{}"."
.format(field, description_file.name))
variable, value = parts
input_description[variable] = value
if not "type" in input_description:
raise InputError(
""type" is not given in an input description in "{}"."
.format(description_file.name))
if not "name" in input_description:
raise InputError(
""name" is not given in an input description in "{}"."
.format(description_file.name))
inputs.append(input_description)
elif fields[0] == "layer":
layer_description = {"inputs": []}
for field in fields[1:]:
parts = field.split("=", 1)
if len(parts) != 2:
raise InputError(
""field=value" expected but "{}" found in a layer "
"description in "{}"."