23 from gettext
import gettext
as _
27 for schematic
in netlist.schematics:
28 for component
in schematic.components:
35 if graphical_attribs
and graphical_attribs[0] !=
'1':
36 component.error(_(
"invalid value for graphical= attribute"))
38 component.is_graphical = \
39 component.get_attribute(
'graphical',
None) ==
'1'
41 if component.is_graphical
and component.composite_sources:
44 component.warn(_(
"source= is set for graphical component"))
45 component.composite_sources = []
48 for net
in netlist.nets:
49 net.graphical_component_pins = []
51 remove_components = set()
53 for component
in netlist.components:
54 if not component.blueprint.is_graphical:
58 remove_components.add(component)
59 component.sheet.components.remove(component)
60 del component.sheet.components_by_blueprint[component.blueprint]
62 for cpin
in component.cpins:
64 cpin.local_net.cpins.remove(cpin)
65 cpin.local_net.net.component_pins.remove(cpin)
68 cpin.local_net.net.graphical_component_pins.append(cpin)
70 netlist.components = [component
for component
in netlist.components
71 if component
not in remove_components]
Attribute parsing and lookup.
def search_all
Search both attached and inherited attributes of a component for an attribute name and return matchin...