File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 5353)
5454from wireviz .wv_html import generate_html_output
5555
56+ OLD_CONNECTOR_ATTR = {
57+ "pinout" : "was renamed to 'pinlabels' in v0.2" ,
58+ "pinnumbers" : "was renamed to 'pins' in v0.2" ,
59+ "autogenerate" : "is replaced with new syntax in v0.4" ,
60+ }
61+
62+ def check_old (node : str , old_attr : dict , args : dict ) -> None :
63+ """Raise exception for any outdated attributes in args."""
64+ for attr , descr in old_attr .items ():
65+ if attr in args :
66+ raise ValueError (f"'{ attr } ' in { node } : '{ attr } ' { descr } " )
5667
5768@dataclass
5869class Harness :
@@ -68,6 +79,7 @@ def __post_init__(self):
6879 self .additional_bom_items = []
6980
7081 def add_connector (self , name : str , * args , ** kwargs ) -> None :
82+ check_old (f"Connector '{ name } '" , OLD_CONNECTOR_ATTR , kwargs )
7183 self .connectors [name ] = Connector (name , * args , ** kwargs )
7284
7385 def add_cable (self , name : str , * args , ** kwargs ) -> None :
You can’t perform that action at this time.
0 commit comments