Start coming up with type annotation in naming convention. Signed-off-by: Tim 'mithro' Ansell <me@mith.ro>
diff --git a/v2x/lib/mux.py b/v2x/lib/mux.py index 797eca9..6d5523e 100644 --- a/v2x/lib/mux.py +++ b/v2x/lib/mux.py
@@ -86,7 +86,18 @@ pb_type.xml for requested mux """ - assert mux_name, "No mux_name provided!" + if mux_type == MuxType.LOGIC: + if '-' not in mux_name: + mux_name = 'BEL_MX-'+mux_name + else: + assert mux_name.startswith('BEL_MX-'), "Provided mux name has type {} but not BEL_MX!".format(mux_name) + elif mux_type == MuxType.ROUTING: + if '-' not in mux_name: + mux_name = 'BEL_RX-'+mux_name + else: + assert mux_name.startswith('BEL_RX-'), "Provided mux name has type {} but not BEL_MX!".format(mux_name) + else: + assert False, "Unknown type {}".format(mux_type) pb_type_xml = ET.Element( 'pb_type', {