Miscellaneous Classes¶
These classes are used across .brd, .sch, and .lbr files. They represent Eagle attributes, drawn elements, documentation, and other information.
Attribute¶
Text¶
-
class
Swoop.
Text
[source]¶ Bases:
Swoop.Swoop.EagleFilePart
Class representing the contents of a <text> tag in Eagle files.
Attributes:
x
y
size
layer
font
ratio
rot
align
distance
-
clone
()[source]¶ Recursively clone this
Text
. It will be identical to the original, but it’s parent will beNone
.Return type: Text
-
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_align
()[source]¶ Return the value of
align
for thisText
. This corresponds to thealign
attribute of a<text>
in an Eagle file.Return type: str
-
get_children
()[source]¶ Get all the children of this
EagleFilePart
.Return type: List of EagleFilePart
objects
-
get_distance
()[source]¶ Return the value of
distance
for thisText
. This corresponds to thedistance
attribute of a<text>
in an Eagle file.Return type: int
-
get_font
()[source]¶ Return the value of
font
for thisText
. This corresponds to thefont
attribute of a<text>
in an Eagle file.Return type: str
-
get_layer
()[source]¶ Return the value of
layer
for thisText
. This corresponds to thelayer
attribute of a<text>
in an Eagle file.Return type: layer_string
-
get_ratio
()[source]¶ Return the value of
ratio
for thisText
. This corresponds to theratio
attribute of a<text>
in an Eagle file.Return type: int
-
get_rot
()[source]¶ Return the value of
rot
for thisText
. This corresponds to therot
attribute of a<text>
in an Eagle file.Return type: str
-
get_size
()[source]¶ Return the value of
size
for thisText
. This corresponds to thesize
attribute of a<text>
in an Eagle file.Return type: float
-
get_x
()[source]¶ Return the value of
x
for thisText
. This corresponds to thex
attribute of a<text>
in an Eagle file.Return type: float
-
get_y
()[source]¶ Return the value of
y
for thisText
. This corresponds to they
attribute of a<text>
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_align
(v)[source]¶ Set the value of
align
for thisText
. This corresponds to thealign
attribute of a<text>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_distance
(v)[source]¶ Set the value of
distance
for thisText
. This corresponds to thedistance
attribute of a<text>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_font
(v)[source]¶ Set the value of
font
for thisText
. This corresponds to thefont
attribute of a<text>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_layer
(v)[source]¶ Set the value of
layer
for thisText
. This corresponds to thelayer
attribute of a<text>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_ratio
(v)[source]¶ Set the value of
ratio
for thisText
. This corresponds to theratio
attribute of a<text>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_rot
(v)[source]¶ Set the value of
rot
for thisText
. This corresponds to therot
attribute of a<text>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_size
(v)[source]¶ Set the value of
size
for thisText
. This corresponds to thesize
attribute of a<text>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_x
(v)[source]¶ Set the value of
x
for thisText
. This corresponds to thex
attribute of a<text>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_y
(v)[source]¶ Set the value of
y
for thisText
. This corresponds to they
attribute of a<text>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
with_align
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofalign
. For use in combination withFrom
objects.Return
self
if one of the following is true:align
equalsv
v
is callable andv(self.get_align()
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_distance
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofdistance
. For use in combination withFrom
objects.Return
self
if one of the following is true:distance
equalsv
v
is callable andv(self.get_distance()
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_font
(v)[source]¶ Filter this
EagleFilePart
object based on the value offont
. For use in combination withFrom
objects.Return
self
if one of the following is true:font
equalsv
v
is callable andv(self.get_font()
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_ratio
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofratio
. For use in combination withFrom
objects.Return
self
if one of the following is true:ratio
equalsv
v
is callable andv(self.get_ratio()
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_size
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofsize
. For use in combination withFrom
objects.Return
self
if one of the following is true:size
equalsv
v
is callable andv(self.get_size()
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_text
(v)[source]¶ Filter this
EagleFilePart
object based on the value oftext
. For use in combination withFrom
objects.Return
self
if one of the following is true:text
equalsv
v
is callable andv(self.get_text()
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
Wire¶
-
class
Swoop.
Wire
[source]¶ Bases:
Swoop.Swoop.EagleFilePart
Class representing the contents of a <wire> tag in Eagle files.
Attributes:
x1
y1
x2
y2
width
layer
extent
style
curve
cap
-
clone
()[source]¶ Recursively clone this
Wire
. It will be identical to the original, but it’s parent will beNone
.Return type: Wire
-
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_cap
()[source]¶ Return the value of
cap
for thisWire
. This corresponds to thecap
attribute of a<wire>
in an Eagle file.Return type: str
-
get_children
()[source]¶ Get all the children of this
EagleFilePart
.Return type: List of EagleFilePart
objects
-
get_curve
()[source]¶ Return the value of
curve
for thisWire
. This corresponds to thecurve
attribute of a<wire>
in an Eagle file.Return type: float
-
get_extent
()[source]¶ Return the value of
extent
for thisWire
. This corresponds to theextent
attribute of a<wire>
in an Eagle file.Return type: str
-
get_layer
()[source]¶ Return the value of
layer
for thisWire
. This corresponds to thelayer
attribute of a<wire>
in an Eagle file.Return type: layer_string
-
get_style
()[source]¶ Return the value of
style
for thisWire
. This corresponds to thestyle
attribute of a<wire>
in an Eagle file.Return type: str
-
get_width
()[source]¶ Return the value of
width
for thisWire
. This corresponds to thewidth
attribute of a<wire>
in an Eagle file.Return type: float
-
get_x1
()[source]¶ Return the value of
x1
for thisWire
. This corresponds to thex1
attribute of a<wire>
in an Eagle file.Return type: float
-
get_x2
()[source]¶ Return the value of
x2
for thisWire
. This corresponds to thex2
attribute of a<wire>
in an Eagle file.Return type: float
-
get_y1
()[source]¶ Return the value of
y1
for thisWire
. This corresponds to they1
attribute of a<wire>
in an Eagle file.Return type: float
-
get_y2
()[source]¶ Return the value of
y2
for thisWire
. This corresponds to they2
attribute of a<wire>
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_cap
(v)[source]¶ Set the value of
cap
for thisWire
. This corresponds to thecap
attribute of a<wire>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_curve
(v)[source]¶ Set the value of
curve
for thisWire
. This corresponds to thecurve
attribute of a<wire>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_extent
(v)[source]¶ Set the value of
extent
for thisWire
. This corresponds to theextent
attribute of a<wire>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_layer
(v)[source]¶ Set the value of
layer
for thisWire
. This corresponds to thelayer
attribute of a<wire>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_style
(v)[source]¶ Set the value of
style
for thisWire
. This corresponds to thestyle
attribute of a<wire>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_width
(v)[source]¶ Set the value of
width
for thisWire
. This corresponds to thewidth
attribute of a<wire>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_x1
(v)[source]¶ Set the value of
x1
for thisWire
. This corresponds to thex1
attribute of a<wire>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_x2
(v)[source]¶ Set the value of
x2
for thisWire
. This corresponds to thex2
attribute of a<wire>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_y1
(v)[source]¶ Set the value of
y1
for thisWire
. This corresponds to they1
attribute of a<wire>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_y2
(v)[source]¶ Set the value of
y2
for thisWire
. This corresponds to they2
attribute of a<wire>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
with_cap
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofcap
. For use in combination withFrom
objects.Return
self
if one of the following is true:cap
equalsv
v
is callable andv(self.get_cap()
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_curve
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofcurve
. For use in combination withFrom
objects.Return
self
if one of the following is true:curve
equalsv
v
is callable andv(self.get_curve()
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_extent
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofextent
. For use in combination withFrom
objects.Return
self
if one of the following is true:extent
equalsv
v
is callable andv(self.get_extent()
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_style
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofstyle
. For use in combination withFrom
objects.Return
self
if one of the following is true:style
equalsv
v
is callable andv(self.get_style()
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_width
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofwidth
. For use in combination withFrom
objects.Return
self
if one of the following is true:width
equalsv
v
is callable andv(self.get_width()
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_x1
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofx1
. For use in combination withFrom
objects.Return
self
if one of the following is true:x1
equalsv
v
is callable andv(self.get_x1()
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_x2
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofx2
. For use in combination withFrom
objects.Return
self
if one of the following is true:x2
equalsv
v
is callable andv(self.get_x2()
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_y1
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofy1
. For use in combination withFrom
objects.Return
self
if one of the following is true:y1
equalsv
v
is callable andv(self.get_y1()
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_y2
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofy2
. For use in combination withFrom
objects.Return
self
if one of the following is true:y2
equalsv
v
is callable andv(self.get_y2()
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
Polygon¶
-
class
Swoop.
Polygon
[source]¶ Bases:
Swoop.Swoop.EagleFilePart
Class representing the contents of a <polygon> tag in Eagle files.
Attributes:
width
layer
spacing
pour
isolate
orphans
thermals
rank
Collections:
vertex
: List ofVertex
objects.
-
add_vertex
(s)[source]¶ Add a
Vertex
to thevertices
of thisPolygon
.Parameters: s – The Vertex
to add.Return type: self
-
clear_vertices
()[source]¶ Remove all the
Vertex
objects from thevertices
of thisPolygon
.Return type: self
-
clone
()[source]¶ Recursively clone this
Polygon
. It will be identical to the original, but it’s parent will beNone
.Return type: Polygon
-
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_isolate
()[source]¶ Return the value of
isolate
for thisPolygon
. This corresponds to theisolate
attribute of a<polygon>
in an Eagle file.Return type: float
-
get_layer
()[source]¶ Return the value of
layer
for thisPolygon
. This corresponds to thelayer
attribute of a<polygon>
in an Eagle file.Return type: layer_string
-
get_nth_vertex
(n)[source]¶ get then nth
Vertex
object from thevertices
of thisPolygon
.Parameters: n – Index of the item to return. Return type: Vertex
object
-
get_orphans
()[source]¶ Return the value of
orphans
for thisPolygon
. This corresponds to theorphans
attribute of a<polygon>
in an Eagle file.Return type: bool
-
get_pour
()[source]¶ Return the value of
pour
for thisPolygon
. This corresponds to thepour
attribute of a<polygon>
in an Eagle file.Return type: str
-
get_rank
()[source]¶ Return the value of
rank
for thisPolygon
. This corresponds to therank
attribute of a<polygon>
in an Eagle file.Return type: int
-
get_spacing
()[source]¶ Return the value of
spacing
for thisPolygon
. This corresponds to thespacing
attribute of a<polygon>
in an Eagle file.Return type: float
-
get_thermals
()[source]¶ Return the value of
thermals
for thisPolygon
. This corresponds to thethermals
attribute of a<polygon>
in an Eagle file.Return type: bool
-
get_vertices
(attrs=None, type=None)[source]¶ Return (and possibly filter) items in the the
vertices
list ofVertex
objects for thisPolygon
.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
Vertex
objectsReturn type: List of
Vertex
objects
-
get_width
()[source]¶ Return the value of
width
for thisPolygon
. This corresponds to thewidth
attribute of a<polygon>
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
-
remove_vertex
(efp)[source]¶ Remove a
Vertex
from thevertices
of thisPolygon
.Parameters: efp – The Vertex
object to remove.Return type: self
-
set_isolate
(v)[source]¶ Set the value of
isolate
for thisPolygon
. This corresponds to theisolate
attribute of a<polygon>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_layer
(v)[source]¶ Set the value of
layer
for thisPolygon
. This corresponds to thelayer
attribute of a<polygon>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_orphans
(v)[source]¶ Set the value of
orphans
for thisPolygon
. This corresponds to theorphans
attribute of a<polygon>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_pour
(v)[source]¶ Set the value of
pour
for thisPolygon
. This corresponds to thepour
attribute of a<polygon>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_rank
(v)[source]¶ Set the value of
rank
for thisPolygon
. This corresponds to therank
attribute of a<polygon>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_spacing
(v)[source]¶ Set the value of
spacing
for thisPolygon
. This corresponds to thespacing
attribute of a<polygon>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_thermals
(v)[source]¶ Set the value of
thermals
for thisPolygon
. This corresponds to thethermals
attribute of a<polygon>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_width
(v)[source]¶ Set the value of
width
for thisPolygon
. This corresponds to thewidth
attribute of a<polygon>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
with_isolate
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofisolate
. For use in combination withFrom
objects.Return
self
if one of the following is true:isolate
equalsv
v
is callable andv(self.get_isolate()
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_orphans
(v)[source]¶ Filter this
EagleFilePart
object based on the value oforphans
. For use in combination withFrom
objects.Return
self
if one of the following is true:orphans
equalsv
v
is callable andv(self.get_orphans()
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_pour
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofpour
. For use in combination withFrom
objects.Return
self
if one of the following is true:pour
equalsv
v
is callable andv(self.get_pour()
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_rank
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofrank
. For use in combination withFrom
objects.Return
self
if one of the following is true:rank
equalsv
v
is callable andv(self.get_rank()
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_spacing
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofspacing
. For use in combination withFrom
objects.Return
self
if one of the following is true:spacing
equalsv
v
is callable andv(self.get_spacing()
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_width
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofwidth
. For use in combination withFrom
objects.Return
self
if one of the following is true:width
equalsv
v
is callable andv(self.get_width()
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
Rectangle¶
-
class
Swoop.
Rectangle
[source]¶ Bases:
Swoop.Swoop.EagleFilePart
Class representing the contents of a <rectangle> tag in Eagle files.
Attributes:
x1
y1
x2
y2
layer
rot
-
clone
()[source]¶ Recursively clone this
Rectangle
. It will be identical to the original, but it’s parent will beNone
.Return type: Rectangle
-
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_layer
()[source]¶ Return the value of
layer
for thisRectangle
. This corresponds to thelayer
attribute of a<rectangle>
in an Eagle file.Return type: layer_string
-
get_rot
()[source]¶ Return the value of
rot
for thisRectangle
. This corresponds to therot
attribute of a<rectangle>
in an Eagle file.Return type: str
-
get_x1
()[source]¶ Return the value of
x1
for thisRectangle
. This corresponds to thex1
attribute of a<rectangle>
in an Eagle file.Return type: float
-
get_x2
()[source]¶ Return the value of
x2
for thisRectangle
. This corresponds to thex2
attribute of a<rectangle>
in an Eagle file.Return type: float
-
get_y1
()[source]¶ Return the value of
y1
for thisRectangle
. This corresponds to they1
attribute of a<rectangle>
in an Eagle file.Return type: float
-
get_y2
()[source]¶ Return the value of
y2
for thisRectangle
. This corresponds to they2
attribute of a<rectangle>
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_layer
(v)[source]¶ Set the value of
layer
for thisRectangle
. This corresponds to thelayer
attribute of a<rectangle>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_rot
(v)[source]¶ Set the value of
rot
for thisRectangle
. This corresponds to therot
attribute of a<rectangle>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_x1
(v)[source]¶ Set the value of
x1
for thisRectangle
. This corresponds to thex1
attribute of a<rectangle>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_x2
(v)[source]¶ Set the value of
x2
for thisRectangle
. This corresponds to thex2
attribute of a<rectangle>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_y1
(v)[source]¶ Set the value of
y1
for thisRectangle
. This corresponds to they1
attribute of a<rectangle>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_y2
(v)[source]¶ Set the value of
y2
for thisRectangle
. This corresponds to they2
attribute of a<rectangle>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
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_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_x1
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofx1
. For use in combination withFrom
objects.Return
self
if one of the following is true:x1
equalsv
v
is callable andv(self.get_x1()
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_x2
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofx2
. For use in combination withFrom
objects.Return
self
if one of the following is true:x2
equalsv
v
is callable andv(self.get_x2()
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_y1
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofy1
. For use in combination withFrom
objects.Return
self
if one of the following is true:y1
equalsv
v
is callable andv(self.get_y1()
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_y2
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofy2
. For use in combination withFrom
objects.Return
self
if one of the following is true:y2
equalsv
v
is callable andv(self.get_y2()
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
Vertex¶
-
class
Swoop.
Vertex
[source]¶ Bases:
Swoop.Swoop.EagleFilePart
Class representing the contents of a <vertex> tag in Eagle files.
Attributes:
x
y
curve
-
clone
()[source]¶ Recursively clone this
Vertex
. It will be identical to the original, but it’s parent will beNone
.Return type: Vertex
-
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_curve
()[source]¶ Return the value of
curve
for thisVertex
. This corresponds to thecurve
attribute of a<vertex>
in an Eagle file.Return type: float
-
get_x
()[source]¶ Return the value of
x
for thisVertex
. This corresponds to thex
attribute of a<vertex>
in an Eagle file.Return type: float
-
get_y
()[source]¶ Return the value of
y
for thisVertex
. This corresponds to they
attribute of a<vertex>
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_curve
(v)[source]¶ Set the value of
curve
for thisVertex
. This corresponds to thecurve
attribute of a<vertex>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_x
(v)[source]¶ Set the value of
x
for thisVertex
. This corresponds to thex
attribute of a<vertex>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_y
(v)[source]¶ Set the value of
y
for thisVertex
. This corresponds to they
attribute of a<vertex>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
with_curve
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofcurve
. For use in combination withFrom
objects.Return
self
if one of the following is true:curve
equalsv
v
is callable andv(self.get_curve()
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
Circle¶
-
class
Swoop.
Circle
[source]¶ Bases:
Swoop.Swoop.EagleFilePart
Class representing the contents of a <circle> tag in Eagle files.
Attributes:
x
y
radius
width
layer
-
clone
()[source]¶ Recursively clone this
Circle
. It will be identical to the original, but it’s parent will beNone
.Return type: Circle
-
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_layer
()[source]¶ Return the value of
layer
for thisCircle
. This corresponds to thelayer
attribute of a<circle>
in an Eagle file.Return type: layer_string
-
get_radius
()[source]¶ Return the value of
radius
for thisCircle
. This corresponds to theradius
attribute of a<circle>
in an Eagle file.Return type: float
-
get_width
()[source]¶ Return the value of
width
for thisCircle
. This corresponds to thewidth
attribute of a<circle>
in an Eagle file.Return type: float
-
get_x
()[source]¶ Return the value of
x
for thisCircle
. This corresponds to thex
attribute of a<circle>
in an Eagle file.Return type: float
-
get_y
()[source]¶ Return the value of
y
for thisCircle
. This corresponds to they
attribute of a<circle>
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_layer
(v)[source]¶ Set the value of
layer
for thisCircle
. This corresponds to thelayer
attribute of a<circle>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_radius
(v)[source]¶ Set the value of
radius
for thisCircle
. This corresponds to theradius
attribute of a<circle>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_width
(v)[source]¶ Set the value of
width
for thisCircle
. This corresponds to thewidth
attribute of a<circle>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_x
(v)[source]¶ Set the value of
x
for thisCircle
. This corresponds to thex
attribute of a<circle>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_y
(v)[source]¶ Set the value of
y
for thisCircle
. This corresponds to they
attribute of a<circle>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
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_radius
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofradius
. For use in combination withFrom
objects.Return
self
if one of the following is true:radius
equalsv
v
is callable andv(self.get_radius()
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_width
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofwidth
. For use in combination withFrom
objects.Return
self
if one of the following is true:width
equalsv
v
is callable andv(self.get_width()
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
Class¶
-
class
Swoop.
Class
[source]¶ Bases:
Swoop.Swoop.EagleFilePart
Class representing the contents of a <class> tag in Eagle files.
Attributes:
number
name
width
drill
Collections:
clearance
: Map ofClearance
objects indexed by theirnetclass
.
-
add_clearance
(s)[source]¶ Add a
Clearance
to theclearances
of thisClass
.Parameters: s – The Clearance
to add.Return type: self
-
clear_clearances
()[source]¶ Remove all the
Clearance
objects from theclearances
of thisClass
.Return type: self
-
clone
()[source]¶ Recursively clone this
Class
. It will be identical to the original, but it’s parent will beNone
.Return type: Class
-
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_clearance
(key)[source]¶ Lookup and return a
Clearance
from theclearances
of thisClass
.Parameters: key – A str
to use for the lookup. The lookup uses thenetclass
of theClearance
objects.Return type: A Clearance
object orNone
, if there is no such item.
-
get_clearances
(attrs=None, type=None)[source]¶ Return (and possibly filter) items in the the
clearances
map ofClearance
objects for thisClass
.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
Clearance
objectsReturn type: List of
Clearance
objects
-
get_drill
()[source]¶ Return the value of
drill
for thisClass
. This corresponds to thedrill
attribute of a<class>
in an Eagle file.Return type: float
-
get_name
()[source]¶ Return the value of
name
for thisClass
. This corresponds to thename
attribute of a<class>
in an Eagle file.Return type: str
-
get_nth_clearance
(n)[source]¶ get then nth
Clearance
object from theclearances
of thisClass
.Parameters: n – Index of the item to return. Return type: Clearance
object
-
get_number
()[source]¶ Return the value of
number
for thisClass
. This corresponds to thenumber
attribute of a<class>
in an Eagle file.Return type: str
-
get_width
()[source]¶ Return the value of
width
for thisClass
. This corresponds to thewidth
attribute of a<class>
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
-
remove_clearance
(efp)[source]¶ Remove a
Clearance
from theclearances
of thisClass
.Parameters: efp – The Clearance
object to remove.Return type: self
-
set_drill
(v)[source]¶ Set the value of
drill
for thisClass
. This corresponds to thedrill
attribute of a<class>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_name
(v)[source]¶ Set the value of
name
for thisClass
. This corresponds to thename
attribute of a<class>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_number
(v)[source]¶ Set the value of
number
for thisClass
. This corresponds to thenumber
attribute of a<class>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_width
(v)[source]¶ Set the value of
width
for thisClass
. This corresponds to thewidth
attribute of a<class>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
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_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_number
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofnumber
. For use in combination withFrom
objects.Return
self
if one of the following is true:number
equalsv
v
is callable andv(self.get_number()
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_width
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofwidth
. For use in combination withFrom
objects.Return
self
if one of the following is true:width
equalsv
v
is callable andv(self.get_width()
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
Approved¶
-
class
Swoop.
Approved
[source]¶ Bases:
Swoop.Swoop.EagleFilePart
Class representing the contents of a <approved> tag in Eagle files.
Attributes:
hash
-
clone
()[source]¶ Recursively clone this
Approved
. It will be identical to the original, but it’s parent will beNone
.Return type: Approved
-
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_hash
()[source]¶ Return the value of
hash
for thisApproved
. This corresponds to thehash
attribute of a<approved>
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_hash
(v)[source]¶ Set the value of
hash
for thisApproved
. This corresponds to thehash
attribute of a<approved>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
with_hash
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofhash
. For use in combination withFrom
objects.Return
self
if one of the following is true:hash
equalsv
v
is callable andv(self.get_hash()
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
Clearance¶
-
class
Swoop.
Clearance
[source]¶ Bases:
Swoop.Swoop.EagleFilePart
Class representing the contents of a <clearance> tag in Eagle files.
Attributes:
class
value
-
clone
()[source]¶ Recursively clone this
Clearance
. It will be identical to the original, but it’s parent will beNone
.Return type: Clearance
-
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_class
()[source]¶ Find the
Class
object refered to by thenetclass
attribute of this object. This is likeget_netclass()
, except it returns theClass
object instead of its name.Returns: The object Return type: Class
-
get_children
()[source]¶ Get all the children of this
EagleFilePart
.Return type: List of EagleFilePart
objects
-
get_class
()[source]¶ Return the value of
netclass
for thisClearance
. This corresponds to thenetclass
attribute of a<clearance>
in an Eagle file.Return type: str
-
get_value
()[source]¶ Return the value of
value
for thisClearance
. This corresponds to thevalue
attribute of a<clearance>
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_class
(v)[source]¶ Set the value of
netclass
for thisClearance
. This corresponds to thenetclass
attribute of a<clearance>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_value
(v)[source]¶ Set the value of
value
for thisClearance
. This corresponds to thevalue
attribute of a<clearance>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
with_class
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofnetclass
. For use in combination withFrom
objects.Return
self
if one of the following is true:netclass
equalsv
v
is callable andv(self.get_class()
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_value
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofvalue
. For use in combination withFrom
objects.Return
self
if one of the following is true:value
equalsv
v
is callable andv(self.get_value()
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
Compatibility¶
-
class
Swoop.
Compatibility
[source]¶ Bases:
Swoop.Swoop.EagleFilePart
Class representing the contents of a <compatibility> tag in Eagle files.
Attributes:
Collections:
note
: List ofNote
objects.
-
add_note
(s)[source]¶ Add a
Note
to thenotes
of thisCompatibility
.Parameters: s – The Note
to add.Return type: self
-
clear_notes
()[source]¶ Remove all the
Note
objects from thenotes
of thisCompatibility
.Return type: self
-
clone
()[source]¶ Recursively clone this
Compatibility
. It will be identical to the original, but it’s parent will beNone
.Return type: Compatibility
-
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_et
()[source]¶ Generate a <compatibility> element tree for a
Compatibility
.Return type: ElementTree
.
-
get_notes
(attrs=None, type=None)[source]¶ Return (and possibly filter) items in the the
notes
list ofNote
objects for thisCompatibility
.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
Note
objectsReturn type: List of
Note
objects
-
get_nth_note
(n)[source]¶ get then nth
Note
object from thenotes
of thisCompatibility
.Parameters: n – Index of the item to return. Return type: Note
object
-
remove_child
(efp)[source]¶ Remove a child
EagleFilePart
object.Parameters: efp – the class:EagleFilePart object to remove. Returns: Nothing
-
remove_note
(efp)[source]¶ Remove a
Note
from thenotes
of thisCompatibility
.Parameters: efp – The Note
object to remove.Return type: self
Description¶
-
class
Swoop.
Description
[source]¶ Bases:
Swoop.Swoop.EagleFilePart
Class representing the contents of a <description> tag in Eagle files.
Attributes:
language
-
clone
()[source]¶ Recursively clone this
Description
. It will be identical to the original, but it’s parent will beNone
.Return type: Description
-
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_et
()[source]¶ Generate a <description> element tree for a
Description
.Return type: ElementTree
.
-
get_language
()[source]¶ Return the value of
language
for thisDescription
. This corresponds to thelanguage
attribute of a<description>
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_language
(v)[source]¶ Set the value of
language
for thisDescription
. This corresponds to thelanguage
attribute of a<description>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
with_language
(v)[source]¶ Filter this
EagleFilePart
object based on the value oflanguage
. For use in combination withFrom
objects.Return
self
if one of the following is true:language
equalsv
v
is callable andv(self.get_language()
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_text
(v)[source]¶ Filter this
EagleFilePart
object based on the value oftext
. For use in combination withFrom
objects.Return
self
if one of the following is true:text
equalsv
v
is callable andv(self.get_text()
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
Designrules¶
-
class
Swoop.
Designrules
[source]¶ Bases:
Swoop.Swoop.EagleFilePart
Class representing the contents of a <designrules> tag in Eagle files.
Attributes:
name
Collections:
description
: List ofDescription
objects.param
: Map ofParam
objects indexed by theirname
.
-
add_description
(s)[source]¶ Add a
Description
to thedescription
of thisDesignrules
.Parameters: s – The Description
to add.Return type: self
-
add_param
(s)[source]¶ Add a
Param
to theparams
of thisDesignrules
.Parameters: s – The Param
to add.Return type: self
-
clear_description
()[source]¶ Remove all the
Description
objects from thedescription
of thisDesignrules
.Return type: self
-
clear_params
()[source]¶ Remove all the
Param
objects from theparams
of thisDesignrules
.Return type: self
-
clone
()[source]¶ Recursively clone this
Designrules
. It will be identical to the original, but it’s parent will beNone
.Return type: Designrules
-
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
(attrs=None, type=None)[source]¶ Return (and possibly filter) items in the the
description
list ofDescription
objects for thisDesignrules
.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
Description
objectsReturn type: List of
Description
objects
-
get_et
()[source]¶ Generate a <designrules> element tree for a
Designrules
.Return type: ElementTree
.
-
get_name
()[source]¶ Return the value of
name
for thisDesignrules
. This corresponds to thename
attribute of a<designrules>
in an Eagle file.Return type: str
-
get_nth_description
(n)[source]¶ get then nth
Description
object from thedescription
of thisDesignrules
.Parameters: n – Index of the item to return. Return type: Description
object
-
get_nth_param
(n)[source]¶ get then nth
Param
object from theparams
of thisDesignrules
.Parameters: n – Index of the item to return. Return type: Param
object
-
get_param
(key)[source]¶ Lookup and return a
Param
from theparams
of thisDesignrules
.Parameters: key – A str
to use for the lookup. The lookup uses thename
of theParam
objects.Return type: A Param
object orNone
, if there is no such item.
-
get_params
(attrs=None, type=None)[source]¶ Return (and possibly filter) items in the the
params
map ofParam
objects for thisDesignrules
.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
Param
objectsReturn type: List of
Param
objects
-
remove_child
(efp)[source]¶ Remove a child
EagleFilePart
object.Parameters: efp – the class:EagleFilePart object to remove. Returns: Nothing
-
remove_description
(efp)[source]¶ Remove a
Description
from thedescription
of thisDesignrules
.Parameters: efp – The Description
object to remove.Return type: self
-
remove_param
(efp)[source]¶ Remove a
Param
from theparams
of thisDesignrules
.Parameters: efp – The Param
object to remove.Return type: self
-
set_name
(v)[source]¶ Set the value of
name
for thisDesignrules
. This corresponds to thename
attribute of a<designrules>
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
Dimension¶
-
class
Swoop.
Dimension
[source]¶ Bases:
Swoop.Swoop.EagleFilePart
Class representing the contents of a <dimension> tag in Eagle files.
Attributes:
x1
y1
x2
y2
x3
y3
layer
dtype
width
extwidth
extlength
extoffset
textsize
textratio
unit
precision
visible
-
clone
()[source]¶ Recursively clone this
Dimension
. It will be identical to the original, but it’s parent will beNone
.Return type: Dimension
-
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_dtype
()[source]¶ Return the value of
dtype
for thisDimension
. This corresponds to thedtype
attribute of a<dimension>
in an Eagle file.Return type: str
-
get_extlength
()[source]¶ Return the value of
extlength
for thisDimension
. This corresponds to theextlength
attribute of a<dimension>
in an Eagle file.Return type: float
-
get_extoffset
()[source]¶ Return the value of
extoffset
for thisDimension
. This corresponds to theextoffset
attribute of a<dimension>
in an Eagle file.Return type: float
-
get_extwidth
()[source]¶ Return the value of
extwidth
for thisDimension
. This corresponds to theextwidth
attribute of a<dimension>
in an Eagle file.Return type: float
-
get_layer
()[source]¶ Return the value of
layer
for thisDimension
. This corresponds to thelayer
attribute of a<dimension>
in an Eagle file.Return type: layer_string
-
get_precision
()[source]¶ Return the value of
precision
for thisDimension
. This corresponds to theprecision
attribute of a<dimension>
in an Eagle file.Return type: int
-
get_textratio
()[source]¶ Return the value of
textratio
for thisDimension
. This corresponds to thetextratio
attribute of a<dimension>
in an Eagle file.Return type: int
-
get_textsize
()[source]¶ Return the value of
textsize
for thisDimension
. This corresponds to thetextsize
attribute of a<dimension>
in an Eagle file.Return type: float
-
get_unit
()[source]¶ Return the value of
unit
for thisDimension
. This corresponds to theunit
attribute of a<dimension>
in an Eagle file.Return type: str
-
get_visible
()[source]¶ Return the value of
visible
for thisDimension
. This corresponds to thevisible
attribute of a<dimension>
in an Eagle file.Return type: bool
-
get_width
()[source]¶ Return the value of
width
for thisDimension
. This corresponds to thewidth
attribute of a<dimension>
in an Eagle file.Return type: float
-
get_x1
()[source]¶ Return the value of
x1
for thisDimension
. This corresponds to thex1
attribute of a<dimension>
in an Eagle file.Return type: float
-
get_x2
()[source]¶ Return the value of
x2
for thisDimension
. This corresponds to thex2
attribute of a<dimension>
in an Eagle file.Return type: float
-
get_x3
()[source]¶ Return the value of
x3
for thisDimension
. This corresponds to thex3
attribute of a<dimension>
in an Eagle file.Return type: float
-
get_y1
()[source]¶ Return the value of
y1
for thisDimension
. This corresponds to they1
attribute of a<dimension>
in an Eagle file.Return type: float
-
get_y2
()[source]¶ Return the value of
y2
for thisDimension
. This corresponds to they2
attribute of a<dimension>
in an Eagle file.Return type: float
-
get_y3
()[source]¶ Return the value of
y3
for thisDimension
. This corresponds to they3
attribute of a<dimension>
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_dtype
(v)[source]¶ Set the value of
dtype
for thisDimension
. This corresponds to thedtype
attribute of a<dimension>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_extlength
(v)[source]¶ Set the value of
extlength
for thisDimension
. This corresponds to theextlength
attribute of a<dimension>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_extoffset
(v)[source]¶ Set the value of
extoffset
for thisDimension
. This corresponds to theextoffset
attribute of a<dimension>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_extwidth
(v)[source]¶ Set the value of
extwidth
for thisDimension
. This corresponds to theextwidth
attribute of a<dimension>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_layer
(v)[source]¶ Set the value of
layer
for thisDimension
. This corresponds to thelayer
attribute of a<dimension>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_precision
(v)[source]¶ Set the value of
precision
for thisDimension
. This corresponds to theprecision
attribute of a<dimension>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_textratio
(v)[source]¶ Set the value of
textratio
for thisDimension
. This corresponds to thetextratio
attribute of a<dimension>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_textsize
(v)[source]¶ Set the value of
textsize
for thisDimension
. This corresponds to thetextsize
attribute of a<dimension>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_unit
(v)[source]¶ Set the value of
unit
for thisDimension
. This corresponds to theunit
attribute of a<dimension>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_visible
(v)[source]¶ Set the value of
visible
for thisDimension
. This corresponds to thevisible
attribute of a<dimension>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_width
(v)[source]¶ Set the value of
width
for thisDimension
. This corresponds to thewidth
attribute of a<dimension>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_x1
(v)[source]¶ Set the value of
x1
for thisDimension
. This corresponds to thex1
attribute of a<dimension>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_x2
(v)[source]¶ Set the value of
x2
for thisDimension
. This corresponds to thex2
attribute of a<dimension>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_x3
(v)[source]¶ Set the value of
x3
for thisDimension
. This corresponds to thex3
attribute of a<dimension>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_y1
(v)[source]¶ Set the value of
y1
for thisDimension
. This corresponds to they1
attribute of a<dimension>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_y2
(v)[source]¶ Set the value of
y2
for thisDimension
. This corresponds to they2
attribute of a<dimension>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_y3
(v)[source]¶ Set the value of
y3
for thisDimension
. This corresponds to they3
attribute of a<dimension>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
with_dtype
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofdtype
. For use in combination withFrom
objects.Return
self
if one of the following is true:dtype
equalsv
v
is callable andv(self.get_dtype()
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_extlength
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofextlength
. For use in combination withFrom
objects.Return
self
if one of the following is true:extlength
equalsv
v
is callable andv(self.get_extlength()
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_extoffset
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofextoffset
. For use in combination withFrom
objects.Return
self
if one of the following is true:extoffset
equalsv
v
is callable andv(self.get_extoffset()
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_extwidth
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofextwidth
. For use in combination withFrom
objects.Return
self
if one of the following is true:extwidth
equalsv
v
is callable andv(self.get_extwidth()
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_precision
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofprecision
. For use in combination withFrom
objects.Return
self
if one of the following is true:precision
equalsv
v
is callable andv(self.get_precision()
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_textratio
(v)[source]¶ Filter this
EagleFilePart
object based on the value oftextratio
. For use in combination withFrom
objects.Return
self
if one of the following is true:textratio
equalsv
v
is callable andv(self.get_textratio()
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_textsize
(v)[source]¶ Filter this
EagleFilePart
object based on the value oftextsize
. For use in combination withFrom
objects.Return
self
if one of the following is true:textsize
equalsv
v
is callable andv(self.get_textsize()
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_unit
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofunit
. For use in combination withFrom
objects.Return
self
if one of the following is true:unit
equalsv
v
is callable andv(self.get_unit()
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_visible
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofvisible
. For use in combination withFrom
objects.Return
self
if one of the following is true:visible
equalsv
v
is callable andv(self.get_visible()
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_width
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofwidth
. For use in combination withFrom
objects.Return
self
if one of the following is true:width
equalsv
v
is callable andv(self.get_width()
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_x1
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofx1
. For use in combination withFrom
objects.Return
self
if one of the following is true:x1
equalsv
v
is callable andv(self.get_x1()
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_x2
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofx2
. For use in combination withFrom
objects.Return
self
if one of the following is true:x2
equalsv
v
is callable andv(self.get_x2()
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_x3
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofx3
. For use in combination withFrom
objects.Return
self
if one of the following is true:x3
equalsv
v
is callable andv(self.get_x3()
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_y1
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofy1
. For use in combination withFrom
objects.Return
self
if one of the following is true:y1
equalsv
v
is callable andv(self.get_y1()
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_y2
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofy2
. For use in combination withFrom
objects.Return
self
if one of the following is true:y2
equalsv
v
is callable andv(self.get_y2()
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_y3
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofy3
. For use in combination withFrom
objects.Return
self
if one of the following is true:y3
equalsv
v
is callable andv(self.get_y3()
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
Grid¶
-
class
Swoop.
Grid
[source]¶ Bases:
Swoop.Swoop.EagleFilePart
Class representing the contents of a <grid> tag in Eagle files.
Attributes:
distance
unitdist
unit
style
multiple
display
altdistance
altunitdist
altunit
-
clone
()[source]¶ Recursively clone this
Grid
. It will be identical to the original, but it’s parent will beNone
.Return type: Grid
-
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_altdistance
()[source]¶ Return the value of
altdistance
for thisGrid
. This corresponds to thealtdistance
attribute of a<grid>
in an Eagle file.Return type: float
-
get_altunit
()[source]¶ Return the value of
altunit
for thisGrid
. This corresponds to thealtunit
attribute of a<grid>
in an Eagle file.Return type: str
-
get_altunitdist
()[source]¶ Return the value of
altunitdist
for thisGrid
. This corresponds to thealtunitdist
attribute of a<grid>
in an Eagle file.Return type: str
-
get_children
()[source]¶ Get all the children of this
EagleFilePart
.Return type: List of EagleFilePart
objects
-
get_display
()[source]¶ Return the value of
display
for thisGrid
. This corresponds to thedisplay
attribute of a<grid>
in an Eagle file.Return type: bool
-
get_distance
()[source]¶ Return the value of
distance
for thisGrid
. This corresponds to thedistance
attribute of a<grid>
in an Eagle file.Return type: float
-
get_multiple
()[source]¶ Return the value of
multiple
for thisGrid
. This corresponds to themultiple
attribute of a<grid>
in an Eagle file.Return type: int
-
get_style
()[source]¶ Return the value of
style
for thisGrid
. This corresponds to thestyle
attribute of a<grid>
in an Eagle file.Return type: str
-
get_unit
()[source]¶ Return the value of
unit
for thisGrid
. This corresponds to theunit
attribute of a<grid>
in an Eagle file.Return type: str
-
get_unitdist
()[source]¶ Return the value of
unitdist
for thisGrid
. This corresponds to theunitdist
attribute of a<grid>
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_altdistance
(v)[source]¶ Set the value of
altdistance
for thisGrid
. This corresponds to thealtdistance
attribute of a<grid>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_altunit
(v)[source]¶ Set the value of
altunit
for thisGrid
. This corresponds to thealtunit
attribute of a<grid>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_altunitdist
(v)[source]¶ Set the value of
altunitdist
for thisGrid
. This corresponds to thealtunitdist
attribute of a<grid>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_display
(v)[source]¶ Set the value of
display
for thisGrid
. This corresponds to thedisplay
attribute of a<grid>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_distance
(v)[source]¶ Set the value of
distance
for thisGrid
. This corresponds to thedistance
attribute of a<grid>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_multiple
(v)[source]¶ Set the value of
multiple
for thisGrid
. This corresponds to themultiple
attribute of a<grid>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_style
(v)[source]¶ Set the value of
style
for thisGrid
. This corresponds to thestyle
attribute of a<grid>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_unit
(v)[source]¶ Set the value of
unit
for thisGrid
. This corresponds to theunit
attribute of a<grid>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_unitdist
(v)[source]¶ Set the value of
unitdist
for thisGrid
. This corresponds to theunitdist
attribute of a<grid>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
with_altdistance
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofaltdistance
. For use in combination withFrom
objects.Return
self
if one of the following is true:altdistance
equalsv
v
is callable andv(self.get_altdistance()
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_altunit
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofaltunit
. For use in combination withFrom
objects.Return
self
if one of the following is true:altunit
equalsv
v
is callable andv(self.get_altunit()
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_altunitdist
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofaltunitdist
. For use in combination withFrom
objects.Return
self
if one of the following is true:altunitdist
equalsv
v
is callable andv(self.get_altunitdist()
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_display
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofdisplay
. For use in combination withFrom
objects.Return
self
if one of the following is true:display
equalsv
v
is callable andv(self.get_display()
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_distance
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofdistance
. For use in combination withFrom
objects.Return
self
if one of the following is true:distance
equalsv
v
is callable andv(self.get_distance()
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_multiple
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofmultiple
. For use in combination withFrom
objects.Return
self
if one of the following is true:multiple
equalsv
v
is callable andv(self.get_multiple()
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_style
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofstyle
. For use in combination withFrom
objects.Return
self
if one of the following is true:style
equalsv
v
is callable andv(self.get_style()
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_unit
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofunit
. For use in combination withFrom
objects.Return
self
if one of the following is true:unit
equalsv
v
is callable andv(self.get_unit()
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_unitdist
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofunitdist
. For use in combination withFrom
objects.Return
self
if one of the following is true:unitdist
equalsv
v
is callable andv(self.get_unitdist()
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
Hole¶
-
class
Swoop.
Hole
[source]¶ Bases:
Swoop.Swoop.EagleFilePart
Class representing the contents of a <hole> tag in Eagle files.
Attributes:
x
y
drill
-
clone
()[source]¶ Recursively clone this
Hole
. It will be identical to the original, but it’s parent will beNone
.Return type: Hole
-
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_drill
()[source]¶ Return the value of
drill
for thisHole
. This corresponds to thedrill
attribute of a<hole>
in an Eagle file.Return type: float
-
get_x
()[source]¶ Return the value of
x
for thisHole
. This corresponds to thex
attribute of a<hole>
in an Eagle file.Return type: float
-
get_y
()[source]¶ Return the value of
y
for thisHole
. This corresponds to they
attribute of a<hole>
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_drill
(v)[source]¶ Set the value of
drill
for thisHole
. This corresponds to thedrill
attribute of a<hole>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_x
(v)[source]¶ Set the value of
x
for thisHole
. This corresponds to thex
attribute of a<hole>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_y
(v)[source]¶ Set the value of
y
for thisHole
. This corresponds to they
attribute of a<hole>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
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_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
Label¶
-
class
Swoop.
Label
[source]¶ Bases:
Swoop.Swoop.EagleFilePart
Class representing the contents of a <label> tag in Eagle files.
Attributes:
x
y
size
layer
font
ratio
rot
xref
-
clone
()[source]¶ Recursively clone this
Label
. It will be identical to the original, but it’s parent will beNone
.Return type: Label
-
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_font
()[source]¶ Return the value of
font
for thisLabel
. This corresponds to thefont
attribute of a<label>
in an Eagle file.Return type: str
-
get_layer
()[source]¶ Return the value of
layer
for thisLabel
. This corresponds to thelayer
attribute of a<label>
in an Eagle file.Return type: layer_string
-
get_ratio
()[source]¶ Return the value of
ratio
for thisLabel
. This corresponds to theratio
attribute of a<label>
in an Eagle file.Return type: int
-
get_rot
()[source]¶ Return the value of
rot
for thisLabel
. This corresponds to therot
attribute of a<label>
in an Eagle file.Return type: str
-
get_size
()[source]¶ Return the value of
size
for thisLabel
. This corresponds to thesize
attribute of a<label>
in an Eagle file.Return type: float
-
get_x
()[source]¶ Return the value of
x
for thisLabel
. This corresponds to thex
attribute of a<label>
in an Eagle file.Return type: float
-
get_xref
()[source]¶ Return the value of
xref
for thisLabel
. This corresponds to thexref
attribute of a<label>
in an Eagle file.Return type: bool
-
get_y
()[source]¶ Return the value of
y
for thisLabel
. This corresponds to they
attribute of a<label>
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_font
(v)[source]¶ Set the value of
font
for thisLabel
. This corresponds to thefont
attribute of a<label>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_layer
(v)[source]¶ Set the value of
layer
for thisLabel
. This corresponds to thelayer
attribute of a<label>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_ratio
(v)[source]¶ Set the value of
ratio
for thisLabel
. This corresponds to theratio
attribute of a<label>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_rot
(v)[source]¶ Set the value of
rot
for thisLabel
. This corresponds to therot
attribute of a<label>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_size
(v)[source]¶ Set the value of
size
for thisLabel
. This corresponds to thesize
attribute of a<label>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_x
(v)[source]¶ Set the value of
x
for thisLabel
. This corresponds to thex
attribute of a<label>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_xref
(v)[source]¶ Set the value of
xref
for thisLabel
. This corresponds to thexref
attribute of a<label>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_y
(v)[source]¶ Set the value of
y
for thisLabel
. This corresponds to they
attribute of a<label>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
with_font
(v)[source]¶ Filter this
EagleFilePart
object based on the value offont
. For use in combination withFrom
objects.Return
self
if one of the following is true:font
equalsv
v
is callable andv(self.get_font()
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_ratio
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofratio
. For use in combination withFrom
objects.Return
self
if one of the following is true:ratio
equalsv
v
is callable andv(self.get_ratio()
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_size
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofsize
. For use in combination withFrom
objects.Return
self
if one of the following is true:size
equalsv
v
is callable andv(self.get_size()
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_xref
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofxref
. For use in combination withFrom
objects.Return
self
if one of the following is true:xref
equalsv
v
is callable andv(self.get_xref()
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
Note¶
-
class
Swoop.
Note
[source]¶ Bases:
Swoop.Swoop.EagleFilePart
Class representing the contents of a <note> tag in Eagle files.
Attributes:
minversion
version
severity
-
clone
()[source]¶ Recursively clone this
Note
. It will be identical to the original, but it’s parent will beNone
.Return type: Note
-
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_minversion
()[source]¶ Return the value of
minversion
for thisNote
. This corresponds to theminversion
attribute of a<note>
in an Eagle file.Return type: str
-
get_severity
()[source]¶ Return the value of
severity
for thisNote
. This corresponds to theseverity
attribute of a<note>
in an Eagle file.Return type: str
-
get_version
()[source]¶ Return the value of
version
for thisNote
. This corresponds to theversion
attribute of a<note>
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_minversion
(v)[source]¶ Set the value of
minversion
for thisNote
. This corresponds to theminversion
attribute of a<note>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_severity
(v)[source]¶ Set the value of
severity
for thisNote
. This corresponds to theseverity
attribute of a<note>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_version
(v)[source]¶ Set the value of
version
for thisNote
. This corresponds to theversion
attribute of a<note>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
with_minversion
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofminversion
. For use in combination withFrom
objects.Return
self
if one of the following is true:minversion
equalsv
v
is callable andv(self.get_minversion()
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_severity
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofseverity
. For use in combination withFrom
objects.Return
self
if one of the following is true:severity
equalsv
v
is callable andv(self.get_severity()
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_text
(v)[source]¶ Filter this
EagleFilePart
object based on the value oftext
. For use in combination withFrom
objects.Return
self
if one of the following is true:text
equalsv
v
is callable andv(self.get_text()
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_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
Param¶
-
class
Swoop.
Param
[source]¶ Bases:
Swoop.Swoop.EagleFilePart
Class representing the contents of a <param> tag in Eagle files.
Attributes:
name
value
-
clone
()[source]¶ Recursively clone this
Param
. It will be identical to the original, but it’s parent will beNone
.Return type: Param
-
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_name
()[source]¶ Return the value of
name
for thisParam
. This corresponds to thename
attribute of a<param>
in an Eagle file.Return type: str
-
get_value
()[source]¶ Return the value of
value
for thisParam
. This corresponds to thevalue
attribute of a<param>
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_name
(v)[source]¶ Set the value of
name
for thisParam
. This corresponds to thename
attribute of a<param>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_value
(v)[source]¶ Set the value of
value
for thisParam
. This corresponds to thevalue
attribute of a<param>
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_value
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofvalue
. For use in combination withFrom
objects.Return
self
if one of the following is true:value
equalsv
v
is callable andv(self.get_value()
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
Setting¶
-
class
Swoop.
Setting
[source]¶ Bases:
Swoop.Swoop.EagleFilePart
Class representing the contents of a <setting> tag in Eagle files.
Attributes:
alwaysvectorfont
verticaltext
-
clone
()[source]¶ Recursively clone this
Setting
. It will be identical to the original, but it’s parent will beNone
.Return type: Setting
-
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_alwaysvectorfont
()[source]¶ Return the value of
alwaysvectorfont
for thisSetting
. This corresponds to thealwaysvectorfont
attribute of a<setting>
in an Eagle file.Return type: bool
-
get_children
()[source]¶ Get all the children of this
EagleFilePart
.Return type: List of EagleFilePart
objects
-
get_verticaltext
()[source]¶ Return the value of
verticaltext
for thisSetting
. This corresponds to theverticaltext
attribute of a<setting>
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_alwaysvectorfont
(v)[source]¶ Set the value of
alwaysvectorfont
for thisSetting
. This corresponds to thealwaysvectorfont
attribute of a<setting>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_verticaltext
(v)[source]¶ Set the value of
verticaltext
for thisSetting
. This corresponds to theverticaltext
attribute of a<setting>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
with_alwaysvectorfont
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofalwaysvectorfont
. For use in combination withFrom
objects.Return
self
if one of the following is true:alwaysvectorfont
equalsv
v
is callable andv(self.get_alwaysvectorfont()
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_verticaltext
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofverticaltext
. For use in combination withFrom
objects.Return
self
if one of the following is true:verticaltext
equalsv
v
is callable andv(self.get_verticaltext()
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
Technology¶
-
class
Swoop.
Technology
[source]¶ Bases:
Swoop.Swoop.EagleFilePart
Class representing the contents of a <technology> tag in Eagle files.
Attributes:
name
Collections:
attribute
: Map ofAttribute
objects indexed by theirname
.
-
add_attribute
(s)[source]¶ Add a
Attribute
to theattributes
of thisTechnology
.Parameters: s – The Attribute
to add.Return type: self
-
clear_attributes
()[source]¶ Remove all the
Attribute
objects from theattributes
of thisTechnology
.Return type: self
-
clone
()[source]¶ Recursively clone this
Technology
. It will be identical to the original, but it’s parent will beNone
.Return type: Technology
-
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_attribute
(key)[source]¶ Lookup and return a
Attribute
from theattributes
of thisTechnology
.Parameters: key – A str
to use for the lookup. The lookup uses thename
of theAttribute
objects.Return type: A Attribute
object orNone
, if there is no such item.
-
get_attributes
(attrs=None, type=None)[source]¶ Return (and possibly filter) items in the the
attributes
map ofAttribute
objects for thisTechnology
.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
Attribute
objectsReturn type: List of
Attribute
objects
-
get_children
()[source]¶ Get all the children of this
EagleFilePart
.Return type: List of EagleFilePart
objects
-
get_et
()[source]¶ Generate a <technology> element tree for a
Technology
.Return type: ElementTree
.
-
get_name
()[source]¶ Return the value of
name
for thisTechnology
. This corresponds to thename
attribute of a<technology>
in an Eagle file.Return type: str
-
get_nth_attribute
(n)[source]¶ get then nth
Attribute
object from theattributes
of thisTechnology
.Parameters: n – Index of the item to return. Return type: Attribute
object
-
remove_attribute
(efp)[source]¶ Remove a
Attribute
from theattributes
of thisTechnology
.Parameters: efp – The Attribute
object to remove.Return type: self
-
remove_child
(efp)[source]¶ Remove a child
EagleFilePart
object.Parameters: efp – the class:EagleFilePart object to remove. Returns: Nothing
-
set_name
(v)[source]¶ Set the value of
name
for thisTechnology
. This corresponds to thename
attribute of a<technology>
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
Variant¶
-
class
Swoop.
Variant
[source]¶ Bases:
Swoop.Swoop.EagleFilePart
Class representing the contents of a <variant> tag in Eagle files.
Attributes:
name
populate
value
technology
-
clone
()[source]¶ Recursively clone this
Variant
. It will be identical to the original, but it’s parent will beNone
.Return type: Variant
-
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_name
()[source]¶ Return the value of
name
for thisVariant
. This corresponds to thename
attribute of a<variant>
in an Eagle file.Return type: str
-
get_populate
()[source]¶ Return the value of
populate
for thisVariant
. This corresponds to thepopulate
attribute of a<variant>
in an Eagle file.Return type: bool
-
get_technology
()[source]¶ Return the value of
technology
for thisVariant
. This corresponds to thetechnology
attribute of a<variant>
in an Eagle file.Return type: str
-
get_value
()[source]¶ Return the value of
value
for thisVariant
. This corresponds to thevalue
attribute of a<variant>
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_name
(v)[source]¶ Set the value of
name
for thisVariant
. This corresponds to thename
attribute of a<variant>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_populate
(v)[source]¶ Set the value of
populate
for thisVariant
. This corresponds to thepopulate
attribute of a<variant>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_technology
(v)[source]¶ Set the value of
technology
for thisVariant
. This corresponds to thetechnology
attribute of a<variant>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_value
(v)[source]¶ Set the value of
value
for thisVariant
. This corresponds to thevalue
attribute of a<variant>
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_populate
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofpopulate
. For use in combination withFrom
objects.Return
self
if one of the following is true:populate
equalsv
v
is callable andv(self.get_populate()
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_technology
(v)[source]¶ Filter this
EagleFilePart
object based on the value oftechnology
. For use in combination withFrom
objects.Return
self
if one of the following is true:technology
equalsv
v
is callable andv(self.get_technology()
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_value
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofvalue
. For use in combination withFrom
objects.Return
self
if one of the following is true:value
equalsv
v
is callable andv(self.get_value()
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
Variantdef¶
-
class
Swoop.
Variantdef
[source]¶ Bases:
Swoop.Swoop.EagleFilePart
Class representing the contents of a <variantdef> tag in Eagle files.
Attributes:
name
current
-
clone
()[source]¶ Recursively clone this
Variantdef
. It will be identical to the original, but it’s parent will beNone
.Return type: Variantdef
-
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_current
()[source]¶ Return the value of
current
for thisVariantdef
. This corresponds to thecurrent
attribute of a<variantdef>
in an Eagle file.Return type: bool
-
get_et
()[source]¶ Generate a <variantdef> element tree for a
Variantdef
.Return type: ElementTree
.
-
get_name
()[source]¶ Return the value of
name
for thisVariantdef
. This corresponds to thename
attribute of a<variantdef>
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_current
(v)[source]¶ Set the value of
current
for thisVariantdef
. This corresponds to thecurrent
attribute of a<variantdef>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
set_name
(v)[source]¶ Set the value of
name
for thisVariantdef
. This corresponds to thename
attribute of a<variantdef>
in an Eagle file.Parameters: v – EagleFilePart
to set.Return type: self
-
with_current
(v)[source]¶ Filter this
EagleFilePart
object based on the value ofcurrent
. For use in combination withFrom
objects.Return
self
if one of the following is true:current
equalsv
v
is callable andv(self.get_current()
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