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.EagleFile
Class representing the contents of a <eagle> tag in Eagle files.
Attributes:
version
Collections:
grid
: SingletonGrid
object.library
: SingletonLibrary
object.compatibility
: SingletonCompatibility
object.setting
: List ofSetting
objects.layer
: Map ofLayer
objects indexed by theirname
.
-
add_setting
(s)[source]¶ Add a
Setting
to thesettings
of thisLibraryFile
.Parameters: s – The Setting
to add.Return type: self
-
clear_settings
()[source]¶ Remove all the
Setting
objects from thesettings
of 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
indent
on recursive invocations.
Return type: None
-
get_children
()[source]¶ Get all the children of this
EagleFilePart
.Return type: List of EagleFilePart
objects
-
get_compatibility
()[source]¶ Get the compatibility from this
LibraryFile
.Return type: Compatibility
object
-
get_nth_setting
(n)[source]¶ get then nth
Setting
object from thesettings
of thisLibraryFile
.Parameters: n – Index of the item to return. Return type: Setting
object
-
get_settings
(attrs=None, type=None)[source]¶ Return (and possibly filter) items in the the
settings
list ofSetting
objects for thisLibraryFile
.This functions provides a mechanism for filtering the items as well. The keys in
attrs
are 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
type
is 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
Setting
objectsReturn type: List of
Setting
objects
-
get_version
()[source]¶ Return the value of
version
for thisLibraryFile
. This corresponds to theversion
attribute of a<eagle>
in an Eagle file.Return type: str
-
remove_child
(efp)[source]¶ Remove a child
EagleFilePart
object.Parameters: efp – the class:EagleFilePart object to remove. Returns: Nothing
-
remove_setting
(efp)[source]¶ Remove a
Setting
from thesettings
of thisLibraryFile
.Parameters: efp – The Setting
object to remove.Return type: self
-
set_compatibility
(s)[source]¶ Set the
Compatibility
for thisLibraryFile
.Parameters: s – Compatibility
to set.Return type: self
-
set_grid
(s)[source]¶ Set the
Grid
for thisLibraryFile
.Parameters: s – Grid
to set.Return type: self
-
set_library
(s)[source]¶ Set the
Library
for thisLibraryFile
.Parameters: s – Library
to set.Return type: self
-
set_version
(v)[source]¶ Set the value of
version
for thisLibraryFile
. This corresponds to theversion
attribute of a<eagle>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
with_version
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofversion
. For use in combination withFrom
objects.Return
self
if one of the following is true:version
equalsv
v
is callable andv(self.get_version()
isTrue
This is useful in combination with
From
object.Parameters: t – The value to check for or a callable object. Returns: self
if the criteria above are met andNone
otherwise.Return type: EagelFilePart
orNone
Library¶
-
class
Swoop.
Library
[source]¶ Bases:
Swoop.Swoop.EagleFilePart
Class representing the contents of a <library> tag in Eagle files.
Attributes:
name
Collections:
description
: SingletonDescription
object.package
: Map ofPackage
objects indexed by theirname
.symbol
: Map ofSymbol
objects indexed by theirname
.deviceset
: Map ofDeviceset
objects indexed by theirname
.
-
add_deviceset
(s)[source]¶ Add a
Deviceset
to thedevicesets
of thisLibrary
.Parameters: s – The Deviceset
to add.Return type: self
-
add_package
(s)[source]¶ Add a
Package
to thepackages
of thisLibrary
.Parameters: s – The Package
to add.Return type: self
-
add_symbol
(s)[source]¶ Add a
Symbol
to thesymbols
of thisLibrary
.Parameters: s – The Symbol
to add.Return type: self
-
clear_devicesets
()[source]¶ Remove all the
Deviceset
objects from thedevicesets
of thisLibrary
.Return type: self
-
clear_packages
()[source]¶ Remove all the
Package
objects from thepackages
of thisLibrary
.Return type: self
-
clear_symbols
()[source]¶ Remove all the
Symbol
objects from thesymbols
of 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
indent
on recursive invocations.
Return type: None
-
get_children
()[source]¶ Get all the children of this
EagleFilePart
.Return type: List of EagleFilePart
objects
-
get_description
()[source]¶ Get the description from this
Library
.Return type: Description
object
-
get_deviceset
(key)[source]¶ Lookup and return a
Deviceset
from thedevicesets
of thisLibrary
.Parameters: key – A str
to use for the lookup. The lookup uses thename
of theDeviceset
objects.Return type: A Deviceset
object orNone
, if there is no such item.
-
get_devicesets
(attrs=None, type=None)[source]¶ Return (and possibly filter) items in the the
devicesets
map ofDeviceset
objects for thisLibrary
.This functions provides a mechanism for filtering the items as well. The keys in
attrs
are 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
type
is 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
Deviceset
objectsReturn type: List of
Deviceset
objects
-
get_name
()[source]¶ Return the value of
name
for thisLibrary
. This corresponds to thename
attribute of a<library>
in an Eagle file.Return type: str
-
get_nth_deviceset
(n)[source]¶ get then nth
Deviceset
object from thedevicesets
of thisLibrary
.Parameters: n – Index of the item to return. Return type: Deviceset
object
-
get_nth_package
(n)[source]¶ get then nth
Package
object from thepackages
of thisLibrary
.Parameters: n – Index of the item to return. Return type: Package
object
-
get_nth_symbol
(n)[source]¶ get then nth
Symbol
object from thesymbols
of thisLibrary
.Parameters: n – Index of the item to return. Return type: Symbol
object
-
get_package
(key)[source]¶ Lookup and return a
Package
from thepackages
of thisLibrary
.Parameters: key – A str
to use for the lookup. The lookup uses thename
of thePackage
objects.Return type: A Package
object orNone
, if there is no such item.
-
get_packages
(attrs=None, type=None)[source]¶ Return (and possibly filter) items in the the
packages
map ofPackage
objects for thisLibrary
.This functions provides a mechanism for filtering the items as well. The keys in
attrs
are 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
type
is 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
Package
objectsReturn type: List of
Package
objects
-
get_symbol
(key)[source]¶ Lookup and return a
Symbol
from thesymbols
of thisLibrary
.Parameters: key – A str
to use for the lookup. The lookup uses thename
of theSymbol
objects.Return type: A Symbol
object orNone
, if there is no such item.
-
get_symbols
(attrs=None, type=None)[source]¶ Return (and possibly filter) items in the the
symbols
map ofSymbol
objects for thisLibrary
.This functions provides a mechanism for filtering the items as well. The keys in
attrs
are 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
type
is 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
Symbol
objectsReturn type: List of
Symbol
objects
-
remove_child
(efp)[source]¶ Remove a child
EagleFilePart
object.Parameters: efp – the class:EagleFilePart object to remove. Returns: Nothing
-
remove_deviceset
(efp)[source]¶ Remove a
Deviceset
from thedevicesets
of thisLibrary
.Parameters: efp – The Deviceset
object to remove.Return type: self
-
remove_package
(efp)[source]¶ Remove a
Package
from thepackages
of thisLibrary
.Parameters: efp – The Package
object to remove.Return type: self
-
remove_symbol
(efp)[source]¶ Remove a
Symbol
from thesymbols
of thisLibrary
.Parameters: efp – The Symbol
object to remove.Return type: self
-
set_description
(s)[source]¶ Set the
Description
for thisLibrary
.Parameters: s – Description
to set.Return type: self
-
set_name
(v)[source]¶ Set the value of
name
for thisLibrary
. This corresponds to thename
attribute of a<library>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
with_name
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofname
. For use in combination withFrom
objects.Return
self
if one of the following is true:name
equalsv
v
is callable andv(self.get_name()
isTrue
This is useful in combination with
From
object.Parameters: t – The value to check for or a callable object. Returns: self
if the criteria above are met andNone
otherwise.Return type: EagelFilePart
orNone
Package¶
-
class
Swoop.
Package
[source]¶ Bases:
Swoop.Swoop.EagleFilePart
Class representing the contents of a <package> tag in Eagle files.
Attributes:
name
Collections:
description
: SingletonDescription
object.drawing_element
: List ofPolygon
,Wire
,Text
,Dimension
,Circle
,Rectangle
,Hole
andFrame
objects.pad
: Map ofPad
objects indexed by theirname
.smd
: Map ofSmd
objects indexed by theirname
.
-
add_drawing_element
(s)[source]¶ Add a
Polygon
,Wire
,Text
,Dimension
,Circle
,Rectangle
,Hole
orFrame
to thedrawing_elements
of thisPackage
.Parameters: s – The Polygon
,Wire
,Text
,Dimension
,Circle
,Rectangle
,Hole
orFrame
to add.Return type: self
-
add_pad
(s)[source]¶ Add a
Pad
to thepads
of thisPackage
.Parameters: s – The Pad
to add.Return type: self
-
add_smd
(s)[source]¶ Add a
Smd
to thesmds
of thisPackage
.Parameters: s – The Smd
to add.Return type: self
-
clear_drawing_elements
()[source]¶ Remove all the
Polygon
,Wire
,Text
,Dimension
,Circle
,Rectangle
,Hole
andFrame
objects from thedrawing_elements
of 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
indent
on recursive invocations.
Return type: None
-
get_children
()[source]¶ Get all the children of this
EagleFilePart
.Return type: List of EagleFilePart
objects
-
get_description
()[source]¶ Get the description from this
Package
.Return type: Description
object
-
get_drawing_elements
(attrs=None, type=None)[source]¶ Return (and possibly filter) items in the the
drawing_elements
list ofPolygon
,Wire
,Text
,Dimension
,Circle
,Rectangle
,Hole
orFrame
objects for thisPackage
.This functions provides a mechanism for filtering the items as well. The keys in
attrs
are 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
type
is 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
,Hole
andFrame
objectsReturn type: List of
Polygon
,Wire
,Text
,Dimension
,Circle
,Rectangle
,Hole
andFrame
objects
-
get_name
()[source]¶ Return the value of
name
for thisPackage
. This corresponds to thename
attribute 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
,Hole
orFrame
object from thedrawing_elements
of thisPackage
.Parameters: n – Index of the item to return. Return type: Polygon
,Wire
,Text
,Dimension
,Circle
,Rectangle
,Hole
orFrame
object
-
get_nth_pad
(n)[source]¶ get then nth
Pad
object from thepads
of thisPackage
.Parameters: n – Index of the item to return. Return type: Pad
object
-
get_nth_smd
(n)[source]¶ get then nth
Smd
object from thesmds
of thisPackage
.Parameters: n – Index of the item to return. Return type: Smd
object
-
get_pad
(key)[source]¶ Lookup and return a
Pad
from thepads
of thisPackage
.Parameters: key – A str
to use for the lookup. The lookup uses thename
of thePad
objects.Return type: A Pad
object orNone
, if there is no such item.
-
get_pads
(attrs=None, type=None)[source]¶ Return (and possibly filter) items in the the
pads
map ofPad
objects for thisPackage
.This functions provides a mechanism for filtering the items as well. The keys in
attrs
are 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
type
is 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
Pad
objectsReturn type: List of
Pad
objects
-
get_smd
(key)[source]¶ Lookup and return a
Smd
from thesmds
of thisPackage
.Parameters: key – A str
to use for the lookup. The lookup uses thename
of theSmd
objects.Return type: A Smd
object orNone
, if there is no such item.
-
get_smds
(attrs=None, type=None)[source]¶ Return (and possibly filter) items in the the
smds
map ofSmd
objects for thisPackage
.This functions provides a mechanism for filtering the items as well. The keys in
attrs
are 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
type
is 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
Smd
objectsReturn type: List of
Smd
objects
-
remove_child
(efp)[source]¶ Remove a child
EagleFilePart
object.Parameters: efp – the class:EagleFilePart object to remove. Returns: Nothing
-
remove_drawing_element
(efp)[source]¶ Remove a
Polygon
,Wire
,Text
,Dimension
,Circle
,Rectangle
,Hole
orFrame
from thedrawing_elements
of thisPackage
.Parameters: efp – The Polygon
,Wire
,Text
,Dimension
,Circle
,Rectangle
,Hole
orFrame
object to remove.Return type: self
-
remove_pad
(efp)[source]¶ Remove a
Pad
from thepads
of thisPackage
.Parameters: efp – The Pad
object to remove.Return type: self
-
remove_smd
(efp)[source]¶ Remove a
Smd
from thesmds
of thisPackage
.Parameters: efp – The Smd
object to remove.Return type: self
-
set_description
(s)[source]¶ Set the
Description
for thisPackage
.Parameters: s – Description
to set.Return type: self
-
set_name
(v)[source]¶ Set the value of
name
for thisPackage
. This corresponds to thename
attribute of a<package>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
with_name
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofname
. For use in combination withFrom
objects.Return
self
if one of the following is true:name
equalsv
v
is callable andv(self.get_name()
isTrue
This is useful in combination with
From
object.Parameters: t – The value to check for or a callable object. Returns: self
if the criteria above are met andNone
otherwise.Return type: EagelFilePart
orNone
Symbol¶
-
class
Swoop.
Symbol
[source]¶ Bases:
Swoop.Swoop.EagleFilePart
Class representing the contents of a <symbol> tag in Eagle files.
Attributes:
name
Collections:
description
: SingletonDescription
object.drawing_element
: List ofPolygon
,Wire
,Text
,Dimension
,Circle
,Rectangle
andHole
objects.pin
: Map ofPin
objects indexed by theirname
.
-
add_drawing_element
(s)[source]¶ Add a
Polygon
,Wire
,Text
,Dimension
,Circle
,Rectangle
orHole
to thedrawing_elements
of thisSymbol
.Parameters: s – The Polygon
,Wire
,Text
,Dimension
,Circle
,Rectangle
orHole
to add.Return type: self
-
add_pin
(s)[source]¶ Add a
Pin
to thepins
of thisSymbol
.Parameters: s – The Pin
to add.Return type: self
-
clear_drawing_elements
()[source]¶ Remove all the
Polygon
,Wire
,Text
,Dimension
,Circle
,Rectangle
andHole
objects from thedrawing_elements
of 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
indent
on recursive invocations.
Return type: None
-
get_children
()[source]¶ Get all the children of this
EagleFilePart
.Return type: List of EagleFilePart
objects
-
get_description
()[source]¶ Get the description from this
Symbol
.Return type: Description
object
-
get_drawing_elements
(attrs=None, type=None)[source]¶ Return (and possibly filter) items in the the
drawing_elements
list ofPolygon
,Wire
,Text
,Dimension
,Circle
,Rectangle
orHole
objects for thisSymbol
.This functions provides a mechanism for filtering the items as well. The keys in
attrs
are 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
type
is 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
andHole
objectsReturn type: List of
Polygon
,Wire
,Text
,Dimension
,Circle
,Rectangle
andHole
objects
-
get_name
()[source]¶ Return the value of
name
for thisSymbol
. This corresponds to thename
attribute of a<symbol>
in an Eagle file.Return type: str
-
get_nth_drawing_element
(n)[source]¶ get then nth
Polygon
,Wire
,Text
,Dimension
,Circle
,Rectangle
orHole
object from thedrawing_elements
of thisSymbol
.Parameters: n – Index of the item to return. Return type: Polygon
,Wire
,Text
,Dimension
,Circle
,Rectangle
orHole
object
-
get_nth_pin
(n)[source]¶ get then nth
Pin
object from thepins
of thisSymbol
.Parameters: n – Index of the item to return. Return type: Pin
object
-
get_pin
(key)[source]¶ Lookup and return a
Pin
from thepins
of thisSymbol
.Parameters: key – A str
to use for the lookup. The lookup uses thename
of thePin
objects.Return type: A Pin
object orNone
, if there is no such item.
-
get_pins
(attrs=None, type=None)[source]¶ Return (and possibly filter) items in the the
pins
map ofPin
objects for thisSymbol
.This functions provides a mechanism for filtering the items as well. The keys in
attrs
are 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
type
is 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
Pin
objectsReturn type: List of
Pin
objects
-
remove_child
(efp)[source]¶ Remove a child
EagleFilePart
object.Parameters: efp – the class:EagleFilePart object to remove. Returns: Nothing
-
remove_drawing_element
(efp)[source]¶ Remove a
Polygon
,Wire
,Text
,Dimension
,Circle
,Rectangle
orHole
from thedrawing_elements
of thisSymbol
.Parameters: efp – The Polygon
,Wire
,Text
,Dimension
,Circle
,Rectangle
orHole
object to remove.Return type: self
-
remove_pin
(efp)[source]¶ Remove a
Pin
from thepins
of thisSymbol
.Parameters: efp – The Pin
object to remove.Return type: self
-
set_description
(s)[source]¶ Set the
Description
for thisSymbol
.Parameters: s – Description
to set.Return type: self
-
set_name
(v)[source]¶ Set the value of
name
for thisSymbol
. This corresponds to thename
attribute of a<symbol>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
with_name
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofname
. For use in combination withFrom
objects.Return
self
if one of the following is true:name
equalsv
v
is callable andv(self.get_name()
isTrue
This is useful in combination with
From
object.Parameters: t – The value to check for or a callable object. Returns: self
if the criteria above are met andNone
otherwise.Return type: EagelFilePart
orNone
Deviceset¶
-
class
Swoop.
Deviceset
[source]¶ Bases:
Swoop.Swoop.EagleFilePart
Class representing the contents of a <deviceset> tag in Eagle files.
Attributes:
name
prefix
uservalue
Collections:
description
: SingletonDescription
object.gate
: Map ofGate
objects indexed by theirname
.device
: Map ofDevice
objects indexed by theirname
.
-
add_device
(s)[source]¶ Add a
Device
to thedevices
of thisDeviceset
.Parameters: s – The Device
to add.Return type: self
-
add_gate
(s)[source]¶ Add a
Gate
to thegates
of thisDeviceset
.Parameters: s – The Gate
to add.Return type: self
-
clear_devices
()[source]¶ Remove all the
Device
objects from thedevices
of thisDeviceset
.Return type: self
-
clear_gates
()[source]¶ Remove all the
Gate
objects from thegates
of 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
Deviceset
into 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
indent
on recursive invocations.
Return type: None
-
get_children
()[source]¶ Get all the children of this
EagleFilePart
.Return type: List of EagleFilePart
objects
-
get_description
()[source]¶ Get the description from this
Deviceset
.Return type: Description
object
-
get_device
(key)[source]¶ Lookup and return a
Device
from thedevices
of thisDeviceset
.Parameters: key – A str
to use for the lookup. The lookup uses thename
of theDevice
objects.Return type: A Device
object orNone
, if there is no such item.
-
get_devices
(attrs=None, type=None)[source]¶ Return (and possibly filter) items in the the
devices
map ofDevice
objects for thisDeviceset
.This functions provides a mechanism for filtering the items as well. The keys in
attrs
are 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
type
is 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
Device
objectsReturn type: List of
Device
objects
-
get_gate
(key)[source]¶ Lookup and return a
Gate
from thegates
of thisDeviceset
.Parameters: key – A str
to use for the lookup. The lookup uses thename
of theGate
objects.Return type: A Gate
object orNone
, if there is no such item.
-
get_gates
(attrs=None, type=None)[source]¶ Return (and possibly filter) items in the the
gates
map ofGate
objects for thisDeviceset
.This functions provides a mechanism for filtering the items as well. The keys in
attrs
are 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
type
is 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
Gate
objectsReturn type: List of
Gate
objects
-
get_name
()[source]¶ Return the value of
name
for thisDeviceset
. This corresponds to thename
attribute of a<deviceset>
in an Eagle file.Return type: str
-
get_nth_device
(n)[source]¶ get then nth
Device
object from thedevices
of thisDeviceset
.Parameters: n – Index of the item to return. Return type: Device
object
-
get_nth_gate
(n)[source]¶ get then nth
Gate
object from thegates
of thisDeviceset
.Parameters: n – Index of the item to return. Return type: Gate
object
-
get_prefix
()[source]¶ Return the value of
prefix
for thisDeviceset
. This corresponds to theprefix
attribute of a<deviceset>
in an Eagle file.Return type: str
-
get_uservalue
()[source]¶ Return the value of
uservalue
for thisDeviceset
. This corresponds to theuservalue
attribute of a<deviceset>
in an Eagle file.Return type: bool
-
remove_child
(efp)[source]¶ Remove a child
EagleFilePart
object.Parameters: efp – the class:EagleFilePart object to remove. Returns: Nothing
-
remove_device
(efp)[source]¶ Remove a
Device
from thedevices
of thisDeviceset
.Parameters: efp – The Device
object to remove.Return type: self
-
remove_gate
(efp)[source]¶ Remove a
Gate
from thegates
of thisDeviceset
.Parameters: efp – The Gate
object to remove.Return type: self
-
set_description
(s)[source]¶ Set the
Description
for thisDeviceset
.Parameters: s – Description
to set.Return type: self
-
set_name
(v)[source]¶ Set the value of
name
for thisDeviceset
. This corresponds to thename
attribute of a<deviceset>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_prefix
(v)[source]¶ Set the value of
prefix
for thisDeviceset
. This corresponds to theprefix
attribute of a<deviceset>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_uservalue
(v)[source]¶ Set the value of
uservalue
for thisDeviceset
. This corresponds to theuservalue
attribute of a<deviceset>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
with_name
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofname
. For use in combination withFrom
objects.Return
self
if one of the following is true:name
equalsv
v
is callable andv(self.get_name()
isTrue
This is useful in combination with
From
object.Parameters: t – The value to check for or a callable object. Returns: self
if the criteria above are met andNone
otherwise.Return type: EagelFilePart
orNone
-
with_prefix
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofprefix
. For use in combination withFrom
objects.Return
self
if one of the following is true:prefix
equalsv
v
is callable andv(self.get_prefix()
isTrue
This is useful in combination with
From
object.Parameters: t – The value to check for or a callable object. Returns: self
if the criteria above are met andNone
otherwise.Return type: EagelFilePart
orNone
-
with_uservalue
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofuservalue
. For use in combination withFrom
objects.Return
self
if one of the following is true:uservalue
equalsv
v
is callable andv(self.get_uservalue()
isTrue
This is useful in combination with
From
object.Parameters: t – The value to check for or a callable object. Returns: self
if the criteria above are met andNone
otherwise.Return type: EagelFilePart
orNone
Device¶
-
class
Swoop.
Device
[source]¶ Bases:
Swoop.Swoop.EagleFilePart
Class representing the contents of a <device> tag in Eagle files.
Attributes:
name
package
Collections:
connect
: List ofConnect
objects.technology
: Map ofTechnology
objects indexed by theirname
.
-
add_connect
(s)[source]¶ Add a
Connect
to theconnects
of thisDevice
.Parameters: s – The Connect
to add.Return type: self
-
add_technology
(s)[source]¶ Add a
Technology
to thetechnologies
of thisDevice
.Parameters: s – The Technology
to add.Return type: self
-
clear_connects
()[source]¶ Remove all the
Connect
objects from theconnects
of thisDevice
.Return type: self
-
clear_technologies
()[source]¶ Remove all the
Technology
objects from thetechnologies
of 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
indent
on recursive invocations.
Return type: None
-
find_package
()[source]¶ Find the
Package
object refered to by thepackage
attribute of this object. This is likeget_package()
, except it returns thePackage
object instead of its name.Returns: The object Return type: Package
-
get_children
()[source]¶ Get all the children of this
EagleFilePart
.Return type: List of EagleFilePart
objects
-
get_connects
(attrs=None, type=None)[source]¶ Return (and possibly filter) items in the the
connects
list ofConnect
objects for thisDevice
.This functions provides a mechanism for filtering the items as well. The keys in
attrs
are 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
type
is 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
Connect
objectsReturn type: List of
Connect
objects
-
get_name
()[source]¶ Return the value of
name
for thisDevice
. This corresponds to thename
attribute of a<device>
in an Eagle file.Return type: str
-
get_nth_connect
(n)[source]¶ get then nth
Connect
object from theconnects
of thisDevice
.Parameters: n – Index of the item to return. Return type: Connect
object
-
get_nth_technology
(n)[source]¶ get then nth
Technology
object from thetechnologies
of thisDevice
.Parameters: n – Index of the item to return. Return type: Technology
object
-
get_package
()[source]¶ Return the value of
package
for thisDevice
. This corresponds to thepackage
attribute 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
technologies
map ofTechnology
objects for thisDevice
.This functions provides a mechanism for filtering the items as well. The keys in
attrs
are 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
type
is 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
Technology
objectsReturn type: List of
Technology
objects
-
get_technology
(key)[source]¶ Lookup and return a
Technology
from thetechnologies
of thisDevice
.Parameters: key – A str
to use for the lookup. The lookup uses thename
of theTechnology
objects.Return type: A Technology
object orNone
, if there is no such item.
-
remove_child
(efp)[source]¶ Remove a child
EagleFilePart
object.Parameters: efp – the class:EagleFilePart object to remove. Returns: Nothing
-
remove_connect
(efp)[source]¶ Remove a
Connect
from theconnects
of thisDevice
.Parameters: efp – The Connect
object to remove.Return type: self
-
remove_technology
(efp)[source]¶ Remove a
Technology
from thetechnologies
of thisDevice
.Parameters: efp – The Technology
object to remove.Return type: self
-
set_name
(v)[source]¶ Set the value of
name
for thisDevice
. This corresponds to thename
attribute of a<device>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_package
(v)[source]¶ Set the value of
package
for thisDevice
. This corresponds to thepackage
attribute of a<device>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
with_name
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofname
. For use in combination withFrom
objects.Return
self
if one of the following is true:name
equalsv
v
is callable andv(self.get_name()
isTrue
This is useful in combination with
From
object.Parameters: t – The value to check for or a callable object. Returns: self
if the criteria above are met andNone
otherwise.Return type: EagelFilePart
orNone
-
with_package
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofpackage
. For use in combination withFrom
objects.Return
self
if one of the following is true:package
equalsv
v
is callable andv(self.get_package()
isTrue
This is useful in combination with
From
object.Parameters: t – The value to check for or a callable object. Returns: self
if the criteria above are met andNone
otherwise.Return type: EagelFilePart
orNone
Connect¶
-
class
Swoop.
Connect
[source]¶ Bases:
Swoop.Swoop.EagleFilePart
Class representing the contents of a <connect> tag in Eagle files.
Attributes:
gate
pin
pad
route
-
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
indent
on recursive invocations.
Return type: None
-
find_gate
()[source]¶ Find the
Gate
object refered to by thegate
attribute of this object. This is likeget_gate()
, except it returns theGate
object instead of its name.Returns: The object Return type: Gate
-
find_pad
()[source]¶ Find the
Pad
object refered to by thepad
attribute of this object. This is likeget_pad()
, except it returns thePad
object instead of its name.Returns: The object Return type: Pad
-
find_pin
()[source]¶ Find the
Pin
object refered to by thepin
attribute of this object. This is likeget_pin()
, except it returns thePin
object instead of its name.Returns: The object Return type: Pin
-
get_children
()[source]¶ Get all the children of this
EagleFilePart
.Return type: List of EagleFilePart
objects
-
get_gate
()[source]¶ Return the value of
gate
for thisConnect
. This corresponds to thegate
attribute of a<connect>
in an Eagle file.Return type: str
-
get_pad
()[source]¶ Return the value of
pad
for thisConnect
. This corresponds to thepad
attribute of a<connect>
in an Eagle file.Return type: str
-
get_pin
()[source]¶ Return the value of
pin
for thisConnect
. This corresponds to thepin
attribute of a<connect>
in an Eagle file.Return type: str
-
get_route
()[source]¶ Return the value of
route
for thisConnect
. This corresponds to theroute
attribute of a<connect>
in an Eagle file.Return type: str
-
remove_child
(efp)[source]¶ Remove a child
EagleFilePart
object.Parameters: efp – the class:EagleFilePart object to remove. Returns: Nothing
-
set_gate
(v)[source]¶ Set the value of
gate
for thisConnect
. This corresponds to thegate
attribute of a<connect>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_pad
(v)[source]¶ Set the value of
pad
for thisConnect
. This corresponds to thepad
attribute of a<connect>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_pin
(v)[source]¶ Set the value of
pin
for thisConnect
. This corresponds to thepin
attribute of a<connect>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_route
(v)[source]¶ Set the value of
route
for thisConnect
. This corresponds to theroute
attribute of a<connect>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
with_gate
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofgate
. For use in combination withFrom
objects.Return
self
if one of the following is true:gate
equalsv
v
is callable andv(self.get_gate()
isTrue
This is useful in combination with
From
object.Parameters: t – The value to check for or a callable object. Returns: self
if the criteria above are met andNone
otherwise.Return type: EagelFilePart
orNone
-
with_pad
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofpad
. For use in combination withFrom
objects.Return
self
if one of the following is true:pad
equalsv
v
is callable andv(self.get_pad()
isTrue
This is useful in combination with
From
object.Parameters: t – The value to check for or a callable object. Returns: self
if the criteria above are met andNone
otherwise.Return type: EagelFilePart
orNone
-
with_pin
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofpin
. For use in combination withFrom
objects.Return
self
if one of the following is true:pin
equalsv
v
is callable andv(self.get_pin()
isTrue
This is useful in combination with
From
object.Parameters: t – The value to check for or a callable object. Returns: self
if the criteria above are met andNone
otherwise.Return type: EagelFilePart
orNone
-
with_route
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofroute
. For use in combination withFrom
objects.Return
self
if one of the following is true:route
equalsv
v
is callable andv(self.get_route()
isTrue
This is useful in combination with
From
object.Parameters: t – The value to check for or a callable object. Returns: self
if the criteria above are met andNone
otherwise.Return type: EagelFilePart
orNone
Gate¶
-
class
Swoop.
Gate
[source]¶ Bases:
Swoop.Swoop.EagleFilePart
Class representing the contents of a <gate> tag in Eagle files.
Attributes:
name
symbol
x
y
addlevel
swaplevel
-
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
indent
on recursive invocations.
Return type: None
-
find_symbol
()[source]¶ Find the
Symbol
object refered to by thesymbol
attribute of this object. This is likeget_symbol()
, except it returns theSymbol
object instead of its name.Returns: The object Return type: Symbol
-
get_addlevel
()[source]¶ Return the value of
addlevel
for thisGate
. This corresponds to theaddlevel
attribute of a<gate>
in an Eagle file.Return type: str
-
get_children
()[source]¶ Get all the children of this
EagleFilePart
.Return type: List of EagleFilePart
objects
-
get_name
()[source]¶ Return the value of
name
for thisGate
. This corresponds to thename
attribute of a<gate>
in an Eagle file.Return type: str
-
get_swaplevel
()[source]¶ Return the value of
swaplevel
for thisGate
. This corresponds to theswaplevel
attribute of a<gate>
in an Eagle file.Return type: int
-
get_symbol
()[source]¶ Return the value of
symbol
for thisGate
. This corresponds to thesymbol
attribute of a<gate>
in an Eagle file.Return type: str
-
get_x
()[source]¶ Return the value of
x
for thisGate
. This corresponds to thex
attribute of a<gate>
in an Eagle file.Return type: float
-
get_y
()[source]¶ Return the value of
y
for thisGate
. This corresponds to they
attribute of a<gate>
in an Eagle file.Return type: float
-
remove_child
(efp)[source]¶ Remove a child
EagleFilePart
object.Parameters: efp – the class:EagleFilePart object to remove. Returns: Nothing
-
set_addlevel
(v)[source]¶ Set the value of
addlevel
for thisGate
. This corresponds to theaddlevel
attribute of a<gate>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_name
(v)[source]¶ Set the value of
name
for thisGate
. This corresponds to thename
attribute of a<gate>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_swaplevel
(v)[source]¶ Set the value of
swaplevel
for thisGate
. This corresponds to theswaplevel
attribute of a<gate>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_symbol
(v)[source]¶ Set the value of
symbol
for thisGate
. This corresponds to thesymbol
attribute of a<gate>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_x
(v)[source]¶ Set the value of
x
for thisGate
. This corresponds to thex
attribute of a<gate>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_y
(v)[source]¶ Set the value of
y
for thisGate
. This corresponds to they
attribute of a<gate>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
with_addlevel
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofaddlevel
. For use in combination withFrom
objects.Return
self
if one of the following is true:addlevel
equalsv
v
is callable andv(self.get_addlevel()
isTrue
This is useful in combination with
From
object.Parameters: t – The value to check for or a callable object. Returns: self
if the criteria above are met andNone
otherwise.Return type: EagelFilePart
orNone
-
with_name
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofname
. For use in combination withFrom
objects.Return
self
if one of the following is true:name
equalsv
v
is callable andv(self.get_name()
isTrue
This is useful in combination with
From
object.Parameters: t – The value to check for or a callable object. Returns: self
if the criteria above are met andNone
otherwise.Return type: EagelFilePart
orNone
-
with_swaplevel
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofswaplevel
. For use in combination withFrom
objects.Return
self
if one of the following is true:swaplevel
equalsv
v
is callable andv(self.get_swaplevel()
isTrue
This is useful in combination with
From
object.Parameters: t – The value to check for or a callable object. Returns: self
if the criteria above are met andNone
otherwise.Return type: EagelFilePart
orNone
-
with_symbol
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofsymbol
. For use in combination withFrom
objects.Return
self
if one of the following is true:symbol
equalsv
v
is callable andv(self.get_symbol()
isTrue
This is useful in combination with
From
object.Parameters: t – The value to check for or a callable object. Returns: self
if the criteria above are met andNone
otherwise.Return type: EagelFilePart
orNone
-
with_x
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofx
. For use in combination withFrom
objects.Return
self
if one of the following is true:x
equalsv
v
is callable andv(self.get_x()
isTrue
This is useful in combination with
From
object.Parameters: t – The value to check for or a callable object. Returns: self
if the criteria above are met andNone
otherwise.Return type: EagelFilePart
orNone
-
with_y
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofy
. For use in combination withFrom
objects.Return
self
if one of the following is true:y
equalsv
v
is callable andv(self.get_y()
isTrue
This is useful in combination with
From
object.Parameters: t – The value to check for or a callable object. Returns: self
if the criteria above are met andNone
otherwise.Return type: EagelFilePart
orNone
Pad¶
-
class
Swoop.
Pad
[source]¶ Bases:
Swoop.Swoop.EagleFilePart
Class representing the contents of a <pad> tag in Eagle files.
Attributes:
name
x
y
drill
diameter
shape
rot
stop
thermals
first
-
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
indent
on recursive invocations.
Return type: None
-
get_children
()[source]¶ Get all the children of this
EagleFilePart
.Return type: List of EagleFilePart
objects
-
get_diameter
()[source]¶ Return the value of
diameter
for thisPad
. This corresponds to thediameter
attribute of a<pad>
in an Eagle file.Return type: float
-
get_drill
()[source]¶ Return the value of
drill
for thisPad
. This corresponds to thedrill
attribute of a<pad>
in an Eagle file.Return type: float
-
get_first
()[source]¶ Return the value of
first
for thisPad
. This corresponds to thefirst
attribute of a<pad>
in an Eagle file.Return type: bool
-
get_name
()[source]¶ Return the value of
name
for thisPad
. This corresponds to thename
attribute of a<pad>
in an Eagle file.Return type: str
-
get_rot
()[source]¶ Return the value of
rot
for thisPad
. This corresponds to therot
attribute of a<pad>
in an Eagle file.Return type: str
-
get_shape
()[source]¶ Return the value of
shape
for thisPad
. This corresponds to theshape
attribute of a<pad>
in an Eagle file.Return type: str
-
get_stop
()[source]¶ Return the value of
stop
for thisPad
. This corresponds to thestop
attribute of a<pad>
in an Eagle file.Return type: bool
-
get_thermals
()[source]¶ Return the value of
thermals
for thisPad
. This corresponds to thethermals
attribute of a<pad>
in an Eagle file.Return type: bool
-
get_x
()[source]¶ Return the value of
x
for thisPad
. This corresponds to thex
attribute of a<pad>
in an Eagle file.Return type: float
-
get_y
()[source]¶ Return the value of
y
for thisPad
. This corresponds to they
attribute of a<pad>
in an Eagle file.Return type: float
-
remove_child
(efp)[source]¶ Remove a child
EagleFilePart
object.Parameters: efp – the class:EagleFilePart object to remove. Returns: Nothing
-
set_diameter
(v)[source]¶ Set the value of
diameter
for thisPad
. This corresponds to thediameter
attribute of a<pad>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_drill
(v)[source]¶ Set the value of
drill
for thisPad
. This corresponds to thedrill
attribute of a<pad>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_first
(v)[source]¶ Set the value of
first
for thisPad
. This corresponds to thefirst
attribute of a<pad>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_name
(v)[source]¶ Set the value of
name
for thisPad
. This corresponds to thename
attribute of a<pad>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_rot
(v)[source]¶ Set the value of
rot
for thisPad
. This corresponds to therot
attribute of a<pad>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_shape
(v)[source]¶ Set the value of
shape
for thisPad
. This corresponds to theshape
attribute of a<pad>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_stop
(v)[source]¶ Set the value of
stop
for thisPad
. This corresponds to thestop
attribute of a<pad>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_thermals
(v)[source]¶ Set the value of
thermals
for thisPad
. This corresponds to thethermals
attribute of a<pad>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_x
(v)[source]¶ Set the value of
x
for thisPad
. This corresponds to thex
attribute of a<pad>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_y
(v)[source]¶ Set the value of
y
for thisPad
. This corresponds to they
attribute of a<pad>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
with_diameter
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofdiameter
. For use in combination withFrom
objects.Return
self
if one of the following is true:diameter
equalsv
v
is callable andv(self.get_diameter()
isTrue
This is useful in combination with
From
object.Parameters: t – The value to check for or a callable object. Returns: self
if the criteria above are met andNone
otherwise.Return type: EagelFilePart
orNone
-
with_drill
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofdrill
. For use in combination withFrom
objects.Return
self
if one of the following is true:drill
equalsv
v
is callable andv(self.get_drill()
isTrue
This is useful in combination with
From
object.Parameters: t – The value to check for or a callable object. Returns: self
if the criteria above are met andNone
otherwise.Return type: EagelFilePart
orNone
-
with_first
(v)[source]¶ Filter this
EagleFilePart
object based on the value offirst
. For use in combination withFrom
objects.Return
self
if one of the following is true:first
equalsv
v
is callable andv(self.get_first()
isTrue
This is useful in combination with
From
object.Parameters: t – The value to check for or a callable object. Returns: self
if the criteria above are met andNone
otherwise.Return type: EagelFilePart
orNone
-
with_name
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofname
. For use in combination withFrom
objects.Return
self
if one of the following is true:name
equalsv
v
is callable andv(self.get_name()
isTrue
This is useful in combination with
From
object.Parameters: t – The value to check for or a callable object. Returns: self
if the criteria above are met andNone
otherwise.Return type: EagelFilePart
orNone
-
with_rot
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofrot
. For use in combination withFrom
objects.Return
self
if one of the following is true:rot
equalsv
v
is callable andv(self.get_rot()
isTrue
This is useful in combination with
From
object.Parameters: t – The value to check for or a callable object. Returns: self
if the criteria above are met andNone
otherwise.Return type: EagelFilePart
orNone
-
with_shape
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofshape
. For use in combination withFrom
objects.Return
self
if one of the following is true:shape
equalsv
v
is callable andv(self.get_shape()
isTrue
This is useful in combination with
From
object.Parameters: t – The value to check for or a callable object. Returns: self
if the criteria above are met andNone
otherwise.Return type: EagelFilePart
orNone
-
with_stop
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofstop
. For use in combination withFrom
objects.Return
self
if one of the following is true:stop
equalsv
v
is callable andv(self.get_stop()
isTrue
This is useful in combination with
From
object.Parameters: t – The value to check for or a callable object. Returns: self
if the criteria above are met andNone
otherwise.Return type: EagelFilePart
orNone
-
with_thermals
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofthermals
. For use in combination withFrom
objects.Return
self
if one of the following is true:thermals
equalsv
v
is callable andv(self.get_thermals()
isTrue
This is useful in combination with
From
object.Parameters: t – The value to check for or a callable object. Returns: self
if the criteria above are met andNone
otherwise.Return type: EagelFilePart
orNone
-
with_x
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofx
. For use in combination withFrom
objects.Return
self
if one of the following is true:x
equalsv
v
is callable andv(self.get_x()
isTrue
This is useful in combination with
From
object.Parameters: t – The value to check for or a callable object. Returns: self
if the criteria above are met andNone
otherwise.Return type: EagelFilePart
orNone
-
with_y
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofy
. For use in combination withFrom
objects.Return
self
if one of the following is true:y
equalsv
v
is callable andv(self.get_y()
isTrue
This is useful in combination with
From
object.Parameters: t – The value to check for or a callable object. Returns: self
if the criteria above are met andNone
otherwise.Return type: EagelFilePart
orNone
Smd¶
-
class
Swoop.
Smd
[source]¶ Bases:
Swoop.Swoop.EagleFilePart
Class representing the contents of a <smd> tag in Eagle files.
Attributes:
name
x
y
dx
dy
layer
roundness
rot
stop
thermals
cream
-
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
indent
on recursive invocations.
Return type: None
-
get_children
()[source]¶ Get all the children of this
EagleFilePart
.Return type: List of EagleFilePart
objects
-
get_cream
()[source]¶ Return the value of
cream
for thisSmd
. This corresponds to thecream
attribute of a<smd>
in an Eagle file.Return type: bool
-
get_dx
()[source]¶ Return the value of
dx
for thisSmd
. This corresponds to thedx
attribute of a<smd>
in an Eagle file.Return type: float
-
get_dy
()[source]¶ Return the value of
dy
for thisSmd
. This corresponds to thedy
attribute of a<smd>
in an Eagle file.Return type: float
-
get_layer
()[source]¶ Return the value of
layer
for thisSmd
. This corresponds to thelayer
attribute of a<smd>
in an Eagle file.Return type: layer_string
-
get_name
()[source]¶ Return the value of
name
for thisSmd
. This corresponds to thename
attribute of a<smd>
in an Eagle file.Return type: str
-
get_rot
()[source]¶ Return the value of
rot
for thisSmd
. This corresponds to therot
attribute of a<smd>
in an Eagle file.Return type: str
-
get_roundness
()[source]¶ Return the value of
roundness
for thisSmd
. This corresponds to theroundness
attribute of a<smd>
in an Eagle file.Return type: int
-
get_stop
()[source]¶ Return the value of
stop
for thisSmd
. This corresponds to thestop
attribute of a<smd>
in an Eagle file.Return type: bool
-
get_thermals
()[source]¶ Return the value of
thermals
for thisSmd
. This corresponds to thethermals
attribute of a<smd>
in an Eagle file.Return type: bool
-
get_x
()[source]¶ Return the value of
x
for thisSmd
. This corresponds to thex
attribute of a<smd>
in an Eagle file.Return type: float
-
get_y
()[source]¶ Return the value of
y
for thisSmd
. This corresponds to they
attribute of a<smd>
in an Eagle file.Return type: float
-
remove_child
(efp)[source]¶ Remove a child
EagleFilePart
object.Parameters: efp – the class:EagleFilePart object to remove. Returns: Nothing
-
set_cream
(v)[source]¶ Set the value of
cream
for thisSmd
. This corresponds to thecream
attribute of a<smd>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_dx
(v)[source]¶ Set the value of
dx
for thisSmd
. This corresponds to thedx
attribute of a<smd>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_dy
(v)[source]¶ Set the value of
dy
for thisSmd
. This corresponds to thedy
attribute of a<smd>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_layer
(v)[source]¶ Set the value of
layer
for thisSmd
. This corresponds to thelayer
attribute of a<smd>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_name
(v)[source]¶ Set the value of
name
for thisSmd
. This corresponds to thename
attribute of a<smd>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_rot
(v)[source]¶ Set the value of
rot
for thisSmd
. This corresponds to therot
attribute of a<smd>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_roundness
(v)[source]¶ Set the value of
roundness
for thisSmd
. This corresponds to theroundness
attribute of a<smd>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_stop
(v)[source]¶ Set the value of
stop
for thisSmd
. This corresponds to thestop
attribute of a<smd>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_thermals
(v)[source]¶ Set the value of
thermals
for thisSmd
. This corresponds to thethermals
attribute of a<smd>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_x
(v)[source]¶ Set the value of
x
for thisSmd
. This corresponds to thex
attribute of a<smd>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_y
(v)[source]¶ Set the value of
y
for thisSmd
. This corresponds to they
attribute of a<smd>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
with_cream
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofcream
. For use in combination withFrom
objects.Return
self
if one of the following is true:cream
equalsv
v
is callable andv(self.get_cream()
isTrue
This is useful in combination with
From
object.Parameters: t – The value to check for or a callable object. Returns: self
if the criteria above are met andNone
otherwise.Return type: EagelFilePart
orNone
-
with_dx
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofdx
. For use in combination withFrom
objects.Return
self
if one of the following is true:dx
equalsv
v
is callable andv(self.get_dx()
isTrue
This is useful in combination with
From
object.Parameters: t – The value to check for or a callable object. Returns: self
if the criteria above are met andNone
otherwise.Return type: EagelFilePart
orNone
-
with_dy
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofdy
. For use in combination withFrom
objects.Return
self
if one of the following is true:dy
equalsv
v
is callable andv(self.get_dy()
isTrue
This is useful in combination with
From
object.Parameters: t – The value to check for or a callable object. Returns: self
if the criteria above are met andNone
otherwise.Return type: EagelFilePart
orNone
-
with_layer
(v)[source]¶ Filter this
EagleFilePart
object based on the value oflayer
. For use in combination withFrom
objects.Return
self
if one of the following is true:layer
equalsv
v
is callable andv(self.get_layer()
isTrue
This is useful in combination with
From
object.Parameters: t – The value to check for or a callable object. Returns: self
if the criteria above are met andNone
otherwise.Return type: EagelFilePart
orNone
-
with_name
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofname
. For use in combination withFrom
objects.Return
self
if one of the following is true:name
equalsv
v
is callable andv(self.get_name()
isTrue
This is useful in combination with
From
object.Parameters: t – The value to check for or a callable object. Returns: self
if the criteria above are met andNone
otherwise.Return type: EagelFilePart
orNone
-
with_rot
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofrot
. For use in combination withFrom
objects.Return
self
if one of the following is true:rot
equalsv
v
is callable andv(self.get_rot()
isTrue
This is useful in combination with
From
object.Parameters: t – The value to check for or a callable object. Returns: self
if the criteria above are met andNone
otherwise.Return type: EagelFilePart
orNone
-
with_roundness
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofroundness
. For use in combination withFrom
objects.Return
self
if one of the following is true:roundness
equalsv
v
is callable andv(self.get_roundness()
isTrue
This is useful in combination with
From
object.Parameters: t – The value to check for or a callable object. Returns: self
if the criteria above are met andNone
otherwise.Return type: EagelFilePart
orNone
-
with_stop
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofstop
. For use in combination withFrom
objects.Return
self
if one of the following is true:stop
equalsv
v
is callable andv(self.get_stop()
isTrue
This is useful in combination with
From
object.Parameters: t – The value to check for or a callable object. Returns: self
if the criteria above are met andNone
otherwise.Return type: EagelFilePart
orNone
-
with_thermals
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofthermals
. For use in combination withFrom
objects.Return
self
if one of the following is true:thermals
equalsv
v
is callable andv(self.get_thermals()
isTrue
This is useful in combination with
From
object.Parameters: t – The value to check for or a callable object. Returns: self
if the criteria above are met andNone
otherwise.Return type: EagelFilePart
orNone
-
with_x
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofx
. For use in combination withFrom
objects.Return
self
if one of the following is true:x
equalsv
v
is callable andv(self.get_x()
isTrue
This is useful in combination with
From
object.Parameters: t – The value to check for or a callable object. Returns: self
if the criteria above are met andNone
otherwise.Return type: EagelFilePart
orNone
-
with_y
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofy
. For use in combination withFrom
objects.Return
self
if one of the following is true:y
equalsv
v
is callable andv(self.get_y()
isTrue
This is useful in combination with
From
object.Parameters: t – The value to check for or a callable object. Returns: self
if the criteria above are met andNone
otherwise.Return type: EagelFilePart
orNone