File tree 1 file changed +12
-0
lines changed
1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 53
53
)
54
54
from wireviz .wv_html import generate_html_output
55
55
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 } " )
56
67
57
68
@dataclass
58
69
class Harness :
@@ -68,6 +79,7 @@ def __post_init__(self):
68
79
self .additional_bom_items = []
69
80
70
81
def add_connector (self , name : str , * args , ** kwargs ) -> None :
82
+ check_old (f"Connector '{ name } '" , OLD_CONNECTOR_ATTR , kwargs )
71
83
self .connectors [name ] = Connector (name , * args , ** kwargs )
72
84
73
85
def add_cable (self , name : str , * args , ** kwargs ) -> None :
You can’t perform that action at this time.
0 commit comments