Classes for Schematic Files (.sch)¶
These classes are used only within Eagle schematic files (.sch).
SchematicFile¶
-
class
Swoop.SchematicFile[source]¶ Bases:
Swoop.Swoop.EagleFileClass representing the contents of a <eagle> tag in Eagle files.
Attributes:
version
Collections:
grid: SingletonGridobject.schematic: SingletonSchematicobject.description: SingletonDescriptionobject.compatibility: SingletonCompatibilityobject.setting: List ofSettingobjects.sheet: List ofSheetobjects.approved: List ofApprovedobjects.layer: Map ofLayerobjects indexed by theirname.library: Map ofLibraryobjects indexed by theirname.attribute: Map ofAttributeobjects indexed by theirname.variantdef: Map ofVariantdefobjects indexed by theirname.class: Map ofClassobjects indexed by theirname.module: Map ofModuleobjects indexed by theirname.part: Map ofPartobjects indexed by theirname.
-
add_approved(s)[source]¶ Add a
Approvedto theapproved_errorsof thisSchematicFile.Parameters: s – The Approvedto add.Return type: self
-
add_attribute(s)[source]¶ Add a
Attributeto theattributesof thisSchematicFile.Parameters: s – The Attributeto add.Return type: self
-
add_class(s)[source]¶ Add a
Classto theclassesof thisSchematicFile.Parameters: s – The Classto add.Return type: self
-
add_library(s)[source]¶ Add a
Libraryto thelibrariesof thisSchematicFile.Parameters: s – The Libraryto add.Return type: self
-
add_module(s)[source]¶ Add a
Moduleto themodulesof thisSchematicFile.Parameters: s – The Moduleto add.Return type: self
-
add_part(s)[source]¶ Add a
Partto thepartsof thisSchematicFile.Parameters: s – The Partto add.Return type: self
-
add_setting(s)[source]¶ Add a
Settingto thesettingsof thisSchematicFile.Parameters: s – The Settingto add.Return type: self
-
add_sheet(s)[source]¶ Add a
Sheetto thesheetsof thisSchematicFile.Parameters: s – The Sheetto add.Return type: self
-
add_variantdef(s)[source]¶ Add a
Variantdefto thevariantdefsof thisSchematicFile.Parameters: s – The Variantdefto add.Return type: self
-
clear_approved_errors()[source]¶ Remove all the
Approvedobjects from theapproved_errorsof thisSchematicFile.Return type: self
-
clear_attributes()[source]¶ Remove all the
Attributeobjects from theattributesof thisSchematicFile.Return type: self
-
clear_classes()[source]¶ Remove all the
Classobjects from theclassesof thisSchematicFile.Return type: self
-
clear_libraries()[source]¶ Remove all the
Libraryobjects from thelibrariesof thisSchematicFile.Return type: self
-
clear_modules()[source]¶ Remove all the
Moduleobjects from themodulesof thisSchematicFile.Return type: self
-
clear_parts()[source]¶ Remove all the
Partobjects from thepartsof thisSchematicFile.Return type: self
-
clear_settings()[source]¶ Remove all the
Settingobjects from thesettingsof thisSchematicFile.Return type: self
-
clear_sheets()[source]¶ Remove all the
Sheetobjects from thesheetsof thisSchematicFile.Return type: self
-
clear_variantdefs()[source]¶ Remove all the
Variantdefobjects from thevariantdefsof thisSchematicFile.Return type: self
-
clone()[source]¶ Recursively clone this
SchematicFile. It will be identical to the original, but it’s parent will beNone.Return type: SchematicFile
-
dump(indent='', increment=' ')[source]¶ Recursive debug dump.
Parameters: - indent – Indentation string. The output will be indented by this much.
- increment – This will be appendeded to
indenton recursive invocations.
Return type: None
-
get_approved_errors(attrs=None, type=None)[source]¶ Return (and possibly filter) items in the the
approved_errorslist ofApprovedobjects for thisSchematicFile.This functions provides a mechanism for filtering the items as well. The keys in
attrsare taken as attributes names and the values are requested values. Items in the list that have all the requested values for the corresponding attributes will be returned.A if
typeis notNone, the item will match if it is an instance of the type provided.Parameters: - attrs – A set of key-value pairs that represent a filter to apply to the item’s attributes.
- type – A type to filter on. Only items that are an instance of this type will be returned.
Returns: A List of
ApprovedobjectsReturn type: List of
Approvedobjects
-
get_attribute(key)[source]¶ Lookup and return a
Attributefrom theattributesof thisSchematicFile.Parameters: key – A strto use for the lookup. The lookup uses thenameof theAttributeobjects.Return type: A Attributeobject orNone, if there is no such item.
-
get_attributes(attrs=None, type=None)[source]¶ Return (and possibly filter) items in the the
attributesmap ofAttributeobjects for thisSchematicFile.This functions provides a mechanism for filtering the items as well. The keys in
attrsare taken as attributes names and the values are requested values. Items in the list that have all the requested values for the corresponding attributes will be returned.A if
typeis notNone, the item will match if it is an instance of the type provided.Parameters: - attrs – A set of key-value pairs that represent a filter to apply to the item’s attributes.
- type – A type to filter on. Only items that are an instance of this type will be returned.
Returns: A List of
AttributeobjectsReturn type: List of
Attributeobjects
-
get_children()[source]¶ Get all the children of this
EagleFilePart.Return type: List of EagleFilePartobjects
-
get_class(key)[source]¶ Lookup and return a
Classfrom theclassesof thisSchematicFile.Parameters: key – A strto use for the lookup. The lookup uses thenameof theClassobjects.Return type: A Classobject orNone, if there is no such item.
-
get_classes(attrs=None, type=None)[source]¶ Return (and possibly filter) items in the the
classesmap ofClassobjects for thisSchematicFile.This functions provides a mechanism for filtering the items as well. The keys in
attrsare taken as attributes names and the values are requested values. Items in the list that have all the requested values for the corresponding attributes will be returned.A if
typeis notNone, the item will match if it is an instance of the type provided.Parameters: - attrs – A set of key-value pairs that represent a filter to apply to the item’s attributes.
- type – A type to filter on. Only items that are an instance of this type will be returned.
Returns: A List of
ClassobjectsReturn type: List of
Classobjects
-
get_compatibility()[source]¶ Get the compatibility from this
SchematicFile.Return type: Compatibilityobject
-
get_description()[source]¶ Get the description from this
SchematicFile.Return type: Descriptionobject
-
get_et()[source]¶ Generate a <eagle> element tree for a
SchematicFile.Return type: ElementTree.
-
get_grid()[source]¶ Get the grid from this
SchematicFile.Return type: Gridobject
-
get_libraries(attrs=None, type=None)[source]¶ Return (and possibly filter) items in the the
librariesmap ofLibraryobjects for thisSchematicFile.This functions provides a mechanism for filtering the items as well. The keys in
attrsare taken as attributes names and the values are requested values. Items in the list that have all the requested values for the corresponding attributes will be returned.A if
typeis notNone, the item will match if it is an instance of the type provided.Parameters: - attrs – A set of key-value pairs that represent a filter to apply to the item’s attributes.
- type – A type to filter on. Only items that are an instance of this type will be returned.
Returns: A List of
LibraryobjectsReturn type: List of
Libraryobjects
-
get_library(key)[source]¶ Lookup and return a
Libraryfrom thelibrariesof thisSchematicFile.Parameters: key – A strto use for the lookup. The lookup uses thenameof theLibraryobjects.Return type: A Libraryobject orNone, if there is no such item.
-
get_module(key)[source]¶ Lookup and return a
Modulefrom themodulesof thisSchematicFile.Parameters: key – A strto use for the lookup. The lookup uses thenameof theModuleobjects.Return type: A Moduleobject orNone, if there is no such item.
-
get_modules(attrs=None, type=None)[source]¶ Return (and possibly filter) items in the the
modulesmap ofModuleobjects for thisSchematicFile.This functions provides a mechanism for filtering the items as well. The keys in
attrsare taken as attributes names and the values are requested values. Items in the list that have all the requested values for the corresponding attributes will be returned.A if
typeis notNone, the item will match if it is an instance of the type provided.Parameters: - attrs – A set of key-value pairs that represent a filter to apply to the item’s attributes.
- type – A type to filter on. Only items that are an instance of this type will be returned.
Returns: A List of
ModuleobjectsReturn type: List of
Moduleobjects
-
get_nth_approved(n)[source]¶ get then nth
Approvedobject from theapproved_errorsof thisSchematicFile.Parameters: n – Index of the item to return. Return type: Approvedobject
-
get_nth_attribute(n)[source]¶ get then nth
Attributeobject from theattributesof thisSchematicFile.Parameters: n – Index of the item to return. Return type: Attributeobject
-
get_nth_class(n)[source]¶ get then nth
Classobject from theclassesof thisSchematicFile.Parameters: n – Index of the item to return. Return type: Classobject
-
get_nth_library(n)[source]¶ get then nth
Libraryobject from thelibrariesof thisSchematicFile.Parameters: n – Index of the item to return. Return type: Libraryobject
-
get_nth_module(n)[source]¶ get then nth
Moduleobject from themodulesof thisSchematicFile.Parameters: n – Index of the item to return. Return type: Moduleobject
-
get_nth_part(n)[source]¶ get then nth
Partobject from thepartsof thisSchematicFile.Parameters: n – Index of the item to return. Return type: Partobject
-
get_nth_setting(n)[source]¶ get then nth
Settingobject from thesettingsof thisSchematicFile.Parameters: n – Index of the item to return. Return type: Settingobject
-
get_nth_sheet(n)[source]¶ get then nth
Sheetobject from thesheetsof thisSchematicFile.Parameters: n – Index of the item to return. Return type: Sheetobject
-
get_nth_variantdef(n)[source]¶ get then nth
Variantdefobject from thevariantdefsof thisSchematicFile.Parameters: n – Index of the item to return. Return type: Variantdefobject
-
get_part(key)[source]¶ Lookup and return a
Partfrom thepartsof thisSchematicFile.Parameters: key – A strto use for the lookup. The lookup uses thenameof thePartobjects.Return type: A Partobject orNone, if there is no such item.
-
get_parts(attrs=None, type=None)[source]¶ Return (and possibly filter) items in the the
partsmap ofPartobjects for thisSchematicFile.This functions provides a mechanism for filtering the items as well. The keys in
attrsare taken as attributes names and the values are requested values. Items in the list that have all the requested values for the corresponding attributes will be returned.A if
typeis notNone, the item will match if it is an instance of the type provided.Parameters: - attrs – A set of key-value pairs that represent a filter to apply to the item’s attributes.
- type – A type to filter on. Only items that are an instance of this type will be returned.
Returns: A List of
PartobjectsReturn type: List of
Partobjects
-
get_schematic()[source]¶ Get the schematic from this
SchematicFile.Return type: Schematicobject
-
get_settings(attrs=None, type=None)[source]¶ Return (and possibly filter) items in the the
settingslist ofSettingobjects for thisSchematicFile.This functions provides a mechanism for filtering the items as well. The keys in
attrsare taken as attributes names and the values are requested values. Items in the list that have all the requested values for the corresponding attributes will be returned.A if
typeis notNone, the item will match if it is an instance of the type provided.Parameters: - attrs – A set of key-value pairs that represent a filter to apply to the item’s attributes.
- type – A type to filter on. Only items that are an instance of this type will be returned.
Returns: A List of
SettingobjectsReturn type: List of
Settingobjects
-
get_sheets(attrs=None, type=None)[source]¶ Return (and possibly filter) items in the the
sheetslist ofSheetobjects for thisSchematicFile.This functions provides a mechanism for filtering the items as well. The keys in
attrsare taken as attributes names and the values are requested values. Items in the list that have all the requested values for the corresponding attributes will be returned.A if
typeis notNone, the item will match if it is an instance of the type provided.Parameters: - attrs – A set of key-value pairs that represent a filter to apply to the item’s attributes.
- type – A type to filter on. Only items that are an instance of this type will be returned.
Returns: A List of
SheetobjectsReturn type: List of
Sheetobjects
-
get_variantdef(key)[source]¶ Lookup and return a
Variantdeffrom thevariantdefsof thisSchematicFile.Parameters: key – A strto use for the lookup. The lookup uses thenameof theVariantdefobjects.Return type: A Variantdefobject orNone, if there is no such item.
-
get_variantdefs(attrs=None, type=None)[source]¶ Return (and possibly filter) items in the the
variantdefsmap ofVariantdefobjects for thisSchematicFile.This functions provides a mechanism for filtering the items as well. The keys in
attrsare taken as attributes names and the values are requested values. Items in the list that have all the requested values for the corresponding attributes will be returned.A if
typeis notNone, the item will match if it is an instance of the type provided.Parameters: - attrs – A set of key-value pairs that represent a filter to apply to the item’s attributes.
- type – A type to filter on. Only items that are an instance of this type will be returned.
Returns: A List of
VariantdefobjectsReturn type: List of
Variantdefobjects
-
get_version()[source]¶ Return the value of
versionfor thisSchematicFile. This corresponds to theversionattribute of a<eagle>in an Eagle file.Return type: str
-
remove_approved(efp)[source]¶ Remove a
Approvedfrom theapproved_errorsof thisSchematicFile.Parameters: efp – The Approvedobject to remove.Return type: self
-
remove_attribute(efp)[source]¶ Remove a
Attributefrom theattributesof thisSchematicFile.Parameters: efp – The Attributeobject to remove.Return type: self
-
remove_child(efp)[source]¶ Remove a child
EagleFilePartobject.Parameters: efp – the class:EagleFilePart object to remove. Returns: Nothing
-
remove_class(efp)[source]¶ Remove a
Classfrom theclassesof thisSchematicFile.Parameters: efp – The Classobject to remove.Return type: self
-
remove_library(efp)[source]¶ Remove a
Libraryfrom thelibrariesof thisSchematicFile.Parameters: efp – The Libraryobject to remove.Return type: self
-
remove_module(efp)[source]¶ Remove a
Modulefrom themodulesof thisSchematicFile.Parameters: efp – The Moduleobject to remove.Return type: self
-
remove_part(efp)[source]¶ Remove a
Partfrom thepartsof thisSchematicFile.Parameters: efp – The Partobject to remove.Return type: self
-
remove_setting(efp)[source]¶ Remove a
Settingfrom thesettingsof thisSchematicFile.Parameters: efp – The Settingobject to remove.Return type: self
-
remove_sheet(efp)[source]¶ Remove a
Sheetfrom thesheetsof thisSchematicFile.Parameters: efp – The Sheetobject to remove.Return type: self
-
remove_variantdef(efp)[source]¶ Remove a
Variantdeffrom thevariantdefsof thisSchematicFile.Parameters: efp – The Variantdefobject to remove.Return type: self
-
set_compatibility(s)[source]¶ Set the
Compatibilityfor thisSchematicFile.Parameters: s – Compatibilityto set.Return type: self
-
set_description(s)[source]¶ Set the
Descriptionfor thisSchematicFile.Parameters: s – Descriptionto set.Return type: self
-
set_grid(s)[source]¶ Set the
Gridfor thisSchematicFile.Parameters: s – Gridto set.Return type: self
-
set_schematic(s)[source]¶ Set the
Schematicfor thisSchematicFile.Parameters: s – Schematicto set.Return type: self
-
set_version(v)[source]¶ Set the value of
versionfor thisSchematicFile. This corresponds to theversionattribute of a<eagle>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
with_version(v)[source]¶ Filter this
EagleFilePartobject based on the value ofversion. For use in combination withFromobjects.Return
selfif one of the following is true:versionequalsvvis callable andv(self.get_version()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
Sheet¶
-
class
Swoop.Sheet[source]¶ Bases:
Swoop.Swoop.EagleFilePartClass representing the contents of a <sheet> tag in Eagle files.
Attributes:
Collections:
description: SingletonDescriptionobject.plain_element: List ofPolygon,Wire,Text,Dimension,Circle,Rectangle,FrameandHoleobjects.instance: List ofInstanceobjects.moduleinst: Map ofModuleinstobjects indexed by theirname.bus: Map ofBusobjects indexed by theirname.net: Map ofNetobjects indexed by theirname.
-
add_bus(s)[source]¶ Add a
Busto thebussesof thisSheet.Parameters: s – The Busto add.Return type: self
-
add_instance(s)[source]¶ Add a
Instanceto theinstancesof thisSheet.Parameters: s – The Instanceto add.Return type: self
-
add_moduleinst(s)[source]¶ Add a
Moduleinstto themoduleinstsof thisSheet.Parameters: s – The Moduleinstto add.Return type: self
-
add_net(s)[source]¶ Add a
Netto thenetsof thisSheet.Parameters: s – The Netto add.Return type: self
-
add_plain_element(s)[source]¶ Add a
Polygon,Wire,Text,Dimension,Circle,Rectangle,FrameorHoleto theplain_elementsof thisSheet.Parameters: s – The Polygon,Wire,Text,Dimension,Circle,Rectangle,FrameorHoleto add.Return type: self
-
clear_instances()[source]¶ Remove all the
Instanceobjects from theinstancesof thisSheet.Return type: self
-
clear_moduleinsts()[source]¶ Remove all the
Moduleinstobjects from themoduleinstsof thisSheet.Return type: self
-
clear_plain_elements()[source]¶ Remove all the
Polygon,Wire,Text,Dimension,Circle,Rectangle,FrameandHoleobjects from theplain_elementsof thisSheet.Return type: self
-
clone()[source]¶ Recursively clone this
Sheet. It will be identical to the original, but it’s parent will beNone.Return type: Sheet
-
dump(indent='', increment=' ')[source]¶ Recursive debug dump.
Parameters: - indent – Indentation string. The output will be indented by this much.
- increment – This will be appendeded to
indenton recursive invocations.
Return type: None
-
get_bus(key)[source]¶ Lookup and return a
Busfrom thebussesof thisSheet.Parameters: key – A strto use for the lookup. The lookup uses thenameof theBusobjects.Return type: A Busobject orNone, if there is no such item.
-
get_busses(attrs=None, type=None)[source]¶ Return (and possibly filter) items in the the
bussesmap ofBusobjects for thisSheet.This functions provides a mechanism for filtering the items as well. The keys in
attrsare taken as attributes names and the values are requested values. Items in the list that have all the requested values for the corresponding attributes will be returned.A if
typeis notNone, the item will match if it is an instance of the type provided.Parameters: - attrs – A set of key-value pairs that represent a filter to apply to the item’s attributes.
- type – A type to filter on. Only items that are an instance of this type will be returned.
Returns: A List of
BusobjectsReturn type: List of
Busobjects
-
get_children()[source]¶ Get all the children of this
EagleFilePart.Return type: List of EagleFilePartobjects
-
get_description()[source]¶ Get the description from this
Sheet.Return type: Descriptionobject
-
get_instances(attrs=None, type=None)[source]¶ Return (and possibly filter) items in the the
instanceslist ofInstanceobjects for thisSheet.This functions provides a mechanism for filtering the items as well. The keys in
attrsare taken as attributes names and the values are requested values. Items in the list that have all the requested values for the corresponding attributes will be returned.A if
typeis notNone, the item will match if it is an instance of the type provided.Parameters: - attrs – A set of key-value pairs that represent a filter to apply to the item’s attributes.
- type – A type to filter on. Only items that are an instance of this type will be returned.
Returns: A List of
InstanceobjectsReturn type: List of
Instanceobjects
-
get_moduleinst(key)[source]¶ Lookup and return a
Moduleinstfrom themoduleinstsof thisSheet.Parameters: key – A strto use for the lookup. The lookup uses thenameof theModuleinstobjects.Return type: A Moduleinstobject orNone, if there is no such item.
-
get_moduleinsts(attrs=None, type=None)[source]¶ Return (and possibly filter) items in the the
moduleinstsmap ofModuleinstobjects for thisSheet.This functions provides a mechanism for filtering the items as well. The keys in
attrsare taken as attributes names and the values are requested values. Items in the list that have all the requested values for the corresponding attributes will be returned.A if
typeis notNone, the item will match if it is an instance of the type provided.Parameters: - attrs – A set of key-value pairs that represent a filter to apply to the item’s attributes.
- type – A type to filter on. Only items that are an instance of this type will be returned.
Returns: A List of
ModuleinstobjectsReturn type: List of
Moduleinstobjects
-
get_net(key)[source]¶ Lookup and return a
Netfrom thenetsof thisSheet.Parameters: key – A strto use for the lookup. The lookup uses thenameof theNetobjects.Return type: A Netobject orNone, if there is no such item.
-
get_nets(attrs=None, type=None)[source]¶ Return (and possibly filter) items in the the
netsmap ofNetobjects for thisSheet.This functions provides a mechanism for filtering the items as well. The keys in
attrsare taken as attributes names and the values are requested values. Items in the list that have all the requested values for the corresponding attributes will be returned.A if
typeis notNone, the item will match if it is an instance of the type provided.Parameters: - attrs – A set of key-value pairs that represent a filter to apply to the item’s attributes.
- type – A type to filter on. Only items that are an instance of this type will be returned.
Returns: A List of
NetobjectsReturn type: List of
Netobjects
-
get_nth_bus(n)[source]¶ get then nth
Busobject from thebussesof thisSheet.Parameters: n – Index of the item to return. Return type: Busobject
-
get_nth_instance(n)[source]¶ get then nth
Instanceobject from theinstancesof thisSheet.Parameters: n – Index of the item to return. Return type: Instanceobject
-
get_nth_moduleinst(n)[source]¶ get then nth
Moduleinstobject from themoduleinstsof thisSheet.Parameters: n – Index of the item to return. Return type: Moduleinstobject
-
get_nth_net(n)[source]¶ get then nth
Netobject from thenetsof thisSheet.Parameters: n – Index of the item to return. Return type: Netobject
-
get_nth_plain_element(n)[source]¶ get then nth
Polygon,Wire,Text,Dimension,Circle,Rectangle,FrameorHoleobject from theplain_elementsof thisSheet.Parameters: n – Index of the item to return. Return type: Polygon,Wire,Text,Dimension,Circle,Rectangle,FrameorHoleobject
-
get_plain_elements(attrs=None, type=None)[source]¶ Return (and possibly filter) items in the the
plain_elementslist ofPolygon,Wire,Text,Dimension,Circle,Rectangle,FrameorHoleobjects for thisSheet.This functions provides a mechanism for filtering the items as well. The keys in
attrsare taken as attributes names and the values are requested values. Items in the list that have all the requested values for the corresponding attributes will be returned.A if
typeis notNone, the item will match if it is an instance of the type provided.Parameters: - attrs – A set of key-value pairs that represent a filter to apply to the item’s attributes.
- type – A type to filter on. Only items that are an instance of this type will be returned.
Returns: A List of
Polygon,Wire,Text,Dimension,Circle,Rectangle,FrameandHoleobjectsReturn type: List of
Polygon,Wire,Text,Dimension,Circle,Rectangle,FrameandHoleobjects
-
remove_bus(efp)[source]¶ Remove a
Busfrom thebussesof thisSheet.Parameters: efp – The Busobject to remove.Return type: self
-
remove_child(efp)[source]¶ Remove a child
EagleFilePartobject.Parameters: efp – the class:EagleFilePart object to remove. Returns: Nothing
-
remove_instance(efp)[source]¶ Remove a
Instancefrom theinstancesof thisSheet.Parameters: efp – The Instanceobject to remove.Return type: self
-
remove_moduleinst(efp)[source]¶ Remove a
Moduleinstfrom themoduleinstsof thisSheet.Parameters: efp – The Moduleinstobject to remove.Return type: self
-
remove_net(efp)[source]¶ Remove a
Netfrom thenetsof thisSheet.Parameters: efp – The Netobject to remove.Return type: self
-
remove_plain_element(efp)[source]¶ Remove a
Polygon,Wire,Text,Dimension,Circle,Rectangle,FrameorHolefrom theplain_elementsof thisSheet.Parameters: efp – The Polygon,Wire,Text,Dimension,Circle,Rectangle,FrameorHoleobject to remove.Return type: self
-
set_description(s)[source]¶ Set the
Descriptionfor thisSheet.Parameters: s – Descriptionto set.Return type: self
Instance¶
-
class
Swoop.Instance[source]¶ Bases:
Swoop.Swoop.EagleFilePartClass representing the contents of a <instance> tag in Eagle files.
Attributes:
partgatexysmashedrot
Collections:
attribute: Map ofAttributeobjects indexed by theirname.
-
add_attribute(s)[source]¶ Add a
Attributeto theattributesof thisInstance.Parameters: s – The Attributeto add.Return type: self
-
clear_attributes()[source]¶ Remove all the
Attributeobjects from theattributesof thisInstance.Return type: self
-
clone()[source]¶ Recursively clone this
Instance. It will be identical to the original, but it’s parent will beNone.Return type: Instance
-
dump(indent='', increment=' ')[source]¶ Recursive debug dump.
Parameters: - indent – Indentation string. The output will be indented by this much.
- increment – This will be appendeded to
indenton recursive invocations.
Return type: None
-
find_gate()[source]¶ Find the
Gateobject refered to by thegateattribute of this object. This is likeget_gate(), except it returns theGateobject instead of its name.Returns: The object Return type: Gate
-
find_part()[source]¶ Find the
Partobject refered to by thepartattribute of this object. This is likeget_part(), except it returns thePartobject instead of its name.Returns: The object Return type: Part
-
get_attribute(key)[source]¶ Lookup and return a
Attributefrom theattributesof thisInstance.Parameters: key – A strto use for the lookup. The lookup uses thenameof theAttributeobjects.Return type: A Attributeobject orNone, if there is no such item.
-
get_attributes(attrs=None, type=None)[source]¶ Return (and possibly filter) items in the the
attributesmap ofAttributeobjects for thisInstance.This functions provides a mechanism for filtering the items as well. The keys in
attrsare taken as attributes names and the values are requested values. Items in the list that have all the requested values for the corresponding attributes will be returned.A if
typeis notNone, the item will match if it is an instance of the type provided.Parameters: - attrs – A set of key-value pairs that represent a filter to apply to the item’s attributes.
- type – A type to filter on. Only items that are an instance of this type will be returned.
Returns: A List of
AttributeobjectsReturn type: List of
Attributeobjects
-
get_children()[source]¶ Get all the children of this
EagleFilePart.Return type: List of EagleFilePartobjects
-
get_gate()[source]¶ Return the value of
gatefor thisInstance. This corresponds to thegateattribute of a<instance>in an Eagle file.Return type: str
-
get_nth_attribute(n)[source]¶ get then nth
Attributeobject from theattributesof thisInstance.Parameters: n – Index of the item to return. Return type: Attributeobject
-
get_part()[source]¶ Return the value of
partfor thisInstance. This corresponds to thepartattribute of a<instance>in an Eagle file.Return type: str
-
get_rot()[source]¶ Return the value of
rotfor thisInstance. This corresponds to therotattribute of a<instance>in an Eagle file.Return type: str
-
get_smashed()[source]¶ Return the value of
smashedfor thisInstance. This corresponds to thesmashedattribute of a<instance>in an Eagle file.Return type: str
-
get_x()[source]¶ Return the value of
xfor thisInstance. This corresponds to thexattribute of a<instance>in an Eagle file.Return type: float
-
get_y()[source]¶ Return the value of
yfor thisInstance. This corresponds to theyattribute of a<instance>in an Eagle file.Return type: float
-
remove_attribute(efp)[source]¶ Remove a
Attributefrom theattributesof thisInstance.Parameters: efp – The Attributeobject to remove.Return type: self
-
remove_child(efp)[source]¶ Remove a child
EagleFilePartobject.Parameters: efp – the class:EagleFilePart object to remove. Returns: Nothing
-
set_gate(v)[source]¶ Set the value of
gatefor thisInstance. This corresponds to thegateattribute of a<instance>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_part(v)[source]¶ Set the value of
partfor thisInstance. This corresponds to thepartattribute of a<instance>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_rot(v)[source]¶ Set the value of
rotfor thisInstance. This corresponds to therotattribute of a<instance>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_smashed(v)[source]¶ Set the value of
smashedfor thisInstance. This corresponds to thesmashedattribute of a<instance>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_x(v)[source]¶ Set the value of
xfor thisInstance. This corresponds to thexattribute of a<instance>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_y(v)[source]¶ Set the value of
yfor thisInstance. This corresponds to theyattribute of a<instance>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
with_gate(v)[source]¶ Filter this
EagleFilePartobject based on the value ofgate. For use in combination withFromobjects.Return
selfif one of the following is true:gateequalsvvis callable andv(self.get_gate()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_part(v)[source]¶ Filter this
EagleFilePartobject based on the value ofpart. For use in combination withFromobjects.Return
selfif one of the following is true:partequalsvvis callable andv(self.get_part()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_rot(v)[source]¶ Filter this
EagleFilePartobject based on the value ofrot. For use in combination withFromobjects.Return
selfif one of the following is true:rotequalsvvis callable andv(self.get_rot()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_smashed(v)[source]¶ Filter this
EagleFilePartobject based on the value ofsmashed. For use in combination withFromobjects.Return
selfif one of the following is true:smashedequalsvvis callable andv(self.get_smashed()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_x(v)[source]¶ Filter this
EagleFilePartobject based on the value ofx. For use in combination withFromobjects.Return
selfif one of the following is true:xequalsvvis callable andv(self.get_x()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_y(v)[source]¶ Filter this
EagleFilePartobject based on the value ofy. For use in combination withFromobjects.Return
selfif one of the following is true:yequalsvvis callable andv(self.get_y()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
Bus¶
-
class
Swoop.Bus[source]¶ Bases:
Swoop.Swoop.EagleFilePartClass representing the contents of a <bus> tag in Eagle files.
Attributes:
name
Collections:
segment: List ofSegmentobjects.
-
add_segment(s)[source]¶ Add a
Segmentto thesegmentsof thisBus.Parameters: s – The Segmentto add.Return type: self
-
clear_segments()[source]¶ Remove all the
Segmentobjects from thesegmentsof thisBus.Return type: self
-
clone()[source]¶ Recursively clone this
Bus. It will be identical to the original, but it’s parent will beNone.Return type: Bus
-
dump(indent='', increment=' ')[source]¶ Recursive debug dump.
Parameters: - indent – Indentation string. The output will be indented by this much.
- increment – This will be appendeded to
indenton recursive invocations.
Return type: None
-
get_children()[source]¶ Get all the children of this
EagleFilePart.Return type: List of EagleFilePartobjects
-
get_name()[source]¶ Return the value of
namefor thisBus. This corresponds to thenameattribute of a<bus>in an Eagle file.Return type: str
-
get_nth_segment(n)[source]¶ get then nth
Segmentobject from thesegmentsof thisBus.Parameters: n – Index of the item to return. Return type: Segmentobject
-
get_segments(attrs=None, type=None)[source]¶ Return (and possibly filter) items in the the
segmentslist ofSegmentobjects for thisBus.This functions provides a mechanism for filtering the items as well. The keys in
attrsare taken as attributes names and the values are requested values. Items in the list that have all the requested values for the corresponding attributes will be returned.A if
typeis notNone, the item will match if it is an instance of the type provided.Parameters: - attrs – A set of key-value pairs that represent a filter to apply to the item’s attributes.
- type – A type to filter on. Only items that are an instance of this type will be returned.
Returns: A List of
SegmentobjectsReturn type: List of
Segmentobjects
-
remove_child(efp)[source]¶ Remove a child
EagleFilePartobject.Parameters: efp – the class:EagleFilePart object to remove. Returns: Nothing
-
remove_segment(efp)[source]¶ Remove a
Segmentfrom thesegmentsof thisBus.Parameters: efp – The Segmentobject to remove.Return type: self
-
set_name(v)[source]¶ Set the value of
namefor thisBus. This corresponds to thenameattribute of a<bus>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
with_name(v)[source]¶ Filter this
EagleFilePartobject based on the value ofname. For use in combination withFromobjects.Return
selfif one of the following is true:nameequalsvvis callable andv(self.get_name()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
Frame¶
-
class
Swoop.Frame[source]¶ Bases:
Swoop.Swoop.EagleFilePartClass representing the contents of a <frame> tag in Eagle files.
Attributes:
x1y1x2y2columnsrowslayerborder_leftborder_rightborder_topborder_bottom
-
clone()[source]¶ Recursively clone this
Frame. It will be identical to the original, but it’s parent will beNone.Return type: Frame
-
dump(indent='', increment=' ')[source]¶ Recursive debug dump.
Parameters: - indent – Indentation string. The output will be indented by this much.
- increment – This will be appendeded to
indenton recursive invocations.
Return type: None
-
get_border_bottom()[source]¶ Return the value of
border_bottomfor thisFrame. This corresponds to theborder_bottomattribute of a<frame>in an Eagle file.Return type: bool
-
get_border_left()[source]¶ Return the value of
border_leftfor thisFrame. This corresponds to theborder_leftattribute of a<frame>in an Eagle file.Return type: bool
-
get_border_right()[source]¶ Return the value of
border_rightfor thisFrame. This corresponds to theborder_rightattribute of a<frame>in an Eagle file.Return type: bool
-
get_border_top()[source]¶ Return the value of
border_topfor thisFrame. This corresponds to theborder_topattribute of a<frame>in an Eagle file.Return type: bool
-
get_children()[source]¶ Get all the children of this
EagleFilePart.Return type: List of EagleFilePartobjects
-
get_columns()[source]¶ Return the value of
columnsfor thisFrame. This corresponds to thecolumnsattribute of a<frame>in an Eagle file.Return type: int
-
get_layer()[source]¶ Return the value of
layerfor thisFrame. This corresponds to thelayerattribute of a<frame>in an Eagle file.Return type: layer_string
-
get_rows()[source]¶ Return the value of
rowsfor thisFrame. This corresponds to therowsattribute of a<frame>in an Eagle file.Return type: int
-
get_x1()[source]¶ Return the value of
x1for thisFrame. This corresponds to thex1attribute of a<frame>in an Eagle file.Return type: float
-
get_x2()[source]¶ Return the value of
x2for thisFrame. This corresponds to thex2attribute of a<frame>in an Eagle file.Return type: float
-
get_y1()[source]¶ Return the value of
y1for thisFrame. This corresponds to they1attribute of a<frame>in an Eagle file.Return type: float
-
get_y2()[source]¶ Return the value of
y2for thisFrame. This corresponds to they2attribute of a<frame>in an Eagle file.Return type: float
-
remove_child(efp)[source]¶ Remove a child
EagleFilePartobject.Parameters: efp – the class:EagleFilePart object to remove. Returns: Nothing
-
set_border_bottom(v)[source]¶ Set the value of
border_bottomfor thisFrame. This corresponds to theborder_bottomattribute of a<frame>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_border_left(v)[source]¶ Set the value of
border_leftfor thisFrame. This corresponds to theborder_leftattribute of a<frame>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_border_right(v)[source]¶ Set the value of
border_rightfor thisFrame. This corresponds to theborder_rightattribute of a<frame>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_border_top(v)[source]¶ Set the value of
border_topfor thisFrame. This corresponds to theborder_topattribute of a<frame>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_columns(v)[source]¶ Set the value of
columnsfor thisFrame. This corresponds to thecolumnsattribute of a<frame>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_layer(v)[source]¶ Set the value of
layerfor thisFrame. This corresponds to thelayerattribute of a<frame>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_rows(v)[source]¶ Set the value of
rowsfor thisFrame. This corresponds to therowsattribute of a<frame>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_x1(v)[source]¶ Set the value of
x1for thisFrame. This corresponds to thex1attribute of a<frame>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_x2(v)[source]¶ Set the value of
x2for thisFrame. This corresponds to thex2attribute of a<frame>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_y1(v)[source]¶ Set the value of
y1for thisFrame. This corresponds to they1attribute of a<frame>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_y2(v)[source]¶ Set the value of
y2for thisFrame. This corresponds to they2attribute of a<frame>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
with_border_bottom(v)[source]¶ Filter this
EagleFilePartobject based on the value ofborder_bottom. For use in combination withFromobjects.Return
selfif one of the following is true:border_bottomequalsvvis callable andv(self.get_border_bottom()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_border_left(v)[source]¶ Filter this
EagleFilePartobject based on the value ofborder_left. For use in combination withFromobjects.Return
selfif one of the following is true:border_leftequalsvvis callable andv(self.get_border_left()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_border_right(v)[source]¶ Filter this
EagleFilePartobject based on the value ofborder_right. For use in combination withFromobjects.Return
selfif one of the following is true:border_rightequalsvvis callable andv(self.get_border_right()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_border_top(v)[source]¶ Filter this
EagleFilePartobject based on the value ofborder_top. For use in combination withFromobjects.Return
selfif one of the following is true:border_topequalsvvis callable andv(self.get_border_top()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_columns(v)[source]¶ Filter this
EagleFilePartobject based on the value ofcolumns. For use in combination withFromobjects.Return
selfif one of the following is true:columnsequalsvvis callable andv(self.get_columns()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_layer(v)[source]¶ Filter this
EagleFilePartobject based on the value oflayer. For use in combination withFromobjects.Return
selfif one of the following is true:layerequalsvvis callable andv(self.get_layer()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_rows(v)[source]¶ Filter this
EagleFilePartobject based on the value ofrows. For use in combination withFromobjects.Return
selfif one of the following is true:rowsequalsvvis callable andv(self.get_rows()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_x1(v)[source]¶ Filter this
EagleFilePartobject based on the value ofx1. For use in combination withFromobjects.Return
selfif one of the following is true:x1equalsvvis callable andv(self.get_x1()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_x2(v)[source]¶ Filter this
EagleFilePartobject based on the value ofx2. For use in combination withFromobjects.Return
selfif one of the following is true:x2equalsvvis callable andv(self.get_x2()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_y1(v)[source]¶ Filter this
EagleFilePartobject based on the value ofy1. For use in combination withFromobjects.Return
selfif one of the following is true:y1equalsvvis callable andv(self.get_y1()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_y2(v)[source]¶ Filter this
EagleFilePartobject based on the value ofy2. For use in combination withFromobjects.Return
selfif one of the following is true:y2equalsvvis callable andv(self.get_y2()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
Junction¶
-
class
Swoop.Junction[source]¶ Bases:
Swoop.Swoop.EagleFilePartClass representing the contents of a <junction> tag in Eagle files.
Attributes:
xy
-
clone()[source]¶ Recursively clone this
Junction. It will be identical to the original, but it’s parent will beNone.Return type: Junction
-
dump(indent='', increment=' ')[source]¶ Recursive debug dump.
Parameters: - indent – Indentation string. The output will be indented by this much.
- increment – This will be appendeded to
indenton recursive invocations.
Return type: None
-
get_children()[source]¶ Get all the children of this
EagleFilePart.Return type: List of EagleFilePartobjects
-
get_x()[source]¶ Return the value of
xfor thisJunction. This corresponds to thexattribute of a<junction>in an Eagle file.Return type: float
-
get_y()[source]¶ Return the value of
yfor thisJunction. This corresponds to theyattribute of a<junction>in an Eagle file.Return type: float
-
remove_child(efp)[source]¶ Remove a child
EagleFilePartobject.Parameters: efp – the class:EagleFilePart object to remove. Returns: Nothing
-
set_x(v)[source]¶ Set the value of
xfor thisJunction. This corresponds to thexattribute of a<junction>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_y(v)[source]¶ Set the value of
yfor thisJunction. This corresponds to theyattribute of a<junction>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
with_x(v)[source]¶ Filter this
EagleFilePartobject based on the value ofx. For use in combination withFromobjects.Return
selfif one of the following is true:xequalsvvis callable andv(self.get_x()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_y(v)[source]¶ Filter this
EagleFilePartobject based on the value ofy. For use in combination withFromobjects.Return
selfif one of the following is true:yequalsvvis callable andv(self.get_y()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
Module¶
-
class
Swoop.Module[source]¶ Bases:
Swoop.Swoop.EagleFilePartClass representing the contents of a <module> tag in Eagle files.
Attributes:
nameprefixdxdy
Collections:
description: SingletonDescriptionobject.sheet: List ofSheetobjects.port: Map ofPortobjects indexed by theirname.variantdef: Map ofVariantdefobjects indexed by theirname.part: Map ofPartobjects indexed by theirname.
-
add_part(s)[source]¶ Add a
Partto thepartsof thisModule.Parameters: s – The Partto add.Return type: self
-
add_port(s)[source]¶ Add a
Portto theportsof thisModule.Parameters: s – The Portto add.Return type: self
-
add_sheet(s)[source]¶ Add a
Sheetto thesheetsof thisModule.Parameters: s – The Sheetto add.Return type: self
-
add_variantdef(s)[source]¶ Add a
Variantdefto thevariantdefsof thisModule.Parameters: s – The Variantdefto add.Return type: self
-
clear_sheets()[source]¶ Remove all the
Sheetobjects from thesheetsof thisModule.Return type: self
-
clear_variantdefs()[source]¶ Remove all the
Variantdefobjects from thevariantdefsof thisModule.Return type: self
-
clone()[source]¶ Recursively clone this
Module. It will be identical to the original, but it’s parent will beNone.Return type: Module
-
dump(indent='', increment=' ')[source]¶ Recursive debug dump.
Parameters: - indent – Indentation string. The output will be indented by this much.
- increment – This will be appendeded to
indenton recursive invocations.
Return type: None
-
get_children()[source]¶ Get all the children of this
EagleFilePart.Return type: List of EagleFilePartobjects
-
get_description()[source]¶ Get the description from this
Module.Return type: Descriptionobject
-
get_dx()[source]¶ Return the value of
dxfor thisModule. This corresponds to thedxattribute of a<module>in an Eagle file.Return type: float
-
get_dy()[source]¶ Return the value of
dyfor thisModule. This corresponds to thedyattribute of a<module>in an Eagle file.Return type: float
-
get_name()[source]¶ Return the value of
namefor thisModule. This corresponds to thenameattribute of a<module>in an Eagle file.Return type: str
-
get_nth_part(n)[source]¶ get then nth
Partobject from thepartsof thisModule.Parameters: n – Index of the item to return. Return type: Partobject
-
get_nth_port(n)[source]¶ get then nth
Portobject from theportsof thisModule.Parameters: n – Index of the item to return. Return type: Portobject
-
get_nth_sheet(n)[source]¶ get then nth
Sheetobject from thesheetsof thisModule.Parameters: n – Index of the item to return. Return type: Sheetobject
-
get_nth_variantdef(n)[source]¶ get then nth
Variantdefobject from thevariantdefsof thisModule.Parameters: n – Index of the item to return. Return type: Variantdefobject
-
get_part(key)[source]¶ Lookup and return a
Partfrom thepartsof thisModule.Parameters: key – A strto use for the lookup. The lookup uses thenameof thePartobjects.Return type: A Partobject orNone, if there is no such item.
-
get_parts(attrs=None, type=None)[source]¶ Return (and possibly filter) items in the the
partsmap ofPartobjects for thisModule.This functions provides a mechanism for filtering the items as well. The keys in
attrsare taken as attributes names and the values are requested values. Items in the list that have all the requested values for the corresponding attributes will be returned.A if
typeis notNone, the item will match if it is an instance of the type provided.Parameters: - attrs – A set of key-value pairs that represent a filter to apply to the item’s attributes.
- type – A type to filter on. Only items that are an instance of this type will be returned.
Returns: A List of
PartobjectsReturn type: List of
Partobjects
-
get_port(key)[source]¶ Lookup and return a
Portfrom theportsof thisModule.Parameters: key – A strto use for the lookup. The lookup uses thenameof thePortobjects.Return type: A Portobject orNone, if there is no such item.
-
get_ports(attrs=None, type=None)[source]¶ Return (and possibly filter) items in the the
portsmap ofPortobjects for thisModule.This functions provides a mechanism for filtering the items as well. The keys in
attrsare taken as attributes names and the values are requested values. Items in the list that have all the requested values for the corresponding attributes will be returned.A if
typeis notNone, the item will match if it is an instance of the type provided.Parameters: - attrs – A set of key-value pairs that represent a filter to apply to the item’s attributes.
- type – A type to filter on. Only items that are an instance of this type will be returned.
Returns: A List of
PortobjectsReturn type: List of
Portobjects
-
get_prefix()[source]¶ Return the value of
prefixfor thisModule. This corresponds to theprefixattribute of a<module>in an Eagle file.Return type: str
-
get_sheets(attrs=None, type=None)[source]¶ Return (and possibly filter) items in the the
sheetslist ofSheetobjects for thisModule.This functions provides a mechanism for filtering the items as well. The keys in
attrsare taken as attributes names and the values are requested values. Items in the list that have all the requested values for the corresponding attributes will be returned.A if
typeis notNone, the item will match if it is an instance of the type provided.Parameters: - attrs – A set of key-value pairs that represent a filter to apply to the item’s attributes.
- type – A type to filter on. Only items that are an instance of this type will be returned.
Returns: A List of
SheetobjectsReturn type: List of
Sheetobjects
-
get_variantdef(key)[source]¶ Lookup and return a
Variantdeffrom thevariantdefsof thisModule.Parameters: key – A strto use for the lookup. The lookup uses thenameof theVariantdefobjects.Return type: A Variantdefobject orNone, if there is no such item.
-
get_variantdefs(attrs=None, type=None)[source]¶ Return (and possibly filter) items in the the
variantdefsmap ofVariantdefobjects for thisModule.This functions provides a mechanism for filtering the items as well. The keys in
attrsare taken as attributes names and the values are requested values. Items in the list that have all the requested values for the corresponding attributes will be returned.A if
typeis notNone, the item will match if it is an instance of the type provided.Parameters: - attrs – A set of key-value pairs that represent a filter to apply to the item’s attributes.
- type – A type to filter on. Only items that are an instance of this type will be returned.
Returns: A List of
VariantdefobjectsReturn type: List of
Variantdefobjects
-
remove_child(efp)[source]¶ Remove a child
EagleFilePartobject.Parameters: efp – the class:EagleFilePart object to remove. Returns: Nothing
-
remove_part(efp)[source]¶ Remove a
Partfrom thepartsof thisModule.Parameters: efp – The Partobject to remove.Return type: self
-
remove_port(efp)[source]¶ Remove a
Portfrom theportsof thisModule.Parameters: efp – The Portobject to remove.Return type: self
-
remove_sheet(efp)[source]¶ Remove a
Sheetfrom thesheetsof thisModule.Parameters: efp – The Sheetobject to remove.Return type: self
-
remove_variantdef(efp)[source]¶ Remove a
Variantdeffrom thevariantdefsof thisModule.Parameters: efp – The Variantdefobject to remove.Return type: self
-
set_description(s)[source]¶ Set the
Descriptionfor thisModule.Parameters: s – Descriptionto set.Return type: self
-
set_dx(v)[source]¶ Set the value of
dxfor thisModule. This corresponds to thedxattribute of a<module>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_dy(v)[source]¶ Set the value of
dyfor thisModule. This corresponds to thedyattribute of a<module>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_name(v)[source]¶ Set the value of
namefor thisModule. This corresponds to thenameattribute of a<module>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_prefix(v)[source]¶ Set the value of
prefixfor thisModule. This corresponds to theprefixattribute of a<module>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
with_dx(v)[source]¶ Filter this
EagleFilePartobject based on the value ofdx. For use in combination withFromobjects.Return
selfif one of the following is true:dxequalsvvis callable andv(self.get_dx()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_dy(v)[source]¶ Filter this
EagleFilePartobject based on the value ofdy. For use in combination withFromobjects.Return
selfif one of the following is true:dyequalsvvis callable andv(self.get_dy()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_name(v)[source]¶ Filter this
EagleFilePartobject based on the value ofname. For use in combination withFromobjects.Return
selfif one of the following is true:nameequalsvvis callable andv(self.get_name()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_prefix(v)[source]¶ Filter this
EagleFilePartobject based on the value ofprefix. For use in combination withFromobjects.Return
selfif one of the following is true:prefixequalsvvis callable andv(self.get_prefix()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
Moduleinst¶
-
class
Swoop.Moduleinst[source]¶ Bases:
Swoop.Swoop.EagleFilePartClass representing the contents of a <moduleinst> tag in Eagle files.
Attributes:
namemodulemodulevariantxyoffsetsmashedrot
-
clone()[source]¶ Recursively clone this
Moduleinst. It will be identical to the original, but it’s parent will beNone.Return type: Moduleinst
-
dump(indent='', increment=' ')[source]¶ Recursive debug dump.
Parameters: - indent – Indentation string. The output will be indented by this much.
- increment – This will be appendeded to
indenton recursive invocations.
Return type: None
-
find_module()[source]¶ Find the
Moduleobject refered to by themoduleattribute of this object. This is likeget_module(), except it returns theModuleobject instead of its name.Returns: The object Return type: Module
-
get_children()[source]¶ Get all the children of this
EagleFilePart.Return type: List of EagleFilePartobjects
-
get_et()[source]¶ Generate a <moduleinst> element tree for a
Moduleinst.Return type: ElementTree.
-
get_module()[source]¶ Return the value of
modulefor thisModuleinst. This corresponds to themoduleattribute of a<moduleinst>in an Eagle file.Return type: str
-
get_modulevariant()[source]¶ Return the value of
modulevariantfor thisModuleinst. This corresponds to themodulevariantattribute of a<moduleinst>in an Eagle file.Return type: str
-
get_name()[source]¶ Return the value of
namefor thisModuleinst. This corresponds to thenameattribute of a<moduleinst>in an Eagle file.Return type: str
-
get_offset()[source]¶ Return the value of
offsetfor thisModuleinst. This corresponds to theoffsetattribute of a<moduleinst>in an Eagle file.Return type: int
-
get_rot()[source]¶ Return the value of
rotfor thisModuleinst. This corresponds to therotattribute of a<moduleinst>in an Eagle file.Return type: str
-
get_smashed()[source]¶ Return the value of
smashedfor thisModuleinst. This corresponds to thesmashedattribute of a<moduleinst>in an Eagle file.Return type: str
-
get_x()[source]¶ Return the value of
xfor thisModuleinst. This corresponds to thexattribute of a<moduleinst>in an Eagle file.Return type: float
-
get_y()[source]¶ Return the value of
yfor thisModuleinst. This corresponds to theyattribute of a<moduleinst>in an Eagle file.Return type: float
-
remove_child(efp)[source]¶ Remove a child
EagleFilePartobject.Parameters: efp – the class:EagleFilePart object to remove. Returns: Nothing
-
set_module(v)[source]¶ Set the value of
modulefor thisModuleinst. This corresponds to themoduleattribute of a<moduleinst>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_modulevariant(v)[source]¶ Set the value of
modulevariantfor thisModuleinst. This corresponds to themodulevariantattribute of a<moduleinst>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_name(v)[source]¶ Set the value of
namefor thisModuleinst. This corresponds to thenameattribute of a<moduleinst>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_offset(v)[source]¶ Set the value of
offsetfor thisModuleinst. This corresponds to theoffsetattribute of a<moduleinst>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_rot(v)[source]¶ Set the value of
rotfor thisModuleinst. This corresponds to therotattribute of a<moduleinst>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_smashed(v)[source]¶ Set the value of
smashedfor thisModuleinst. This corresponds to thesmashedattribute of a<moduleinst>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_x(v)[source]¶ Set the value of
xfor thisModuleinst. This corresponds to thexattribute of a<moduleinst>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_y(v)[source]¶ Set the value of
yfor thisModuleinst. This corresponds to theyattribute of a<moduleinst>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
with_module(v)[source]¶ Filter this
EagleFilePartobject based on the value ofmodule. For use in combination withFromobjects.Return
selfif one of the following is true:moduleequalsvvis callable andv(self.get_module()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_modulevariant(v)[source]¶ Filter this
EagleFilePartobject based on the value ofmodulevariant. For use in combination withFromobjects.Return
selfif one of the following is true:modulevariantequalsvvis callable andv(self.get_modulevariant()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_name(v)[source]¶ Filter this
EagleFilePartobject based on the value ofname. For use in combination withFromobjects.Return
selfif one of the following is true:nameequalsvvis callable andv(self.get_name()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_offset(v)[source]¶ Filter this
EagleFilePartobject based on the value ofoffset. For use in combination withFromobjects.Return
selfif one of the following is true:offsetequalsvvis callable andv(self.get_offset()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_rot(v)[source]¶ Filter this
EagleFilePartobject based on the value ofrot. For use in combination withFromobjects.Return
selfif one of the following is true:rotequalsvvis callable andv(self.get_rot()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_smashed(v)[source]¶ Filter this
EagleFilePartobject based on the value ofsmashed. For use in combination withFromobjects.Return
selfif one of the following is true:smashedequalsvvis callable andv(self.get_smashed()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_x(v)[source]¶ Filter this
EagleFilePartobject based on the value ofx. For use in combination withFromobjects.Return
selfif one of the following is true:xequalsvvis callable andv(self.get_x()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_y(v)[source]¶ Filter this
EagleFilePartobject based on the value ofy. For use in combination withFromobjects.Return
selfif one of the following is true:yequalsvvis callable andv(self.get_y()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
Net¶
-
class
Swoop.Net[source]¶ Bases:
Swoop.Swoop.EagleFilePartClass representing the contents of a <net> tag in Eagle files.
Attributes:
nameclass
Collections:
segment: List ofSegmentobjects.
-
add_segment(s)[source]¶ Add a
Segmentto thesegmentsof thisNet.Parameters: s – The Segmentto add.Return type: self
-
clear_segments()[source]¶ Remove all the
Segmentobjects from thesegmentsof thisNet.Return type: self
-
clone()[source]¶ Recursively clone this
Net. It will be identical to the original, but it’s parent will beNone.Return type: Net
-
dump(indent='', increment=' ')[source]¶ Recursive debug dump.
Parameters: - indent – Indentation string. The output will be indented by this much.
- increment – This will be appendeded to
indenton recursive invocations.
Return type: None
-
get_children()[source]¶ Get all the children of this
EagleFilePart.Return type: List of EagleFilePartobjects
-
get_class()[source]¶ Return the value of
netclassfor thisNet. This corresponds to thenetclassattribute of a<net>in an Eagle file.Return type: str
-
get_name()[source]¶ Return the value of
namefor thisNet. This corresponds to thenameattribute of a<net>in an Eagle file.Return type: str
-
get_nth_segment(n)[source]¶ get then nth
Segmentobject from thesegmentsof thisNet.Parameters: n – Index of the item to return. Return type: Segmentobject
-
get_segments(attrs=None, type=None)[source]¶ Return (and possibly filter) items in the the
segmentslist ofSegmentobjects for thisNet.This functions provides a mechanism for filtering the items as well. The keys in
attrsare taken as attributes names and the values are requested values. Items in the list that have all the requested values for the corresponding attributes will be returned.A if
typeis notNone, the item will match if it is an instance of the type provided.Parameters: - attrs – A set of key-value pairs that represent a filter to apply to the item’s attributes.
- type – A type to filter on. Only items that are an instance of this type will be returned.
Returns: A List of
SegmentobjectsReturn type: List of
Segmentobjects
-
remove_child(efp)[source]¶ Remove a child
EagleFilePartobject.Parameters: efp – the class:EagleFilePart object to remove. Returns: Nothing
-
remove_segment(efp)[source]¶ Remove a
Segmentfrom thesegmentsof thisNet.Parameters: efp – The Segmentobject to remove.Return type: self
-
set_class(v)[source]¶ Set the value of
netclassfor thisNet. This corresponds to thenetclassattribute of a<net>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_name(v)[source]¶ Set the value of
namefor thisNet. This corresponds to thenameattribute of a<net>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
with_class(v)[source]¶ Filter this
EagleFilePartobject based on the value ofnetclass. For use in combination withFromobjects.Return
selfif one of the following is true:netclassequalsvvis callable andv(self.get_class()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_name(v)[source]¶ Filter this
EagleFilePartobject based on the value ofname. For use in combination withFromobjects.Return
selfif one of the following is true:nameequalsvvis callable andv(self.get_name()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
Part¶
Pin¶
-
class
Swoop.Pin[source]¶ Bases:
Swoop.Swoop.EagleFilePartClass representing the contents of a <pin> tag in Eagle files.
Attributes:
namexyvisiblelengthdirectionfunctionswaplevelrot
-
clone()[source]¶ Recursively clone this
Pin. It will be identical to the original, but it’s parent will beNone.Return type: Pin
-
dump(indent='', increment=' ')[source]¶ Recursive debug dump.
Parameters: - indent – Indentation string. The output will be indented by this much.
- increment – This will be appendeded to
indenton recursive invocations.
Return type: None
-
get_children()[source]¶ Get all the children of this
EagleFilePart.Return type: List of EagleFilePartobjects
-
get_direction()[source]¶ Return the value of
directionfor thisPin. This corresponds to thedirectionattribute of a<pin>in an Eagle file.Return type: str
-
get_function()[source]¶ Return the value of
functionfor thisPin. This corresponds to thefunctionattribute of a<pin>in an Eagle file.Return type: str
-
get_length()[source]¶ Return the value of
lengthfor thisPin. This corresponds to thelengthattribute of a<pin>in an Eagle file.Return type: str
-
get_name()[source]¶ Return the value of
namefor thisPin. This corresponds to thenameattribute of a<pin>in an Eagle file.Return type: str
-
get_rot()[source]¶ Return the value of
rotfor thisPin. This corresponds to therotattribute of a<pin>in an Eagle file.Return type: str
-
get_swaplevel()[source]¶ Return the value of
swaplevelfor thisPin. This corresponds to theswaplevelattribute of a<pin>in an Eagle file.Return type: int
-
get_visible()[source]¶ Return the value of
visiblefor thisPin. This corresponds to thevisibleattribute of a<pin>in an Eagle file.Return type: str
-
get_x()[source]¶ Return the value of
xfor thisPin. This corresponds to thexattribute of a<pin>in an Eagle file.Return type: float
-
get_y()[source]¶ Return the value of
yfor thisPin. This corresponds to theyattribute of a<pin>in an Eagle file.Return type: float
-
remove_child(efp)[source]¶ Remove a child
EagleFilePartobject.Parameters: efp – the class:EagleFilePart object to remove. Returns: Nothing
-
set_direction(v)[source]¶ Set the value of
directionfor thisPin. This corresponds to thedirectionattribute of a<pin>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_function(v)[source]¶ Set the value of
functionfor thisPin. This corresponds to thefunctionattribute of a<pin>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_length(v)[source]¶ Set the value of
lengthfor thisPin. This corresponds to thelengthattribute of a<pin>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_name(v)[source]¶ Set the value of
namefor thisPin. This corresponds to thenameattribute of a<pin>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_rot(v)[source]¶ Set the value of
rotfor thisPin. This corresponds to therotattribute of a<pin>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_swaplevel(v)[source]¶ Set the value of
swaplevelfor thisPin. This corresponds to theswaplevelattribute of a<pin>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_visible(v)[source]¶ Set the value of
visiblefor thisPin. This corresponds to thevisibleattribute of a<pin>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_x(v)[source]¶ Set the value of
xfor thisPin. This corresponds to thexattribute of a<pin>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_y(v)[source]¶ Set the value of
yfor thisPin. This corresponds to theyattribute of a<pin>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
with_direction(v)[source]¶ Filter this
EagleFilePartobject based on the value ofdirection. For use in combination withFromobjects.Return
selfif one of the following is true:directionequalsvvis callable andv(self.get_direction()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_function(v)[source]¶ Filter this
EagleFilePartobject based on the value offunction. For use in combination withFromobjects.Return
selfif one of the following is true:functionequalsvvis callable andv(self.get_function()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_length(v)[source]¶ Filter this
EagleFilePartobject based on the value oflength. For use in combination withFromobjects.Return
selfif one of the following is true:lengthequalsvvis callable andv(self.get_length()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_name(v)[source]¶ Filter this
EagleFilePartobject based on the value ofname. For use in combination withFromobjects.Return
selfif one of the following is true:nameequalsvvis callable andv(self.get_name()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_rot(v)[source]¶ Filter this
EagleFilePartobject based on the value ofrot. For use in combination withFromobjects.Return
selfif one of the following is true:rotequalsvvis callable andv(self.get_rot()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_swaplevel(v)[source]¶ Filter this
EagleFilePartobject based on the value ofswaplevel. For use in combination withFromobjects.Return
selfif one of the following is true:swaplevelequalsvvis callable andv(self.get_swaplevel()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_visible(v)[source]¶ Filter this
EagleFilePartobject based on the value ofvisible. For use in combination withFromobjects.Return
selfif one of the following is true:visibleequalsvvis callable andv(self.get_visible()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_x(v)[source]¶ Filter this
EagleFilePartobject based on the value ofx. For use in combination withFromobjects.Return
selfif one of the following is true:xequalsvvis callable andv(self.get_x()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_y(v)[source]¶ Filter this
EagleFilePartobject based on the value ofy. For use in combination withFromobjects.Return
selfif one of the following is true:yequalsvvis callable andv(self.get_y()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
Pinref¶
-
class
Swoop.Pinref[source]¶ Bases:
Swoop.Swoop.EagleFilePartClass representing the contents of a <pinref> tag in Eagle files.
Attributes:
partgatepin
-
clone()[source]¶ Recursively clone this
Pinref. It will be identical to the original, but it’s parent will beNone.Return type: Pinref
-
dump(indent='', increment=' ')[source]¶ Recursive debug dump.
Parameters: - indent – Indentation string. The output will be indented by this much.
- increment – This will be appendeded to
indenton recursive invocations.
Return type: None
-
find_gate()[source]¶ Find the
Gateobject refered to by thegateattribute of this object. This is likeget_gate(), except it returns theGateobject instead of its name.Returns: The object Return type: Gate
-
find_part()[source]¶ Find the
Partobject refered to by thepartattribute of this object. This is likeget_part(), except it returns thePartobject instead of its name.Returns: The object Return type: Part
-
find_pin()[source]¶ Find the
Pinobject refered to by thepinattribute of this object. This is likeget_pin(), except it returns thePinobject instead of its name.Returns: The object Return type: Pin
-
get_children()[source]¶ Get all the children of this
EagleFilePart.Return type: List of EagleFilePartobjects
-
get_gate()[source]¶ Return the value of
gatefor thisPinref. This corresponds to thegateattribute of a<pinref>in an Eagle file.Return type: str
-
get_part()[source]¶ Return the value of
partfor thisPinref. This corresponds to thepartattribute of a<pinref>in an Eagle file.Return type: str
-
get_pin()[source]¶ Return the value of
pinfor thisPinref. This corresponds to thepinattribute of a<pinref>in an Eagle file.Return type: str
-
remove_child(efp)[source]¶ Remove a child
EagleFilePartobject.Parameters: efp – the class:EagleFilePart object to remove. Returns: Nothing
-
set_gate(v)[source]¶ Set the value of
gatefor thisPinref. This corresponds to thegateattribute of a<pinref>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_part(v)[source]¶ Set the value of
partfor thisPinref. This corresponds to thepartattribute of a<pinref>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_pin(v)[source]¶ Set the value of
pinfor thisPinref. This corresponds to thepinattribute of a<pinref>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
with_gate(v)[source]¶ Filter this
EagleFilePartobject based on the value ofgate. For use in combination withFromobjects.Return
selfif one of the following is true:gateequalsvvis callable andv(self.get_gate()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_part(v)[source]¶ Filter this
EagleFilePartobject based on the value ofpart. For use in combination withFromobjects.Return
selfif one of the following is true:partequalsvvis callable andv(self.get_part()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_pin(v)[source]¶ Filter this
EagleFilePartobject based on the value ofpin. For use in combination withFromobjects.Return
selfif one of the following is true:pinequalsvvis callable andv(self.get_pin()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
Port¶
-
class
Swoop.Port[source]¶ Bases:
Swoop.Swoop.EagleFilePartClass representing the contents of a <port> tag in Eagle files.
Attributes:
namesidedimensiondirection
-
clone()[source]¶ Recursively clone this
Port. It will be identical to the original, but it’s parent will beNone.Return type: Port
-
dump(indent='', increment=' ')[source]¶ Recursive debug dump.
Parameters: - indent – Indentation string. The output will be indented by this much.
- increment – This will be appendeded to
indenton recursive invocations.
Return type: None
-
get_children()[source]¶ Get all the children of this
EagleFilePart.Return type: List of EagleFilePartobjects
-
get_dimension()[source]¶ Return the value of
dimensionfor thisPort. This corresponds to thedimensionattribute of a<port>in an Eagle file.Return type: str
-
get_direction()[source]¶ Return the value of
directionfor thisPort. This corresponds to thedirectionattribute of a<port>in an Eagle file.Return type: str
-
get_name()[source]¶ Return the value of
namefor thisPort. This corresponds to thenameattribute of a<port>in an Eagle file.Return type: str
-
get_side()[source]¶ Return the value of
sidefor thisPort. This corresponds to thesideattribute of a<port>in an Eagle file.Return type: int
-
remove_child(efp)[source]¶ Remove a child
EagleFilePartobject.Parameters: efp – the class:EagleFilePart object to remove. Returns: Nothing
-
set_dimension(v)[source]¶ Set the value of
dimensionfor thisPort. This corresponds to thedimensionattribute of a<port>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_direction(v)[source]¶ Set the value of
directionfor thisPort. This corresponds to thedirectionattribute of a<port>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_name(v)[source]¶ Set the value of
namefor thisPort. This corresponds to thenameattribute of a<port>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_side(v)[source]¶ Set the value of
sidefor thisPort. This corresponds to thesideattribute of a<port>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
with_dimension(v)[source]¶ Filter this
EagleFilePartobject based on the value ofdimension. For use in combination withFromobjects.Return
selfif one of the following is true:dimensionequalsvvis callable andv(self.get_dimension()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_direction(v)[source]¶ Filter this
EagleFilePartobject based on the value ofdirection. For use in combination withFromobjects.Return
selfif one of the following is true:directionequalsvvis callable andv(self.get_direction()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_name(v)[source]¶ Filter this
EagleFilePartobject based on the value ofname. For use in combination withFromobjects.Return
selfif one of the following is true:nameequalsvvis callable andv(self.get_name()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_side(v)[source]¶ Filter this
EagleFilePartobject based on the value ofside. For use in combination withFromobjects.Return
selfif one of the following is true:sideequalsvvis callable andv(self.get_side()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
Portref¶
-
class
Swoop.Portref[source]¶ Bases:
Swoop.Swoop.EagleFilePartClass representing the contents of a <portref> tag in Eagle files.
Attributes:
moduleinstport
-
clone()[source]¶ Recursively clone this
Portref. It will be identical to the original, but it’s parent will beNone.Return type: Portref
-
dump(indent='', increment=' ')[source]¶ Recursive debug dump.
Parameters: - indent – Indentation string. The output will be indented by this much.
- increment – This will be appendeded to
indenton recursive invocations.
Return type: None
-
find_moduleinst()[source]¶ Find the
Moduleinstobject refered to by themoduleinstattribute of this object. This is likeget_moduleinst(), except it returns theModuleinstobject instead of its name.Returns: The object Return type: Moduleinst
-
find_port()[source]¶ Find the
Portobject refered to by theportattribute of this object. This is likeget_port(), except it returns thePortobject instead of its name.Returns: The object Return type: Port
-
get_children()[source]¶ Get all the children of this
EagleFilePart.Return type: List of EagleFilePartobjects
-
get_moduleinst()[source]¶ Return the value of
moduleinstfor thisPortref. This corresponds to themoduleinstattribute of a<portref>in an Eagle file.Return type: str
-
get_port()[source]¶ Return the value of
portfor thisPortref. This corresponds to theportattribute of a<portref>in an Eagle file.Return type: str
-
remove_child(efp)[source]¶ Remove a child
EagleFilePartobject.Parameters: efp – the class:EagleFilePart object to remove. Returns: Nothing
-
set_moduleinst(v)[source]¶ Set the value of
moduleinstfor thisPortref. This corresponds to themoduleinstattribute of a<portref>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_port(v)[source]¶ Set the value of
portfor thisPortref. This corresponds to theportattribute of a<portref>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
with_moduleinst(v)[source]¶ Filter this
EagleFilePartobject based on the value ofmoduleinst. For use in combination withFromobjects.Return
selfif one of the following is true:moduleinstequalsvvis callable andv(self.get_moduleinst()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_port(v)[source]¶ Filter this
EagleFilePartobject based on the value ofport. For use in combination withFromobjects.Return
selfif one of the following is true:portequalsvvis callable andv(self.get_port()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
Schematic¶
-
class
Swoop.Schematic[source]¶ Bases:
Swoop.Swoop.EagleFilePartClass representing the contents of a <schematic> tag in Eagle files.
Attributes:
xreflabelxrefpart
-
clone()[source]¶ Recursively clone this
Schematic. It will be identical to the original, but it’s parent will beNone.Return type: Schematic
-
dump(indent='', increment=' ')[source]¶ Recursive debug dump.
Parameters: - indent – Indentation string. The output will be indented by this much.
- increment – This will be appendeded to
indenton recursive invocations.
Return type: None
-
get_children()[source]¶ Get all the children of this
EagleFilePart.Return type: List of EagleFilePartobjects
-
get_xreflabel()[source]¶ Return the value of
xreflabelfor thisSchematic. This corresponds to thexreflabelattribute of a<schematic>in an Eagle file.Return type: str
-
get_xrefpart()[source]¶ Return the value of
xrefpartfor thisSchematic. This corresponds to thexrefpartattribute of a<schematic>in an Eagle file.Return type: str
-
remove_child(efp)[source]¶ Remove a child
EagleFilePartobject.Parameters: efp – the class:EagleFilePart object to remove. Returns: Nothing
-
set_xreflabel(v)[source]¶ Set the value of
xreflabelfor thisSchematic. This corresponds to thexreflabelattribute of a<schematic>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_xrefpart(v)[source]¶ Set the value of
xrefpartfor thisSchematic. This corresponds to thexrefpartattribute of a<schematic>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
with_xreflabel(v)[source]¶ Filter this
EagleFilePartobject based on the value ofxreflabel. For use in combination withFromobjects.Return
selfif one of the following is true:xreflabelequalsvvis callable andv(self.get_xreflabel()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_xrefpart(v)[source]¶ Filter this
EagleFilePartobject based on the value ofxrefpart. For use in combination withFromobjects.Return
selfif one of the following is true:xrefpartequalsvvis callable andv(self.get_xrefpart()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
Segment¶
-
class
Swoop.Segment[source]¶ Bases:
Swoop.Swoop.EagleFilePartClass representing the contents of a <segment> tag in Eagle files.
Attributes:
Collections:
pinref: List ofPinrefobjects.portref: List ofPortrefobjects.wire: List ofWireobjects.junction: List ofJunctionobjects.label: List ofLabelobjects.
-
add_junction(s)[source]¶ Add a
Junctionto thejunctionsof thisSegment.Parameters: s – The Junctionto add.Return type: self
-
add_label(s)[source]¶ Add a
Labelto thelabelsof thisSegment.Parameters: s – The Labelto add.Return type: self
-
add_pinref(s)[source]¶ Add a
Pinrefto thepinrefsof thisSegment.Parameters: s – The Pinrefto add.Return type: self
-
add_portref(s)[source]¶ Add a
Portrefto theportrefsof thisSegment.Parameters: s – The Portrefto add.Return type: self
-
add_wire(s)[source]¶ Add a
Wireto thewiresof thisSegment.Parameters: s – The Wireto add.Return type: self
-
clear_junctions()[source]¶ Remove all the
Junctionobjects from thejunctionsof thisSegment.Return type: self
-
clear_labels()[source]¶ Remove all the
Labelobjects from thelabelsof thisSegment.Return type: self
-
clear_pinrefs()[source]¶ Remove all the
Pinrefobjects from thepinrefsof thisSegment.Return type: self
-
clear_portrefs()[source]¶ Remove all the
Portrefobjects from theportrefsof thisSegment.Return type: self
-
clone()[source]¶ Recursively clone this
Segment. It will be identical to the original, but it’s parent will beNone.Return type: Segment
-
dump(indent='', increment=' ')[source]¶ Recursive debug dump.
Parameters: - indent – Indentation string. The output will be indented by this much.
- increment – This will be appendeded to
indenton recursive invocations.
Return type: None
-
get_children()[source]¶ Get all the children of this
EagleFilePart.Return type: List of EagleFilePartobjects
-
get_junctions(attrs=None, type=None)[source]¶ Return (and possibly filter) items in the the
junctionslist ofJunctionobjects for thisSegment.This functions provides a mechanism for filtering the items as well. The keys in
attrsare taken as attributes names and the values are requested values. Items in the list that have all the requested values for the corresponding attributes will be returned.A if
typeis notNone, the item will match if it is an instance of the type provided.Parameters: - attrs – A set of key-value pairs that represent a filter to apply to the item’s attributes.
- type – A type to filter on. Only items that are an instance of this type will be returned.
Returns: A List of
JunctionobjectsReturn type: List of
Junctionobjects
-
get_labels(attrs=None, type=None)[source]¶ Return (and possibly filter) items in the the
labelslist ofLabelobjects for thisSegment.This functions provides a mechanism for filtering the items as well. The keys in
attrsare taken as attributes names and the values are requested values. Items in the list that have all the requested values for the corresponding attributes will be returned.A if
typeis notNone, the item will match if it is an instance of the type provided.Parameters: - attrs – A set of key-value pairs that represent a filter to apply to the item’s attributes.
- type – A type to filter on. Only items that are an instance of this type will be returned.
Returns: A List of
LabelobjectsReturn type: List of
Labelobjects
-
get_nth_junction(n)[source]¶ get then nth
Junctionobject from thejunctionsof thisSegment.Parameters: n – Index of the item to return. Return type: Junctionobject
-
get_nth_label(n)[source]¶ get then nth
Labelobject from thelabelsof thisSegment.Parameters: n – Index of the item to return. Return type: Labelobject
-
get_nth_pinref(n)[source]¶ get then nth
Pinrefobject from thepinrefsof thisSegment.Parameters: n – Index of the item to return. Return type: Pinrefobject
-
get_nth_portref(n)[source]¶ get then nth
Portrefobject from theportrefsof thisSegment.Parameters: n – Index of the item to return. Return type: Portrefobject
-
get_nth_wire(n)[source]¶ get then nth
Wireobject from thewiresof thisSegment.Parameters: n – Index of the item to return. Return type: Wireobject
-
get_pinrefs(attrs=None, type=None)[source]¶ Return (and possibly filter) items in the the
pinrefslist ofPinrefobjects for thisSegment.This functions provides a mechanism for filtering the items as well. The keys in
attrsare taken as attributes names and the values are requested values. Items in the list that have all the requested values for the corresponding attributes will be returned.A if
typeis notNone, the item will match if it is an instance of the type provided.Parameters: - attrs – A set of key-value pairs that represent a filter to apply to the item’s attributes.
- type – A type to filter on. Only items that are an instance of this type will be returned.
Returns: A List of
PinrefobjectsReturn type: List of
Pinrefobjects
-
get_portrefs(attrs=None, type=None)[source]¶ Return (and possibly filter) items in the the
portrefslist ofPortrefobjects for thisSegment.This functions provides a mechanism for filtering the items as well. The keys in
attrsare taken as attributes names and the values are requested values. Items in the list that have all the requested values for the corresponding attributes will be returned.A if
typeis notNone, the item will match if it is an instance of the type provided.Parameters: - attrs – A set of key-value pairs that represent a filter to apply to the item’s attributes.
- type – A type to filter on. Only items that are an instance of this type will be returned.
Returns: A List of
PortrefobjectsReturn type: List of
Portrefobjects
-
get_wires(attrs=None, type=None)[source]¶ Return (and possibly filter) items in the the
wireslist ofWireobjects for thisSegment.This functions provides a mechanism for filtering the items as well. The keys in
attrsare taken as attributes names and the values are requested values. Items in the list that have all the requested values for the corresponding attributes will be returned.A if
typeis notNone, the item will match if it is an instance of the type provided.Parameters: - attrs – A set of key-value pairs that represent a filter to apply to the item’s attributes.
- type – A type to filter on. Only items that are an instance of this type will be returned.
Returns: A List of
WireobjectsReturn type: List of
Wireobjects
-
remove_child(efp)[source]¶ Remove a child
EagleFilePartobject.Parameters: efp – the class:EagleFilePart object to remove. Returns: Nothing
-
remove_junction(efp)[source]¶ Remove a
Junctionfrom thejunctionsof thisSegment.Parameters: efp – The Junctionobject to remove.Return type: self
-
remove_label(efp)[source]¶ Remove a
Labelfrom thelabelsof thisSegment.Parameters: efp – The Labelobject to remove.Return type: self
-
remove_pinref(efp)[source]¶ Remove a
Pinreffrom thepinrefsof thisSegment.Parameters: efp – The Pinrefobject to remove.Return type: self