Error checking in sch.Component.addField
Created by: airwoodix
Hello,
these commits fix the error checking TODOs on sch.Component.addField
:
-
name
andref
are made compulsory keyword-only arguments - invalid additional fields are silently ignored
The function interface changed from a single dictionary to keyword based. This has at least two advantages: self-documentation is better and required arguments are explicit.
The ensure_quoted
function is there because it is more natural to write comp.addField(name="foo", ref="bar")
than comp.addField(name='"foo"', ref='"bar"')
.
The call to addField
in the add_part_number.py
script is modified accordingly.
Edited by Joel Guittet