Classes for Library Files (.lbr)¶
These classes are used only within Eagle library files (.lbr) and in the libraries that are included in both .sch and .brd files.
If you are new to Swoop and trying to understand how these data structures map
onto items in Eagle, it is useful to know that DeviceSet corresponds
to what the Eagle GUI calls a “Device” and Device corresponds to what
the GUI calls a “Variant”
LibraryFile¶
-
class
Swoop.Base_LibraryFile[source]¶ Bases:
Swoop.Swoop.EagleFileClass representing the contents of a <eagle> tag in Eagle files.
Attributes:
version
Collections:
grid: SingletonGridobject.library: SingletonLibraryobject.compatibility: SingletonCompatibilityobject.setting: List ofSettingobjects.layer: Map ofLayerobjects indexed by theirname.
-
add_setting(s)[source]¶ Add a
Settingto thesettingsof thisLibraryFile.Parameters: s – The Settingto add.Return type: self
-
clear_settings()[source]¶ Remove all the
Settingobjects from thesettingsof thisLibraryFile.Return type: self
-
clone()[source]¶ Recursively clone this
LibraryFile. It will be identical to the original, but it’s parent will beNone.Return type: LibraryFile
-
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_compatibility()[source]¶ Get the compatibility from this
LibraryFile.Return type: Compatibilityobject
-
get_nth_setting(n)[source]¶ get then nth
Settingobject from thesettingsof thisLibraryFile.Parameters: n – Index of the item to return. Return type: Settingobject
-
get_settings(attrs=None, type=None)[source]¶ Return (and possibly filter) items in the the
settingslist ofSettingobjects for thisLibraryFile.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_version()[source]¶ Return the value of
versionfor thisLibraryFile. This corresponds to theversionattribute of a<eagle>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
-
remove_setting(efp)[source]¶ Remove a
Settingfrom thesettingsof thisLibraryFile.Parameters: efp – The Settingobject to remove.Return type: self
-
set_compatibility(s)[source]¶ Set the
Compatibilityfor thisLibraryFile.Parameters: s – Compatibilityto set.Return type: self
-
set_grid(s)[source]¶ Set the
Gridfor thisLibraryFile.Parameters: s – Gridto set.Return type: self
-
set_library(s)[source]¶ Set the
Libraryfor thisLibraryFile.Parameters: s – Libraryto set.Return type: self
-
set_version(v)[source]¶ Set the value of
versionfor thisLibraryFile. 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
Library¶
-
class
Swoop.Library[source]¶ Bases:
Swoop.Swoop.EagleFilePartClass representing the contents of a <library> tag in Eagle files.
Attributes:
name
Collections:
description: SingletonDescriptionobject.package: Map ofPackageobjects indexed by theirname.symbol: Map ofSymbolobjects indexed by theirname.deviceset: Map ofDevicesetobjects indexed by theirname.
-
add_deviceset(s)[source]¶ Add a
Devicesetto thedevicesetsof thisLibrary.Parameters: s – The Devicesetto add.Return type: self
-
add_package(s)[source]¶ Add a
Packageto thepackagesof thisLibrary.Parameters: s – The Packageto add.Return type: self
-
add_symbol(s)[source]¶ Add a
Symbolto thesymbolsof thisLibrary.Parameters: s – The Symbolto add.Return type: self
-
clear_devicesets()[source]¶ Remove all the
Devicesetobjects from thedevicesetsof thisLibrary.Return type: self
-
clear_packages()[source]¶ Remove all the
Packageobjects from thepackagesof thisLibrary.Return type: self
-
clear_symbols()[source]¶ Remove all the
Symbolobjects from thesymbolsof thisLibrary.Return type: self
-
clone()[source]¶ Recursively clone this
Library. It will be identical to the original, but it’s parent will beNone.Return type: Library
-
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
Library.Return type: Descriptionobject
-
get_deviceset(key)[source]¶ Lookup and return a
Devicesetfrom thedevicesetsof thisLibrary.Parameters: key – A strto use for the lookup. The lookup uses thenameof theDevicesetobjects.Return type: A Devicesetobject orNone, if there is no such item.
-
get_devicesets(attrs=None, type=None)[source]¶ Return (and possibly filter) items in the the
devicesetsmap ofDevicesetobjects for thisLibrary.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
DevicesetobjectsReturn type: List of
Devicesetobjects
-
get_name()[source]¶ Return the value of
namefor thisLibrary. This corresponds to thenameattribute of a<library>in an Eagle file.Return type: str
-
get_nth_deviceset(n)[source]¶ get then nth
Devicesetobject from thedevicesetsof thisLibrary.Parameters: n – Index of the item to return. Return type: Devicesetobject
-
get_nth_package(n)[source]¶ get then nth
Packageobject from thepackagesof thisLibrary.Parameters: n – Index of the item to return. Return type: Packageobject
-
get_nth_symbol(n)[source]¶ get then nth
Symbolobject from thesymbolsof thisLibrary.Parameters: n – Index of the item to return. Return type: Symbolobject
-
get_package(key)[source]¶ Lookup and return a
Packagefrom thepackagesof thisLibrary.Parameters: key – A strto use for the lookup. The lookup uses thenameof thePackageobjects.Return type: A Packageobject orNone, if there is no such item.
-
get_packages(attrs=None, type=None)[source]¶ Return (and possibly filter) items in the the
packagesmap ofPackageobjects for thisLibrary.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
PackageobjectsReturn type: List of
Packageobjects
-
get_symbol(key)[source]¶ Lookup and return a
Symbolfrom thesymbolsof thisLibrary.Parameters: key – A strto use for the lookup. The lookup uses thenameof theSymbolobjects.Return type: A Symbolobject orNone, if there is no such item.
-
get_symbols(attrs=None, type=None)[source]¶ Return (and possibly filter) items in the the
symbolsmap ofSymbolobjects for thisLibrary.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
SymbolobjectsReturn type: List of
Symbolobjects
-
remove_child(efp)[source]¶ Remove a child
EagleFilePartobject.Parameters: efp – the class:EagleFilePart object to remove. Returns: Nothing
-
remove_deviceset(efp)[source]¶ Remove a
Devicesetfrom thedevicesetsof thisLibrary.Parameters: efp – The Devicesetobject to remove.Return type: self
-
remove_package(efp)[source]¶ Remove a
Packagefrom thepackagesof thisLibrary.Parameters: efp – The Packageobject to remove.Return type: self
-
remove_symbol(efp)[source]¶ Remove a
Symbolfrom thesymbolsof thisLibrary.Parameters: efp – The Symbolobject to remove.Return type: self
-
set_description(s)[source]¶ Set the
Descriptionfor thisLibrary.Parameters: s – Descriptionto set.Return type: self
-
set_name(v)[source]¶ Set the value of
namefor thisLibrary. This corresponds to thenameattribute of a<library>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
Package¶
-
class
Swoop.Package[source]¶ Bases:
Swoop.Swoop.EagleFilePartClass representing the contents of a <package> tag in Eagle files.
Attributes:
name
Collections:
description: SingletonDescriptionobject.drawing_element: List ofPolygon,Wire,Text,Dimension,Circle,Rectangle,HoleandFrameobjects.pad: Map ofPadobjects indexed by theirname.smd: Map ofSmdobjects indexed by theirname.
-
add_drawing_element(s)[source]¶ Add a
Polygon,Wire,Text,Dimension,Circle,Rectangle,HoleorFrameto thedrawing_elementsof thisPackage.Parameters: s – The Polygon,Wire,Text,Dimension,Circle,Rectangle,HoleorFrameto add.Return type: self
-
add_pad(s)[source]¶ Add a
Padto thepadsof thisPackage.Parameters: s – The Padto add.Return type: self
-
add_smd(s)[source]¶ Add a
Smdto thesmdsof thisPackage.Parameters: s – The Smdto add.Return type: self
-
clear_drawing_elements()[source]¶ Remove all the
Polygon,Wire,Text,Dimension,Circle,Rectangle,HoleandFrameobjects from thedrawing_elementsof thisPackage.Return type: self
-
clone()[source]¶ Recursively clone this
Package. It will be identical to the original, but it’s parent will beNone.Return type: Package
-
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
Package.Return type: Descriptionobject
-
get_drawing_elements(attrs=None, type=None)[source]¶ Return (and possibly filter) items in the the
drawing_elementslist ofPolygon,Wire,Text,Dimension,Circle,Rectangle,HoleorFrameobjects for thisPackage.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,HoleandFrameobjectsReturn type: List of
Polygon,Wire,Text,Dimension,Circle,Rectangle,HoleandFrameobjects
-
get_name()[source]¶ Return the value of
namefor thisPackage. This corresponds to thenameattribute of a<package>in an Eagle file.Return type: str
-
get_nth_drawing_element(n)[source]¶ get then nth
Polygon,Wire,Text,Dimension,Circle,Rectangle,HoleorFrameobject from thedrawing_elementsof thisPackage.Parameters: n – Index of the item to return. Return type: Polygon,Wire,Text,Dimension,Circle,Rectangle,HoleorFrameobject
-
get_nth_pad(n)[source]¶ get then nth
Padobject from thepadsof thisPackage.Parameters: n – Index of the item to return. Return type: Padobject
-
get_nth_smd(n)[source]¶ get then nth
Smdobject from thesmdsof thisPackage.Parameters: n – Index of the item to return. Return type: Smdobject
-
get_pad(key)[source]¶ Lookup and return a
Padfrom thepadsof thisPackage.Parameters: key – A strto use for the lookup. The lookup uses thenameof thePadobjects.Return type: A Padobject orNone, if there is no such item.
-
get_pads(attrs=None, type=None)[source]¶ Return (and possibly filter) items in the the
padsmap ofPadobjects for thisPackage.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
PadobjectsReturn type: List of
Padobjects
-
get_smd(key)[source]¶ Lookup and return a
Smdfrom thesmdsof thisPackage.Parameters: key – A strto use for the lookup. The lookup uses thenameof theSmdobjects.Return type: A Smdobject orNone, if there is no such item.
-
get_smds(attrs=None, type=None)[source]¶ Return (and possibly filter) items in the the
smdsmap ofSmdobjects for thisPackage.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
SmdobjectsReturn type: List of
Smdobjects
-
remove_child(efp)[source]¶ Remove a child
EagleFilePartobject.Parameters: efp – the class:EagleFilePart object to remove. Returns: Nothing
-
remove_drawing_element(efp)[source]¶ Remove a
Polygon,Wire,Text,Dimension,Circle,Rectangle,HoleorFramefrom thedrawing_elementsof thisPackage.Parameters: efp – The Polygon,Wire,Text,Dimension,Circle,Rectangle,HoleorFrameobject to remove.Return type: self
-
remove_pad(efp)[source]¶ Remove a
Padfrom thepadsof thisPackage.Parameters: efp – The Padobject to remove.Return type: self
-
remove_smd(efp)[source]¶ Remove a
Smdfrom thesmdsof thisPackage.Parameters: efp – The Smdobject to remove.Return type: self
-
set_description(s)[source]¶ Set the
Descriptionfor thisPackage.Parameters: s – Descriptionto set.Return type: self
-
set_name(v)[source]¶ Set the value of
namefor thisPackage. This corresponds to thenameattribute of a<package>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
Symbol¶
-
class
Swoop.Symbol[source]¶ Bases:
Swoop.Swoop.EagleFilePartClass representing the contents of a <symbol> tag in Eagle files.
Attributes:
name
Collections:
description: SingletonDescriptionobject.drawing_element: List ofPolygon,Wire,Text,Dimension,Circle,RectangleandHoleobjects.pin: Map ofPinobjects indexed by theirname.
-
add_drawing_element(s)[source]¶ Add a
Polygon,Wire,Text,Dimension,Circle,RectangleorHoleto thedrawing_elementsof thisSymbol.Parameters: s – The Polygon,Wire,Text,Dimension,Circle,RectangleorHoleto add.Return type: self
-
add_pin(s)[source]¶ Add a
Pinto thepinsof thisSymbol.Parameters: s – The Pinto add.Return type: self
-
clear_drawing_elements()[source]¶ Remove all the
Polygon,Wire,Text,Dimension,Circle,RectangleandHoleobjects from thedrawing_elementsof thisSymbol.Return type: self
-
clone()[source]¶ Recursively clone this
Symbol. It will be identical to the original, but it’s parent will beNone.Return type: Symbol
-
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
Symbol.Return type: Descriptionobject
-
get_drawing_elements(attrs=None, type=None)[source]¶ Return (and possibly filter) items in the the
drawing_elementslist ofPolygon,Wire,Text,Dimension,Circle,RectangleorHoleobjects for thisSymbol.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,RectangleandHoleobjectsReturn type: List of
Polygon,Wire,Text,Dimension,Circle,RectangleandHoleobjects
-
get_name()[source]¶ Return the value of
namefor thisSymbol. This corresponds to thenameattribute of a<symbol>in an Eagle file.Return type: str
-
get_nth_drawing_element(n)[source]¶ get then nth
Polygon,Wire,Text,Dimension,Circle,RectangleorHoleobject from thedrawing_elementsof thisSymbol.Parameters: n – Index of the item to return. Return type: Polygon,Wire,Text,Dimension,Circle,RectangleorHoleobject
-
get_nth_pin(n)[source]¶ get then nth
Pinobject from thepinsof thisSymbol.Parameters: n – Index of the item to return. Return type: Pinobject
-
get_pin(key)[source]¶ Lookup and return a
Pinfrom thepinsof thisSymbol.Parameters: key – A strto use for the lookup. The lookup uses thenameof thePinobjects.Return type: A Pinobject orNone, if there is no such item.
-
get_pins(attrs=None, type=None)[source]¶ Return (and possibly filter) items in the the
pinsmap ofPinobjects for thisSymbol.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
PinobjectsReturn type: List of
Pinobjects
-
remove_child(efp)[source]¶ Remove a child
EagleFilePartobject.Parameters: efp – the class:EagleFilePart object to remove. Returns: Nothing
-
remove_drawing_element(efp)[source]¶ Remove a
Polygon,Wire,Text,Dimension,Circle,RectangleorHolefrom thedrawing_elementsof thisSymbol.Parameters: efp – The Polygon,Wire,Text,Dimension,Circle,RectangleorHoleobject to remove.Return type: self
-
remove_pin(efp)[source]¶ Remove a
Pinfrom thepinsof thisSymbol.Parameters: efp – The Pinobject to remove.Return type: self
-
set_description(s)[source]¶ Set the
Descriptionfor thisSymbol.Parameters: s – Descriptionto set.Return type: self
-
set_name(v)[source]¶ Set the value of
namefor thisSymbol. This corresponds to thenameattribute of a<symbol>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
Deviceset¶
-
class
Swoop.Deviceset[source]¶ Bases:
Swoop.Swoop.EagleFilePartClass representing the contents of a <deviceset> tag in Eagle files.
Attributes:
nameprefixuservalue
Collections:
description: SingletonDescriptionobject.gate: Map ofGateobjects indexed by theirname.device: Map ofDeviceobjects indexed by theirname.
-
add_device(s)[source]¶ Add a
Deviceto thedevicesof thisDeviceset.Parameters: s – The Deviceto add.Return type: self
-
add_gate(s)[source]¶ Add a
Gateto thegatesof thisDeviceset.Parameters: s – The Gateto add.Return type: self
-
clear_devices()[source]¶ Remove all the
Deviceobjects from thedevicesof thisDeviceset.Return type: self
-
clear_gates()[source]¶ Remove all the
Gateobjects from thegatesof thisDeviceset.Return type: self
-
clone()[source]¶ Recursively clone this
Deviceset. It will be identical to the original, but it’s parent will beNone.Return type: Deviceset
-
convertToExternal()¶ This converts the
Devicesetinto an external deviceset. This means that it has no associated package. It can, however, have attributes, and those are stored in the “” device. You can’t just delete all the packages, since you’d lose the attributes. This copies them from the first package.
-
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
Deviceset.Return type: Descriptionobject
-
get_device(key)[source]¶ Lookup and return a
Devicefrom thedevicesof thisDeviceset.Parameters: key – A strto use for the lookup. The lookup uses thenameof theDeviceobjects.Return type: A Deviceobject orNone, if there is no such item.
-
get_devices(attrs=None, type=None)[source]¶ Return (and possibly filter) items in the the
devicesmap ofDeviceobjects for thisDeviceset.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
DeviceobjectsReturn type: List of
Deviceobjects
-
get_gate(key)[source]¶ Lookup and return a
Gatefrom thegatesof thisDeviceset.Parameters: key – A strto use for the lookup. The lookup uses thenameof theGateobjects.Return type: A Gateobject orNone, if there is no such item.
-
get_gates(attrs=None, type=None)[source]¶ Return (and possibly filter) items in the the
gatesmap ofGateobjects for thisDeviceset.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
GateobjectsReturn type: List of
Gateobjects
-
get_name()[source]¶ Return the value of
namefor thisDeviceset. This corresponds to thenameattribute of a<deviceset>in an Eagle file.Return type: str
-
get_nth_device(n)[source]¶ get then nth
Deviceobject from thedevicesof thisDeviceset.Parameters: n – Index of the item to return. Return type: Deviceobject
-
get_nth_gate(n)[source]¶ get then nth
Gateobject from thegatesof thisDeviceset.Parameters: n – Index of the item to return. Return type: Gateobject
-
get_prefix()[source]¶ Return the value of
prefixfor thisDeviceset. This corresponds to theprefixattribute of a<deviceset>in an Eagle file.Return type: str
-
get_uservalue()[source]¶ Return the value of
uservaluefor thisDeviceset. This corresponds to theuservalueattribute of a<deviceset>in an Eagle file.Return type: bool
-
remove_child(efp)[source]¶ Remove a child
EagleFilePartobject.Parameters: efp – the class:EagleFilePart object to remove. Returns: Nothing
-
remove_device(efp)[source]¶ Remove a
Devicefrom thedevicesof thisDeviceset.Parameters: efp – The Deviceobject to remove.Return type: self
-
remove_gate(efp)[source]¶ Remove a
Gatefrom thegatesof thisDeviceset.Parameters: efp – The Gateobject to remove.Return type: self
-
set_description(s)[source]¶ Set the
Descriptionfor thisDeviceset.Parameters: s – Descriptionto set.Return type: self
-
set_name(v)[source]¶ Set the value of
namefor thisDeviceset. This corresponds to thenameattribute of a<deviceset>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_prefix(v)[source]¶ Set the value of
prefixfor thisDeviceset. This corresponds to theprefixattribute of a<deviceset>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_uservalue(v)[source]¶ Set the value of
uservaluefor thisDeviceset. This corresponds to theuservalueattribute of a<deviceset>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
-
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
-
with_uservalue(v)[source]¶ Filter this
EagleFilePartobject based on the value ofuservalue. For use in combination withFromobjects.Return
selfif one of the following is true:uservalueequalsvvis callable andv(self.get_uservalue()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
Device¶
-
class
Swoop.Device[source]¶ Bases:
Swoop.Swoop.EagleFilePartClass representing the contents of a <device> tag in Eagle files.
Attributes:
namepackage
Collections:
connect: List ofConnectobjects.technology: Map ofTechnologyobjects indexed by theirname.
-
add_connect(s)[source]¶ Add a
Connectto theconnectsof thisDevice.Parameters: s – The Connectto add.Return type: self
-
add_technology(s)[source]¶ Add a
Technologyto thetechnologiesof thisDevice.Parameters: s – The Technologyto add.Return type: self
-
clear_connects()[source]¶ Remove all the
Connectobjects from theconnectsof thisDevice.Return type: self
-
clear_technologies()[source]¶ Remove all the
Technologyobjects from thetechnologiesof thisDevice.Return type: self
-
clone()[source]¶ Recursively clone this
Device. It will be identical to the original, but it’s parent will beNone.Return type: Device
-
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_package()[source]¶ Find the
Packageobject refered to by thepackageattribute of this object. This is likeget_package(), except it returns thePackageobject instead of its name.Returns: The object Return type: Package
-
get_children()[source]¶ Get all the children of this
EagleFilePart.Return type: List of EagleFilePartobjects
-
get_connects(attrs=None, type=None)[source]¶ Return (and possibly filter) items in the the
connectslist ofConnectobjects for thisDevice.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
ConnectobjectsReturn type: List of
Connectobjects
-
get_name()[source]¶ Return the value of
namefor thisDevice. This corresponds to thenameattribute of a<device>in an Eagle file.Return type: str
-
get_nth_connect(n)[source]¶ get then nth
Connectobject from theconnectsof thisDevice.Parameters: n – Index of the item to return. Return type: Connectobject
-
get_nth_technology(n)[source]¶ get then nth
Technologyobject from thetechnologiesof thisDevice.Parameters: n – Index of the item to return. Return type: Technologyobject
-
get_package()[source]¶ Return the value of
packagefor thisDevice. This corresponds to thepackageattribute of a<device>in an Eagle file.Return type: str
-
get_technologies(attrs=None, type=None)[source]¶ Return (and possibly filter) items in the the
technologiesmap ofTechnologyobjects for thisDevice.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
TechnologyobjectsReturn type: List of
Technologyobjects
-
get_technology(key)[source]¶ Lookup and return a
Technologyfrom thetechnologiesof thisDevice.Parameters: key – A strto use for the lookup. The lookup uses thenameof theTechnologyobjects.Return type: A Technologyobject orNone, if there is no such item.
-
remove_child(efp)[source]¶ Remove a child
EagleFilePartobject.Parameters: efp – the class:EagleFilePart object to remove. Returns: Nothing
-
remove_connect(efp)[source]¶ Remove a
Connectfrom theconnectsof thisDevice.Parameters: efp – The Connectobject to remove.Return type: self
-
remove_technology(efp)[source]¶ Remove a
Technologyfrom thetechnologiesof thisDevice.Parameters: efp – The Technologyobject to remove.Return type: self
-
set_name(v)[source]¶ Set the value of
namefor thisDevice. This corresponds to thenameattribute of a<device>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_package(v)[source]¶ Set the value of
packagefor thisDevice. This corresponds to thepackageattribute of a<device>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
-
with_package(v)[source]¶ Filter this
EagleFilePartobject based on the value ofpackage. For use in combination withFromobjects.Return
selfif one of the following is true:packageequalsvvis callable andv(self.get_package()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
Connect¶
-
class
Swoop.Connect[source]¶ Bases:
Swoop.Swoop.EagleFilePartClass representing the contents of a <connect> tag in Eagle files.
Attributes:
gatepinpadroute
-
clone()[source]¶ Recursively clone this
Connect. It will be identical to the original, but it’s parent will beNone.Return type: Connect
-
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_pad()[source]¶ Find the
Padobject refered to by thepadattribute of this object. This is likeget_pad(), except it returns thePadobject instead of its name.Returns: The object Return type: Pad
-
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 thisConnect. This corresponds to thegateattribute of a<connect>in an Eagle file.Return type: str
-
get_pad()[source]¶ Return the value of
padfor thisConnect. This corresponds to thepadattribute of a<connect>in an Eagle file.Return type: str
-
get_pin()[source]¶ Return the value of
pinfor thisConnect. This corresponds to thepinattribute of a<connect>in an Eagle file.Return type: str
-
get_route()[source]¶ Return the value of
routefor thisConnect. This corresponds to therouteattribute of a<connect>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 thisConnect. This corresponds to thegateattribute of a<connect>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_pad(v)[source]¶ Set the value of
padfor thisConnect. This corresponds to thepadattribute of a<connect>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_pin(v)[source]¶ Set the value of
pinfor thisConnect. This corresponds to thepinattribute of a<connect>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_route(v)[source]¶ Set the value of
routefor thisConnect. This corresponds to therouteattribute of a<connect>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_pad(v)[source]¶ Filter this
EagleFilePartobject based on the value ofpad. For use in combination withFromobjects.Return
selfif one of the following is true:padequalsvvis callable andv(self.get_pad()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
-
with_route(v)[source]¶ Filter this
EagleFilePartobject based on the value ofroute. For use in combination withFromobjects.Return
selfif one of the following is true:routeequalsvvis callable andv(self.get_route()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
Gate¶
-
class
Swoop.Gate[source]¶ Bases:
Swoop.Swoop.EagleFilePartClass representing the contents of a <gate> tag in Eagle files.
Attributes:
namesymbolxyaddlevelswaplevel
-
clone()[source]¶ Recursively clone this
Gate. It will be identical to the original, but it’s parent will beNone.Return type: Gate
-
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_symbol()[source]¶ Find the
Symbolobject refered to by thesymbolattribute of this object. This is likeget_symbol(), except it returns theSymbolobject instead of its name.Returns: The object Return type: Symbol
-
get_addlevel()[source]¶ Return the value of
addlevelfor thisGate. This corresponds to theaddlevelattribute of a<gate>in an Eagle file.Return type: str
-
get_children()[source]¶ Get all the children of this
EagleFilePart.Return type: List of EagleFilePartobjects
-
get_name()[source]¶ Return the value of
namefor thisGate. This corresponds to thenameattribute of a<gate>in an Eagle file.Return type: str
-
get_swaplevel()[source]¶ Return the value of
swaplevelfor thisGate. This corresponds to theswaplevelattribute of a<gate>in an Eagle file.Return type: int
-
get_symbol()[source]¶ Return the value of
symbolfor thisGate. This corresponds to thesymbolattribute of a<gate>in an Eagle file.Return type: str
-
get_x()[source]¶ Return the value of
xfor thisGate. This corresponds to thexattribute of a<gate>in an Eagle file.Return type: float
-
get_y()[source]¶ Return the value of
yfor thisGate. This corresponds to theyattribute of a<gate>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_addlevel(v)[source]¶ Set the value of
addlevelfor thisGate. This corresponds to theaddlevelattribute of a<gate>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_name(v)[source]¶ Set the value of
namefor thisGate. This corresponds to thenameattribute of a<gate>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_swaplevel(v)[source]¶ Set the value of
swaplevelfor thisGate. This corresponds to theswaplevelattribute of a<gate>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_symbol(v)[source]¶ Set the value of
symbolfor thisGate. This corresponds to thesymbolattribute of a<gate>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_x(v)[source]¶ Set the value of
xfor thisGate. This corresponds to thexattribute of a<gate>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_y(v)[source]¶ Set the value of
yfor thisGate. This corresponds to theyattribute of a<gate>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
with_addlevel(v)[source]¶ Filter this
EagleFilePartobject based on the value ofaddlevel. For use in combination withFromobjects.Return
selfif one of the following is true:addlevelequalsvvis callable andv(self.get_addlevel()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_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_symbol(v)[source]¶ Filter this
EagleFilePartobject based on the value ofsymbol. For use in combination withFromobjects.Return
selfif one of the following is true:symbolequalsvvis callable andv(self.get_symbol()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
Pad¶
-
class
Swoop.Pad[source]¶ Bases:
Swoop.Swoop.EagleFilePartClass representing the contents of a <pad> tag in Eagle files.
Attributes:
namexydrilldiametershaperotstopthermalsfirst
-
clone()[source]¶ Recursively clone this
Pad. It will be identical to the original, but it’s parent will beNone.Return type: Pad
-
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_diameter()[source]¶ Return the value of
diameterfor thisPad. This corresponds to thediameterattribute of a<pad>in an Eagle file.Return type: float
-
get_drill()[source]¶ Return the value of
drillfor thisPad. This corresponds to thedrillattribute of a<pad>in an Eagle file.Return type: float
-
get_first()[source]¶ Return the value of
firstfor thisPad. This corresponds to thefirstattribute of a<pad>in an Eagle file.Return type: bool
-
get_name()[source]¶ Return the value of
namefor thisPad. This corresponds to thenameattribute of a<pad>in an Eagle file.Return type: str
-
get_rot()[source]¶ Return the value of
rotfor thisPad. This corresponds to therotattribute of a<pad>in an Eagle file.Return type: str
-
get_shape()[source]¶ Return the value of
shapefor thisPad. This corresponds to theshapeattribute of a<pad>in an Eagle file.Return type: str
-
get_stop()[source]¶ Return the value of
stopfor thisPad. This corresponds to thestopattribute of a<pad>in an Eagle file.Return type: bool
-
get_thermals()[source]¶ Return the value of
thermalsfor thisPad. This corresponds to thethermalsattribute of a<pad>in an Eagle file.Return type: bool
-
get_x()[source]¶ Return the value of
xfor thisPad. This corresponds to thexattribute of a<pad>in an Eagle file.Return type: float
-
get_y()[source]¶ Return the value of
yfor thisPad. This corresponds to theyattribute of a<pad>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_diameter(v)[source]¶ Set the value of
diameterfor thisPad. This corresponds to thediameterattribute of a<pad>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_drill(v)[source]¶ Set the value of
drillfor thisPad. This corresponds to thedrillattribute of a<pad>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_first(v)[source]¶ Set the value of
firstfor thisPad. This corresponds to thefirstattribute of a<pad>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_name(v)[source]¶ Set the value of
namefor thisPad. This corresponds to thenameattribute of a<pad>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_rot(v)[source]¶ Set the value of
rotfor thisPad. This corresponds to therotattribute of a<pad>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_shape(v)[source]¶ Set the value of
shapefor thisPad. This corresponds to theshapeattribute of a<pad>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_stop(v)[source]¶ Set the value of
stopfor thisPad. This corresponds to thestopattribute of a<pad>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_thermals(v)[source]¶ Set the value of
thermalsfor thisPad. This corresponds to thethermalsattribute of a<pad>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_x(v)[source]¶ Set the value of
xfor thisPad. This corresponds to thexattribute of a<pad>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_y(v)[source]¶ Set the value of
yfor thisPad. This corresponds to theyattribute of a<pad>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
with_diameter(v)[source]¶ Filter this
EagleFilePartobject based on the value ofdiameter. For use in combination withFromobjects.Return
selfif one of the following is true:diameterequalsvvis callable andv(self.get_diameter()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_drill(v)[source]¶ Filter this
EagleFilePartobject based on the value ofdrill. For use in combination withFromobjects.Return
selfif one of the following is true:drillequalsvvis callable andv(self.get_drill()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_first(v)[source]¶ Filter this
EagleFilePartobject based on the value offirst. For use in combination withFromobjects.Return
selfif one of the following is true:firstequalsvvis callable andv(self.get_first()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_shape(v)[source]¶ Filter this
EagleFilePartobject based on the value ofshape. For use in combination withFromobjects.Return
selfif one of the following is true:shapeequalsvvis callable andv(self.get_shape()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_stop(v)[source]¶ Filter this
EagleFilePartobject based on the value ofstop. For use in combination withFromobjects.Return
selfif one of the following is true:stopequalsvvis callable andv(self.get_stop()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_thermals(v)[source]¶ Filter this
EagleFilePartobject based on the value ofthermals. For use in combination withFromobjects.Return
selfif one of the following is true:thermalsequalsvvis callable andv(self.get_thermals()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
Smd¶
-
class
Swoop.Smd[source]¶ Bases:
Swoop.Swoop.EagleFilePartClass representing the contents of a <smd> tag in Eagle files.
Attributes:
namexydxdylayerroundnessrotstopthermalscream
-
clone()[source]¶ Recursively clone this
Smd. It will be identical to the original, but it’s parent will beNone.Return type: Smd
-
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_cream()[source]¶ Return the value of
creamfor thisSmd. This corresponds to thecreamattribute of a<smd>in an Eagle file.Return type: bool
-
get_dx()[source]¶ Return the value of
dxfor thisSmd. This corresponds to thedxattribute of a<smd>in an Eagle file.Return type: float
-
get_dy()[source]¶ Return the value of
dyfor thisSmd. This corresponds to thedyattribute of a<smd>in an Eagle file.Return type: float
-
get_layer()[source]¶ Return the value of
layerfor thisSmd. This corresponds to thelayerattribute of a<smd>in an Eagle file.Return type: layer_string
-
get_name()[source]¶ Return the value of
namefor thisSmd. This corresponds to thenameattribute of a<smd>in an Eagle file.Return type: str
-
get_rot()[source]¶ Return the value of
rotfor thisSmd. This corresponds to therotattribute of a<smd>in an Eagle file.Return type: str
-
get_roundness()[source]¶ Return the value of
roundnessfor thisSmd. This corresponds to theroundnessattribute of a<smd>in an Eagle file.Return type: int
-
get_stop()[source]¶ Return the value of
stopfor thisSmd. This corresponds to thestopattribute of a<smd>in an Eagle file.Return type: bool
-
get_thermals()[source]¶ Return the value of
thermalsfor thisSmd. This corresponds to thethermalsattribute of a<smd>in an Eagle file.Return type: bool
-
get_x()[source]¶ Return the value of
xfor thisSmd. This corresponds to thexattribute of a<smd>in an Eagle file.Return type: float
-
get_y()[source]¶ Return the value of
yfor thisSmd. This corresponds to theyattribute of a<smd>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_cream(v)[source]¶ Set the value of
creamfor thisSmd. This corresponds to thecreamattribute of a<smd>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_dx(v)[source]¶ Set the value of
dxfor thisSmd. This corresponds to thedxattribute of a<smd>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_dy(v)[source]¶ Set the value of
dyfor thisSmd. This corresponds to thedyattribute of a<smd>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_layer(v)[source]¶ Set the value of
layerfor thisSmd. This corresponds to thelayerattribute of a<smd>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_name(v)[source]¶ Set the value of
namefor thisSmd. This corresponds to thenameattribute of a<smd>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_rot(v)[source]¶ Set the value of
rotfor thisSmd. This corresponds to therotattribute of a<smd>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_roundness(v)[source]¶ Set the value of
roundnessfor thisSmd. This corresponds to theroundnessattribute of a<smd>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_stop(v)[source]¶ Set the value of
stopfor thisSmd. This corresponds to thestopattribute of a<smd>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_thermals(v)[source]¶ Set the value of
thermalsfor thisSmd. This corresponds to thethermalsattribute of a<smd>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_x(v)[source]¶ Set the value of
xfor thisSmd. This corresponds to thexattribute of a<smd>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_y(v)[source]¶ Set the value of
yfor thisSmd. This corresponds to theyattribute of a<smd>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
with_cream(v)[source]¶ Filter this
EagleFilePartobject based on the value ofcream. For use in combination withFromobjects.Return
selfif one of the following is true:creamequalsvvis callable andv(self.get_cream()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_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_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_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_roundness(v)[source]¶ Filter this
EagleFilePartobject based on the value ofroundness. For use in combination withFromobjects.Return
selfif one of the following is true:roundnessequalsvvis callable andv(self.get_roundness()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_stop(v)[source]¶ Filter this
EagleFilePartobject based on the value ofstop. For use in combination withFromobjects.Return
selfif one of the following is true:stopequalsvvis callable andv(self.get_stop()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_thermals(v)[source]¶ Filter this
EagleFilePartobject based on the value ofthermals. For use in combination withFromobjects.Return
selfif one of the following is true:thermalsequalsvvis callable andv(self.get_thermals()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