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.EagleFilePartClass representing the contents of a <text> tag in Eagle files.
Attributes:
xysizelayerfontratiorotaligndistance
-
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
indenton recursive invocations.
Return type: None
-
get_align()[source]¶ Return the value of
alignfor thisText. This corresponds to thealignattribute of a<text>in an Eagle file.Return type: str
-
get_children()[source]¶ Get all the children of this
EagleFilePart.Return type: List of EagleFilePartobjects
-
get_distance()[source]¶ Return the value of
distancefor thisText. This corresponds to thedistanceattribute of a<text>in an Eagle file.Return type: int
-
get_font()[source]¶ Return the value of
fontfor thisText. This corresponds to thefontattribute of a<text>in an Eagle file.Return type: str
-
get_layer()[source]¶ Return the value of
layerfor thisText. This corresponds to thelayerattribute of a<text>in an Eagle file.Return type: layer_string
-
get_ratio()[source]¶ Return the value of
ratiofor thisText. This corresponds to theratioattribute of a<text>in an Eagle file.Return type: int
-
get_rot()[source]¶ Return the value of
rotfor thisText. This corresponds to therotattribute of a<text>in an Eagle file.Return type: str
-
get_size()[source]¶ Return the value of
sizefor thisText. This corresponds to thesizeattribute of a<text>in an Eagle file.Return type: float
-
get_x()[source]¶ Return the value of
xfor thisText. This corresponds to thexattribute of a<text>in an Eagle file.Return type: float
-
get_y()[source]¶ Return the value of
yfor thisText. This corresponds to theyattribute of a<text>in an Eagle file.Return type: float
-
remove_child(efp)[source]¶ Remove a child
EagleFilePartobject.Parameters: efp – the class:EagleFilePart object to remove. Returns: Nothing
-
set_align(v)[source]¶ Set the value of
alignfor thisText. This corresponds to thealignattribute of a<text>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_distance(v)[source]¶ Set the value of
distancefor thisText. This corresponds to thedistanceattribute of a<text>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_font(v)[source]¶ Set the value of
fontfor thisText. This corresponds to thefontattribute of a<text>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_layer(v)[source]¶ Set the value of
layerfor thisText. This corresponds to thelayerattribute of a<text>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_ratio(v)[source]¶ Set the value of
ratiofor thisText. This corresponds to theratioattribute of a<text>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_rot(v)[source]¶ Set the value of
rotfor thisText. This corresponds to therotattribute of a<text>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_size(v)[source]¶ Set the value of
sizefor thisText. This corresponds to thesizeattribute of a<text>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_x(v)[source]¶ Set the value of
xfor thisText. This corresponds to thexattribute of a<text>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_y(v)[source]¶ Set the value of
yfor thisText. This corresponds to theyattribute of a<text>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
with_align(v)[source]¶ Filter this
EagleFilePartobject based on the value ofalign. For use in combination withFromobjects.Return
selfif one of the following is true:alignequalsvvis callable andv(self.get_align()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_distance(v)[source]¶ Filter this
EagleFilePartobject based on the value ofdistance. For use in combination withFromobjects.Return
selfif one of the following is true:distanceequalsvvis callable andv(self.get_distance()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_font(v)[source]¶ Filter this
EagleFilePartobject based on the value offont. For use in combination withFromobjects.Return
selfif one of the following is true:fontequalsvvis callable andv(self.get_font()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_layer(v)[source]¶ Filter this
EagleFilePartobject based on the value oflayer. For use in combination withFromobjects.Return
selfif one of the following is true:layerequalsvvis callable andv(self.get_layer()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_ratio(v)[source]¶ Filter this
EagleFilePartobject based on the value ofratio. For use in combination withFromobjects.Return
selfif one of the following is true:ratioequalsvvis callable andv(self.get_ratio()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_rot(v)[source]¶ Filter this
EagleFilePartobject based on the value ofrot. For use in combination withFromobjects.Return
selfif one of the following is true:rotequalsvvis callable andv(self.get_rot()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_size(v)[source]¶ Filter this
EagleFilePartobject based on the value ofsize. For use in combination withFromobjects.Return
selfif one of the following is true:sizeequalsvvis callable andv(self.get_size()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_text(v)[source]¶ Filter this
EagleFilePartobject based on the value oftext. For use in combination withFromobjects.Return
selfif one of the following is true:textequalsvvis callable andv(self.get_text()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_x(v)[source]¶ Filter this
EagleFilePartobject based on the value ofx. For use in combination withFromobjects.Return
selfif one of the following is true:xequalsvvis callable andv(self.get_x()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_y(v)[source]¶ Filter this
EagleFilePartobject based on the value ofy. For use in combination withFromobjects.Return
selfif one of the following is true:yequalsvvis callable andv(self.get_y()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
Wire¶
-
class
Swoop.Wire[source]¶ Bases:
Swoop.Swoop.EagleFilePartClass representing the contents of a <wire> tag in Eagle files.
Attributes:
x1y1x2y2widthlayerextentstylecurvecap
-
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
indenton recursive invocations.
Return type: None
-
get_cap()[source]¶ Return the value of
capfor thisWire. This corresponds to thecapattribute of a<wire>in an Eagle file.Return type: str
-
get_children()[source]¶ Get all the children of this
EagleFilePart.Return type: List of EagleFilePartobjects
-
get_curve()[source]¶ Return the value of
curvefor thisWire. This corresponds to thecurveattribute of a<wire>in an Eagle file.Return type: float
-
get_extent()[source]¶ Return the value of
extentfor thisWire. This corresponds to theextentattribute of a<wire>in an Eagle file.Return type: str
-
get_layer()[source]¶ Return the value of
layerfor thisWire. This corresponds to thelayerattribute of a<wire>in an Eagle file.Return type: layer_string
-
get_style()[source]¶ Return the value of
stylefor thisWire. This corresponds to thestyleattribute of a<wire>in an Eagle file.Return type: str
-
get_width()[source]¶ Return the value of
widthfor thisWire. This corresponds to thewidthattribute of a<wire>in an Eagle file.Return type: float
-
get_x1()[source]¶ Return the value of
x1for thisWire. This corresponds to thex1attribute of a<wire>in an Eagle file.Return type: float
-
get_x2()[source]¶ Return the value of
x2for thisWire. This corresponds to thex2attribute of a<wire>in an Eagle file.Return type: float
-
get_y1()[source]¶ Return the value of
y1for thisWire. This corresponds to they1attribute of a<wire>in an Eagle file.Return type: float
-
get_y2()[source]¶ Return the value of
y2for thisWire. This corresponds to they2attribute of a<wire>in an Eagle file.Return type: float
-
remove_child(efp)[source]¶ Remove a child
EagleFilePartobject.Parameters: efp – the class:EagleFilePart object to remove. Returns: Nothing
-
set_cap(v)[source]¶ Set the value of
capfor thisWire. This corresponds to thecapattribute of a<wire>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_curve(v)[source]¶ Set the value of
curvefor thisWire. This corresponds to thecurveattribute of a<wire>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_extent(v)[source]¶ Set the value of
extentfor thisWire. This corresponds to theextentattribute of a<wire>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_layer(v)[source]¶ Set the value of
layerfor thisWire. This corresponds to thelayerattribute of a<wire>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_style(v)[source]¶ Set the value of
stylefor thisWire. This corresponds to thestyleattribute of a<wire>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_width(v)[source]¶ Set the value of
widthfor thisWire. This corresponds to thewidthattribute of a<wire>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_x1(v)[source]¶ Set the value of
x1for thisWire. This corresponds to thex1attribute of a<wire>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_x2(v)[source]¶ Set the value of
x2for thisWire. This corresponds to thex2attribute of a<wire>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_y1(v)[source]¶ Set the value of
y1for thisWire. This corresponds to they1attribute of a<wire>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_y2(v)[source]¶ Set the value of
y2for thisWire. This corresponds to they2attribute of a<wire>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
with_cap(v)[source]¶ Filter this
EagleFilePartobject based on the value ofcap. For use in combination withFromobjects.Return
selfif one of the following is true:capequalsvvis callable andv(self.get_cap()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_curve(v)[source]¶ Filter this
EagleFilePartobject based on the value ofcurve. For use in combination withFromobjects.Return
selfif one of the following is true:curveequalsvvis callable andv(self.get_curve()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_extent(v)[source]¶ Filter this
EagleFilePartobject based on the value ofextent. For use in combination withFromobjects.Return
selfif one of the following is true:extentequalsvvis callable andv(self.get_extent()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_layer(v)[source]¶ Filter this
EagleFilePartobject based on the value oflayer. For use in combination withFromobjects.Return
selfif one of the following is true:layerequalsvvis callable andv(self.get_layer()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_style(v)[source]¶ Filter this
EagleFilePartobject based on the value ofstyle. For use in combination withFromobjects.Return
selfif one of the following is true:styleequalsvvis callable andv(self.get_style()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_width(v)[source]¶ Filter this
EagleFilePartobject based on the value ofwidth. For use in combination withFromobjects.Return
selfif one of the following is true:widthequalsvvis callable andv(self.get_width()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_x1(v)[source]¶ Filter this
EagleFilePartobject based on the value ofx1. For use in combination withFromobjects.Return
selfif one of the following is true:x1equalsvvis callable andv(self.get_x1()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_x2(v)[source]¶ Filter this
EagleFilePartobject based on the value ofx2. For use in combination withFromobjects.Return
selfif one of the following is true:x2equalsvvis callable andv(self.get_x2()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_y1(v)[source]¶ Filter this
EagleFilePartobject based on the value ofy1. For use in combination withFromobjects.Return
selfif one of the following is true:y1equalsvvis callable andv(self.get_y1()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_y2(v)[source]¶ Filter this
EagleFilePartobject based on the value ofy2. For use in combination withFromobjects.Return
selfif one of the following is true:y2equalsvvis callable andv(self.get_y2()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
Polygon¶
-
class
Swoop.Polygon[source]¶ Bases:
Swoop.Swoop.EagleFilePartClass representing the contents of a <polygon> tag in Eagle files.
Attributes:
widthlayerspacingpourisolateorphansthermalsrank
Collections:
vertex: List ofVertexobjects.
-
add_vertex(s)[source]¶ Add a
Vertexto theverticesof thisPolygon.Parameters: s – The Vertexto add.Return type: self
-
clear_vertices()[source]¶ Remove all the
Vertexobjects from theverticesof 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
indenton recursive invocations.
Return type: None
-
get_children()[source]¶ Get all the children of this
EagleFilePart.Return type: List of EagleFilePartobjects
-
get_isolate()[source]¶ Return the value of
isolatefor thisPolygon. This corresponds to theisolateattribute of a<polygon>in an Eagle file.Return type: float
-
get_layer()[source]¶ Return the value of
layerfor thisPolygon. This corresponds to thelayerattribute of a<polygon>in an Eagle file.Return type: layer_string
-
get_nth_vertex(n)[source]¶ get then nth
Vertexobject from theverticesof thisPolygon.Parameters: n – Index of the item to return. Return type: Vertexobject
-
get_orphans()[source]¶ Return the value of
orphansfor thisPolygon. This corresponds to theorphansattribute of a<polygon>in an Eagle file.Return type: bool
-
get_pour()[source]¶ Return the value of
pourfor thisPolygon. This corresponds to thepourattribute of a<polygon>in an Eagle file.Return type: str
-
get_rank()[source]¶ Return the value of
rankfor thisPolygon. This corresponds to therankattribute of a<polygon>in an Eagle file.Return type: int
-
get_spacing()[source]¶ Return the value of
spacingfor thisPolygon. This corresponds to thespacingattribute of a<polygon>in an Eagle file.Return type: float
-
get_thermals()[source]¶ Return the value of
thermalsfor thisPolygon. This corresponds to thethermalsattribute 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
verticeslist ofVertexobjects for thisPolygon.This functions provides a mechanism for filtering the items as well. The keys in
attrsare taken as attributes names and the values are requested values. Items in the list that have all the requested values for the corresponding attributes will be returned.A if
typeis notNone, the item will match if it is an instance of the type provided.Parameters: - attrs – A set of key-value pairs that represent a filter to apply to the item’s attributes.
- type – A type to filter on. Only items that are an instance of this type will be returned.
Returns: A List of
VertexobjectsReturn type: List of
Vertexobjects
-
get_width()[source]¶ Return the value of
widthfor thisPolygon. This corresponds to thewidthattribute of a<polygon>in an Eagle file.Return type: float
-
remove_child(efp)[source]¶ Remove a child
EagleFilePartobject.Parameters: efp – the class:EagleFilePart object to remove. Returns: Nothing
-
remove_vertex(efp)[source]¶ Remove a
Vertexfrom theverticesof thisPolygon.Parameters: efp – The Vertexobject to remove.Return type: self
-
set_isolate(v)[source]¶ Set the value of
isolatefor thisPolygon. This corresponds to theisolateattribute of a<polygon>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_layer(v)[source]¶ Set the value of
layerfor thisPolygon. This corresponds to thelayerattribute of a<polygon>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_orphans(v)[source]¶ Set the value of
orphansfor thisPolygon. This corresponds to theorphansattribute of a<polygon>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_pour(v)[source]¶ Set the value of
pourfor thisPolygon. This corresponds to thepourattribute of a<polygon>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_rank(v)[source]¶ Set the value of
rankfor thisPolygon. This corresponds to therankattribute of a<polygon>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_spacing(v)[source]¶ Set the value of
spacingfor thisPolygon. This corresponds to thespacingattribute of a<polygon>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_thermals(v)[source]¶ Set the value of
thermalsfor thisPolygon. This corresponds to thethermalsattribute of a<polygon>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_width(v)[source]¶ Set the value of
widthfor thisPolygon. This corresponds to thewidthattribute of a<polygon>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
with_isolate(v)[source]¶ Filter this
EagleFilePartobject based on the value ofisolate. For use in combination withFromobjects.Return
selfif one of the following is true:isolateequalsvvis callable andv(self.get_isolate()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_layer(v)[source]¶ Filter this
EagleFilePartobject based on the value oflayer. For use in combination withFromobjects.Return
selfif one of the following is true:layerequalsvvis callable andv(self.get_layer()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_orphans(v)[source]¶ Filter this
EagleFilePartobject based on the value oforphans. For use in combination withFromobjects.Return
selfif one of the following is true:orphansequalsvvis callable andv(self.get_orphans()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_pour(v)[source]¶ Filter this
EagleFilePartobject based on the value ofpour. For use in combination withFromobjects.Return
selfif one of the following is true:pourequalsvvis callable andv(self.get_pour()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_rank(v)[source]¶ Filter this
EagleFilePartobject based on the value ofrank. For use in combination withFromobjects.Return
selfif one of the following is true:rankequalsvvis callable andv(self.get_rank()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_spacing(v)[source]¶ Filter this
EagleFilePartobject based on the value ofspacing. For use in combination withFromobjects.Return
selfif one of the following is true:spacingequalsvvis callable andv(self.get_spacing()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_thermals(v)[source]¶ Filter this
EagleFilePartobject based on the value ofthermals. For use in combination withFromobjects.Return
selfif one of the following is true:thermalsequalsvvis callable andv(self.get_thermals()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_width(v)[source]¶ Filter this
EagleFilePartobject based on the value ofwidth. For use in combination withFromobjects.Return
selfif one of the following is true:widthequalsvvis callable andv(self.get_width()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
Rectangle¶
-
class
Swoop.Rectangle[source]¶ Bases:
Swoop.Swoop.EagleFilePartClass representing the contents of a <rectangle> tag in Eagle files.
Attributes:
x1y1x2y2layerrot
-
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
indenton recursive invocations.
Return type: None
-
get_children()[source]¶ Get all the children of this
EagleFilePart.Return type: List of EagleFilePartobjects
-
get_layer()[source]¶ Return the value of
layerfor thisRectangle. This corresponds to thelayerattribute of a<rectangle>in an Eagle file.Return type: layer_string
-
get_rot()[source]¶ Return the value of
rotfor thisRectangle. This corresponds to therotattribute of a<rectangle>in an Eagle file.Return type: str
-
get_x1()[source]¶ Return the value of
x1for thisRectangle. This corresponds to thex1attribute of a<rectangle>in an Eagle file.Return type: float
-
get_x2()[source]¶ Return the value of
x2for thisRectangle. This corresponds to thex2attribute of a<rectangle>in an Eagle file.Return type: float
-
get_y1()[source]¶ Return the value of
y1for thisRectangle. This corresponds to they1attribute of a<rectangle>in an Eagle file.Return type: float
-
get_y2()[source]¶ Return the value of
y2for thisRectangle. This corresponds to they2attribute of a<rectangle>in an Eagle file.Return type: float
-
remove_child(efp)[source]¶ Remove a child
EagleFilePartobject.Parameters: efp – the class:EagleFilePart object to remove. Returns: Nothing
-
set_layer(v)[source]¶ Set the value of
layerfor thisRectangle. This corresponds to thelayerattribute of a<rectangle>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_rot(v)[source]¶ Set the value of
rotfor thisRectangle. This corresponds to therotattribute of a<rectangle>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_x1(v)[source]¶ Set the value of
x1for thisRectangle. This corresponds to thex1attribute of a<rectangle>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_x2(v)[source]¶ Set the value of
x2for thisRectangle. This corresponds to thex2attribute of a<rectangle>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_y1(v)[source]¶ Set the value of
y1for thisRectangle. This corresponds to they1attribute of a<rectangle>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_y2(v)[source]¶ Set the value of
y2for thisRectangle. This corresponds to they2attribute of a<rectangle>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
with_layer(v)[source]¶ Filter this
EagleFilePartobject based on the value oflayer. For use in combination withFromobjects.Return
selfif one of the following is true:layerequalsvvis callable andv(self.get_layer()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_rot(v)[source]¶ Filter this
EagleFilePartobject based on the value ofrot. For use in combination withFromobjects.Return
selfif one of the following is true:rotequalsvvis callable andv(self.get_rot()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_x1(v)[source]¶ Filter this
EagleFilePartobject based on the value ofx1. For use in combination withFromobjects.Return
selfif one of the following is true:x1equalsvvis callable andv(self.get_x1()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_x2(v)[source]¶ Filter this
EagleFilePartobject based on the value ofx2. For use in combination withFromobjects.Return
selfif one of the following is true:x2equalsvvis callable andv(self.get_x2()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_y1(v)[source]¶ Filter this
EagleFilePartobject based on the value ofy1. For use in combination withFromobjects.Return
selfif one of the following is true:y1equalsvvis callable andv(self.get_y1()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_y2(v)[source]¶ Filter this
EagleFilePartobject based on the value ofy2. For use in combination withFromobjects.Return
selfif one of the following is true:y2equalsvvis callable andv(self.get_y2()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
Vertex¶
-
class
Swoop.Vertex[source]¶ Bases:
Swoop.Swoop.EagleFilePartClass representing the contents of a <vertex> tag in Eagle files.
Attributes:
xycurve
-
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
indenton recursive invocations.
Return type: None
-
get_children()[source]¶ Get all the children of this
EagleFilePart.Return type: List of EagleFilePartobjects
-
get_curve()[source]¶ Return the value of
curvefor thisVertex. This corresponds to thecurveattribute of a<vertex>in an Eagle file.Return type: float
-
get_x()[source]¶ Return the value of
xfor thisVertex. This corresponds to thexattribute of a<vertex>in an Eagle file.Return type: float
-
get_y()[source]¶ Return the value of
yfor thisVertex. This corresponds to theyattribute of a<vertex>in an Eagle file.Return type: float
-
remove_child(efp)[source]¶ Remove a child
EagleFilePartobject.Parameters: efp – the class:EagleFilePart object to remove. Returns: Nothing
-
set_curve(v)[source]¶ Set the value of
curvefor thisVertex. This corresponds to thecurveattribute of a<vertex>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_x(v)[source]¶ Set the value of
xfor thisVertex. This corresponds to thexattribute of a<vertex>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_y(v)[source]¶ Set the value of
yfor thisVertex. This corresponds to theyattribute of a<vertex>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
with_curve(v)[source]¶ Filter this
EagleFilePartobject based on the value ofcurve. For use in combination withFromobjects.Return
selfif one of the following is true:curveequalsvvis callable andv(self.get_curve()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_x(v)[source]¶ Filter this
EagleFilePartobject based on the value ofx. For use in combination withFromobjects.Return
selfif one of the following is true:xequalsvvis callable andv(self.get_x()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_y(v)[source]¶ Filter this
EagleFilePartobject based on the value ofy. For use in combination withFromobjects.Return
selfif one of the following is true:yequalsvvis callable andv(self.get_y()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
Circle¶
-
class
Swoop.Circle[source]¶ Bases:
Swoop.Swoop.EagleFilePartClass representing the contents of a <circle> tag in Eagle files.
Attributes:
xyradiuswidthlayer
-
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
indenton recursive invocations.
Return type: None
-
get_children()[source]¶ Get all the children of this
EagleFilePart.Return type: List of EagleFilePartobjects
-
get_layer()[source]¶ Return the value of
layerfor thisCircle. This corresponds to thelayerattribute of a<circle>in an Eagle file.Return type: layer_string
-
get_radius()[source]¶ Return the value of
radiusfor thisCircle. This corresponds to theradiusattribute of a<circle>in an Eagle file.Return type: float
-
get_width()[source]¶ Return the value of
widthfor thisCircle. This corresponds to thewidthattribute of a<circle>in an Eagle file.Return type: float
-
get_x()[source]¶ Return the value of
xfor thisCircle. This corresponds to thexattribute of a<circle>in an Eagle file.Return type: float
-
get_y()[source]¶ Return the value of
yfor thisCircle. This corresponds to theyattribute of a<circle>in an Eagle file.Return type: float
-
remove_child(efp)[source]¶ Remove a child
EagleFilePartobject.Parameters: efp – the class:EagleFilePart object to remove. Returns: Nothing
-
set_layer(v)[source]¶ Set the value of
layerfor thisCircle. This corresponds to thelayerattribute of a<circle>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_radius(v)[source]¶ Set the value of
radiusfor thisCircle. This corresponds to theradiusattribute of a<circle>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_width(v)[source]¶ Set the value of
widthfor thisCircle. This corresponds to thewidthattribute of a<circle>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_x(v)[source]¶ Set the value of
xfor thisCircle. This corresponds to thexattribute of a<circle>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_y(v)[source]¶ Set the value of
yfor thisCircle. This corresponds to theyattribute of a<circle>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
with_layer(v)[source]¶ Filter this
EagleFilePartobject based on the value oflayer. For use in combination withFromobjects.Return
selfif one of the following is true:layerequalsvvis callable andv(self.get_layer()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_radius(v)[source]¶ Filter this
EagleFilePartobject based on the value ofradius. For use in combination withFromobjects.Return
selfif one of the following is true:radiusequalsvvis callable andv(self.get_radius()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_width(v)[source]¶ Filter this
EagleFilePartobject based on the value ofwidth. For use in combination withFromobjects.Return
selfif one of the following is true:widthequalsvvis callable andv(self.get_width()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_x(v)[source]¶ Filter this
EagleFilePartobject based on the value ofx. For use in combination withFromobjects.Return
selfif one of the following is true:xequalsvvis callable andv(self.get_x()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_y(v)[source]¶ Filter this
EagleFilePartobject based on the value ofy. For use in combination withFromobjects.Return
selfif one of the following is true:yequalsvvis callable andv(self.get_y()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
Class¶
-
class
Swoop.Class[source]¶ Bases:
Swoop.Swoop.EagleFilePartClass representing the contents of a <class> tag in Eagle files.
Attributes:
numbernamewidthdrill
Collections:
clearance: Map ofClearanceobjects indexed by theirnetclass.
-
add_clearance(s)[source]¶ Add a
Clearanceto theclearancesof thisClass.Parameters: s – The Clearanceto add.Return type: self
-
clear_clearances()[source]¶ Remove all the
Clearanceobjects from theclearancesof 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
indenton recursive invocations.
Return type: None
-
get_children()[source]¶ Get all the children of this
EagleFilePart.Return type: List of EagleFilePartobjects
-
get_clearance(key)[source]¶ Lookup and return a
Clearancefrom theclearancesof thisClass.Parameters: key – A strto use for the lookup. The lookup uses thenetclassof theClearanceobjects.Return type: A Clearanceobject orNone, if there is no such item.
-
get_clearances(attrs=None, type=None)[source]¶ Return (and possibly filter) items in the the
clearancesmap ofClearanceobjects for thisClass.This functions provides a mechanism for filtering the items as well. The keys in
attrsare taken as attributes names and the values are requested values. Items in the list that have all the requested values for the corresponding attributes will be returned.A if
typeis notNone, the item will match if it is an instance of the type provided.Parameters: - attrs – A set of key-value pairs that represent a filter to apply to the item’s attributes.
- type – A type to filter on. Only items that are an instance of this type will be returned.
Returns: A List of
ClearanceobjectsReturn type: List of
Clearanceobjects
-
get_drill()[source]¶ Return the value of
drillfor thisClass. This corresponds to thedrillattribute of a<class>in an Eagle file.Return type: float
-
get_name()[source]¶ Return the value of
namefor thisClass. This corresponds to thenameattribute of a<class>in an Eagle file.Return type: str
-
get_nth_clearance(n)[source]¶ get then nth
Clearanceobject from theclearancesof thisClass.Parameters: n – Index of the item to return. Return type: Clearanceobject
-
get_number()[source]¶ Return the value of
numberfor thisClass. This corresponds to thenumberattribute of a<class>in an Eagle file.Return type: str
-
get_width()[source]¶ Return the value of
widthfor thisClass. This corresponds to thewidthattribute of a<class>in an Eagle file.Return type: float
-
remove_child(efp)[source]¶ Remove a child
EagleFilePartobject.Parameters: efp – the class:EagleFilePart object to remove. Returns: Nothing
-
remove_clearance(efp)[source]¶ Remove a
Clearancefrom theclearancesof thisClass.Parameters: efp – The Clearanceobject to remove.Return type: self
-
set_drill(v)[source]¶ Set the value of
drillfor thisClass. This corresponds to thedrillattribute of a<class>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_name(v)[source]¶ Set the value of
namefor thisClass. This corresponds to thenameattribute of a<class>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_number(v)[source]¶ Set the value of
numberfor thisClass. This corresponds to thenumberattribute of a<class>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_width(v)[source]¶ Set the value of
widthfor thisClass. This corresponds to thewidthattribute of a<class>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
with_drill(v)[source]¶ Filter this
EagleFilePartobject based on the value ofdrill. For use in combination withFromobjects.Return
selfif one of the following is true:drillequalsvvis callable andv(self.get_drill()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_name(v)[source]¶ Filter this
EagleFilePartobject based on the value ofname. For use in combination withFromobjects.Return
selfif one of the following is true:nameequalsvvis callable andv(self.get_name()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_number(v)[source]¶ Filter this
EagleFilePartobject based on the value ofnumber. For use in combination withFromobjects.Return
selfif one of the following is true:numberequalsvvis callable andv(self.get_number()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_width(v)[source]¶ Filter this
EagleFilePartobject based on the value ofwidth. For use in combination withFromobjects.Return
selfif one of the following is true:widthequalsvvis callable andv(self.get_width()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
Approved¶
-
class
Swoop.Approved[source]¶ Bases:
Swoop.Swoop.EagleFilePartClass 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
indenton recursive invocations.
Return type: None
-
get_children()[source]¶ Get all the children of this
EagleFilePart.Return type: List of EagleFilePartobjects
-
get_hash()[source]¶ Return the value of
hashfor thisApproved. This corresponds to thehashattribute of a<approved>in an Eagle file.Return type: str
-
remove_child(efp)[source]¶ Remove a child
EagleFilePartobject.Parameters: efp – the class:EagleFilePart object to remove. Returns: Nothing
-
set_hash(v)[source]¶ Set the value of
hashfor thisApproved. This corresponds to thehashattribute of a<approved>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
with_hash(v)[source]¶ Filter this
EagleFilePartobject based on the value ofhash. For use in combination withFromobjects.Return
selfif one of the following is true:hashequalsvvis callable andv(self.get_hash()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
Clearance¶
-
class
Swoop.Clearance[source]¶ Bases:
Swoop.Swoop.EagleFilePartClass representing the contents of a <clearance> tag in Eagle files.
Attributes:
classvalue
-
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
indenton recursive invocations.
Return type: None
-
find_class()[source]¶ Find the
Classobject refered to by thenetclassattribute of this object. This is likeget_netclass(), except it returns theClassobject instead of its name.Returns: The object Return type: Class
-
get_children()[source]¶ Get all the children of this
EagleFilePart.Return type: List of EagleFilePartobjects
-
get_class()[source]¶ Return the value of
netclassfor thisClearance. This corresponds to thenetclassattribute of a<clearance>in an Eagle file.Return type: str
-
get_value()[source]¶ Return the value of
valuefor thisClearance. This corresponds to thevalueattribute of a<clearance>in an Eagle file.Return type: float
-
remove_child(efp)[source]¶ Remove a child
EagleFilePartobject.Parameters: efp – the class:EagleFilePart object to remove. Returns: Nothing
-
set_class(v)[source]¶ Set the value of
netclassfor thisClearance. This corresponds to thenetclassattribute of a<clearance>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_value(v)[source]¶ Set the value of
valuefor thisClearance. This corresponds to thevalueattribute of a<clearance>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
with_class(v)[source]¶ Filter this
EagleFilePartobject based on the value ofnetclass. For use in combination withFromobjects.Return
selfif one of the following is true:netclassequalsvvis callable andv(self.get_class()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_value(v)[source]¶ Filter this
EagleFilePartobject based on the value ofvalue. For use in combination withFromobjects.Return
selfif one of the following is true:valueequalsvvis callable andv(self.get_value()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
Compatibility¶
-
class
Swoop.Compatibility[source]¶ Bases:
Swoop.Swoop.EagleFilePartClass representing the contents of a <compatibility> tag in Eagle files.
Attributes:
Collections:
note: List ofNoteobjects.
-
add_note(s)[source]¶ Add a
Noteto thenotesof thisCompatibility.Parameters: s – The Noteto add.Return type: self
-
clear_notes()[source]¶ Remove all the
Noteobjects from thenotesof 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
indenton recursive invocations.
Return type: None
-
get_children()[source]¶ Get all the children of this
EagleFilePart.Return type: List of EagleFilePartobjects
-
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
noteslist ofNoteobjects for thisCompatibility.This functions provides a mechanism for filtering the items as well. The keys in
attrsare taken as attributes names and the values are requested values. Items in the list that have all the requested values for the corresponding attributes will be returned.A if
typeis notNone, the item will match if it is an instance of the type provided.Parameters: - attrs – A set of key-value pairs that represent a filter to apply to the item’s attributes.
- type – A type to filter on. Only items that are an instance of this type will be returned.
Returns: A List of
NoteobjectsReturn type: List of
Noteobjects
-
get_nth_note(n)[source]¶ get then nth
Noteobject from thenotesof thisCompatibility.Parameters: n – Index of the item to return. Return type: Noteobject
-
remove_child(efp)[source]¶ Remove a child
EagleFilePartobject.Parameters: efp – the class:EagleFilePart object to remove. Returns: Nothing
-
remove_note(efp)[source]¶ Remove a
Notefrom thenotesof thisCompatibility.Parameters: efp – The Noteobject to remove.Return type: self
Description¶
-
class
Swoop.Description[source]¶ Bases:
Swoop.Swoop.EagleFilePartClass 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
indenton recursive invocations.
Return type: None
-
get_children()[source]¶ Get all the children of this
EagleFilePart.Return type: List of EagleFilePartobjects
-
get_et()[source]¶ Generate a <description> element tree for a
Description.Return type: ElementTree.
-
get_language()[source]¶ Return the value of
languagefor thisDescription. This corresponds to thelanguageattribute of a<description>in an Eagle file.Return type: str
-
remove_child(efp)[source]¶ Remove a child
EagleFilePartobject.Parameters: efp – the class:EagleFilePart object to remove. Returns: Nothing
-
set_language(v)[source]¶ Set the value of
languagefor thisDescription. This corresponds to thelanguageattribute of a<description>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
with_language(v)[source]¶ Filter this
EagleFilePartobject based on the value oflanguage. For use in combination withFromobjects.Return
selfif one of the following is true:languageequalsvvis callable andv(self.get_language()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_text(v)[source]¶ Filter this
EagleFilePartobject based on the value oftext. For use in combination withFromobjects.Return
selfif one of the following is true:textequalsvvis callable andv(self.get_text()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
Designrules¶
-
class
Swoop.Designrules[source]¶ Bases:
Swoop.Swoop.EagleFilePartClass representing the contents of a <designrules> tag in Eagle files.
Attributes:
name
Collections:
description: List ofDescriptionobjects.param: Map ofParamobjects indexed by theirname.
-
add_description(s)[source]¶ Add a
Descriptionto thedescriptionof thisDesignrules.Parameters: s – The Descriptionto add.Return type: self
-
add_param(s)[source]¶ Add a
Paramto theparamsof thisDesignrules.Parameters: s – The Paramto add.Return type: self
-
clear_description()[source]¶ Remove all the
Descriptionobjects from thedescriptionof thisDesignrules.Return type: self
-
clear_params()[source]¶ Remove all the
Paramobjects from theparamsof 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
indenton recursive invocations.
Return type: None
-
get_children()[source]¶ Get all the children of this
EagleFilePart.Return type: List of EagleFilePartobjects
-
get_description(attrs=None, type=None)[source]¶ Return (and possibly filter) items in the the
descriptionlist ofDescriptionobjects for thisDesignrules.This functions provides a mechanism for filtering the items as well. The keys in
attrsare taken as attributes names and the values are requested values. Items in the list that have all the requested values for the corresponding attributes will be returned.A if
typeis notNone, the item will match if it is an instance of the type provided.Parameters: - attrs – A set of key-value pairs that represent a filter to apply to the item’s attributes.
- type – A type to filter on. Only items that are an instance of this type will be returned.
Returns: A List of
DescriptionobjectsReturn type: List of
Descriptionobjects
-
get_et()[source]¶ Generate a <designrules> element tree for a
Designrules.Return type: ElementTree.
-
get_name()[source]¶ Return the value of
namefor thisDesignrules. This corresponds to thenameattribute of a<designrules>in an Eagle file.Return type: str
-
get_nth_description(n)[source]¶ get then nth
Descriptionobject from thedescriptionof thisDesignrules.Parameters: n – Index of the item to return. Return type: Descriptionobject
-
get_nth_param(n)[source]¶ get then nth
Paramobject from theparamsof thisDesignrules.Parameters: n – Index of the item to return. Return type: Paramobject
-
get_param(key)[source]¶ Lookup and return a
Paramfrom theparamsof thisDesignrules.Parameters: key – A strto use for the lookup. The lookup uses thenameof theParamobjects.Return type: A Paramobject orNone, if there is no such item.
-
get_params(attrs=None, type=None)[source]¶ Return (and possibly filter) items in the the
paramsmap ofParamobjects for thisDesignrules.This functions provides a mechanism for filtering the items as well. The keys in
attrsare taken as attributes names and the values are requested values. Items in the list that have all the requested values for the corresponding attributes will be returned.A if
typeis notNone, the item will match if it is an instance of the type provided.Parameters: - attrs – A set of key-value pairs that represent a filter to apply to the item’s attributes.
- type – A type to filter on. Only items that are an instance of this type will be returned.
Returns: A List of
ParamobjectsReturn type: List of
Paramobjects
-
remove_child(efp)[source]¶ Remove a child
EagleFilePartobject.Parameters: efp – the class:EagleFilePart object to remove. Returns: Nothing
-
remove_description(efp)[source]¶ Remove a
Descriptionfrom thedescriptionof thisDesignrules.Parameters: efp – The Descriptionobject to remove.Return type: self
-
remove_param(efp)[source]¶ Remove a
Paramfrom theparamsof thisDesignrules.Parameters: efp – The Paramobject to remove.Return type: self
-
set_name(v)[source]¶ Set the value of
namefor thisDesignrules. This corresponds to thenameattribute of a<designrules>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
with_name(v)[source]¶ Filter this
EagleFilePartobject based on the value ofname. For use in combination withFromobjects.Return
selfif one of the following is true:nameequalsvvis callable andv(self.get_name()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
Dimension¶
-
class
Swoop.Dimension[source]¶ Bases:
Swoop.Swoop.EagleFilePartClass representing the contents of a <dimension> tag in Eagle files.
Attributes:
x1y1x2y2x3y3layerdtypewidthextwidthextlengthextoffsettextsizetextratiounitprecisionvisible
-
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
indenton recursive invocations.
Return type: None
-
get_children()[source]¶ Get all the children of this
EagleFilePart.Return type: List of EagleFilePartobjects
-
get_dtype()[source]¶ Return the value of
dtypefor thisDimension. This corresponds to thedtypeattribute of a<dimension>in an Eagle file.Return type: str
-
get_extlength()[source]¶ Return the value of
extlengthfor thisDimension. This corresponds to theextlengthattribute of a<dimension>in an Eagle file.Return type: float
-
get_extoffset()[source]¶ Return the value of
extoffsetfor thisDimension. This corresponds to theextoffsetattribute of a<dimension>in an Eagle file.Return type: float
-
get_extwidth()[source]¶ Return the value of
extwidthfor thisDimension. This corresponds to theextwidthattribute of a<dimension>in an Eagle file.Return type: float
-
get_layer()[source]¶ Return the value of
layerfor thisDimension. This corresponds to thelayerattribute of a<dimension>in an Eagle file.Return type: layer_string
-
get_precision()[source]¶ Return the value of
precisionfor thisDimension. This corresponds to theprecisionattribute of a<dimension>in an Eagle file.Return type: int
-
get_textratio()[source]¶ Return the value of
textratiofor thisDimension. This corresponds to thetextratioattribute of a<dimension>in an Eagle file.Return type: int
-
get_textsize()[source]¶ Return the value of
textsizefor thisDimension. This corresponds to thetextsizeattribute of a<dimension>in an Eagle file.Return type: float
-
get_unit()[source]¶ Return the value of
unitfor thisDimension. This corresponds to theunitattribute of a<dimension>in an Eagle file.Return type: str
-
get_visible()[source]¶ Return the value of
visiblefor thisDimension. This corresponds to thevisibleattribute of a<dimension>in an Eagle file.Return type: bool
-
get_width()[source]¶ Return the value of
widthfor thisDimension. This corresponds to thewidthattribute of a<dimension>in an Eagle file.Return type: float
-
get_x1()[source]¶ Return the value of
x1for thisDimension. This corresponds to thex1attribute of a<dimension>in an Eagle file.Return type: float
-
get_x2()[source]¶ Return the value of
x2for thisDimension. This corresponds to thex2attribute of a<dimension>in an Eagle file.Return type: float
-
get_x3()[source]¶ Return the value of
x3for thisDimension. This corresponds to thex3attribute of a<dimension>in an Eagle file.Return type: float
-
get_y1()[source]¶ Return the value of
y1for thisDimension. This corresponds to they1attribute of a<dimension>in an Eagle file.Return type: float
-
get_y2()[source]¶ Return the value of
y2for thisDimension. This corresponds to they2attribute of a<dimension>in an Eagle file.Return type: float
-
get_y3()[source]¶ Return the value of
y3for thisDimension. This corresponds to they3attribute of a<dimension>in an Eagle file.Return type: float
-
remove_child(efp)[source]¶ Remove a child
EagleFilePartobject.Parameters: efp – the class:EagleFilePart object to remove. Returns: Nothing
-
set_dtype(v)[source]¶ Set the value of
dtypefor thisDimension. This corresponds to thedtypeattribute of a<dimension>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_extlength(v)[source]¶ Set the value of
extlengthfor thisDimension. This corresponds to theextlengthattribute of a<dimension>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_extoffset(v)[source]¶ Set the value of
extoffsetfor thisDimension. This corresponds to theextoffsetattribute of a<dimension>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_extwidth(v)[source]¶ Set the value of
extwidthfor thisDimension. This corresponds to theextwidthattribute of a<dimension>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_layer(v)[source]¶ Set the value of
layerfor thisDimension. This corresponds to thelayerattribute of a<dimension>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_precision(v)[source]¶ Set the value of
precisionfor thisDimension. This corresponds to theprecisionattribute of a<dimension>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_textratio(v)[source]¶ Set the value of
textratiofor thisDimension. This corresponds to thetextratioattribute of a<dimension>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_textsize(v)[source]¶ Set the value of
textsizefor thisDimension. This corresponds to thetextsizeattribute of a<dimension>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_unit(v)[source]¶ Set the value of
unitfor thisDimension. This corresponds to theunitattribute of a<dimension>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_visible(v)[source]¶ Set the value of
visiblefor thisDimension. This corresponds to thevisibleattribute of a<dimension>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_width(v)[source]¶ Set the value of
widthfor thisDimension. This corresponds to thewidthattribute of a<dimension>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_x1(v)[source]¶ Set the value of
x1for thisDimension. This corresponds to thex1attribute of a<dimension>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_x2(v)[source]¶ Set the value of
x2for thisDimension. This corresponds to thex2attribute of a<dimension>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_x3(v)[source]¶ Set the value of
x3for thisDimension. This corresponds to thex3attribute of a<dimension>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_y1(v)[source]¶ Set the value of
y1for thisDimension. This corresponds to they1attribute of a<dimension>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_y2(v)[source]¶ Set the value of
y2for thisDimension. This corresponds to they2attribute of a<dimension>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_y3(v)[source]¶ Set the value of
y3for thisDimension. This corresponds to they3attribute of a<dimension>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
with_dtype(v)[source]¶ Filter this
EagleFilePartobject based on the value ofdtype. For use in combination withFromobjects.Return
selfif one of the following is true:dtypeequalsvvis callable andv(self.get_dtype()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_extlength(v)[source]¶ Filter this
EagleFilePartobject based on the value ofextlength. For use in combination withFromobjects.Return
selfif one of the following is true:extlengthequalsvvis callable andv(self.get_extlength()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_extoffset(v)[source]¶ Filter this
EagleFilePartobject based on the value ofextoffset. For use in combination withFromobjects.Return
selfif one of the following is true:extoffsetequalsvvis callable andv(self.get_extoffset()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_extwidth(v)[source]¶ Filter this
EagleFilePartobject based on the value ofextwidth. For use in combination withFromobjects.Return
selfif one of the following is true:extwidthequalsvvis callable andv(self.get_extwidth()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_layer(v)[source]¶ Filter this
EagleFilePartobject based on the value oflayer. For use in combination withFromobjects.Return
selfif one of the following is true:layerequalsvvis callable andv(self.get_layer()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_precision(v)[source]¶ Filter this
EagleFilePartobject based on the value ofprecision. For use in combination withFromobjects.Return
selfif one of the following is true:precisionequalsvvis callable andv(self.get_precision()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_textratio(v)[source]¶ Filter this
EagleFilePartobject based on the value oftextratio. For use in combination withFromobjects.Return
selfif one of the following is true:textratioequalsvvis callable andv(self.get_textratio()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_textsize(v)[source]¶ Filter this
EagleFilePartobject based on the value oftextsize. For use in combination withFromobjects.Return
selfif one of the following is true:textsizeequalsvvis callable andv(self.get_textsize()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_unit(v)[source]¶ Filter this
EagleFilePartobject based on the value ofunit. For use in combination withFromobjects.Return
selfif one of the following is true:unitequalsvvis callable andv(self.get_unit()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_visible(v)[source]¶ Filter this
EagleFilePartobject based on the value ofvisible. For use in combination withFromobjects.Return
selfif one of the following is true:visibleequalsvvis callable andv(self.get_visible()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_width(v)[source]¶ Filter this
EagleFilePartobject based on the value ofwidth. For use in combination withFromobjects.Return
selfif one of the following is true:widthequalsvvis callable andv(self.get_width()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_x1(v)[source]¶ Filter this
EagleFilePartobject based on the value ofx1. For use in combination withFromobjects.Return
selfif one of the following is true:x1equalsvvis callable andv(self.get_x1()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_x2(v)[source]¶ Filter this
EagleFilePartobject based on the value ofx2. For use in combination withFromobjects.Return
selfif one of the following is true:x2equalsvvis callable andv(self.get_x2()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_x3(v)[source]¶ Filter this
EagleFilePartobject based on the value ofx3. For use in combination withFromobjects.Return
selfif one of the following is true:x3equalsvvis callable andv(self.get_x3()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_y1(v)[source]¶ Filter this
EagleFilePartobject based on the value ofy1. For use in combination withFromobjects.Return
selfif one of the following is true:y1equalsvvis callable andv(self.get_y1()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_y2(v)[source]¶ Filter this
EagleFilePartobject based on the value ofy2. For use in combination withFromobjects.Return
selfif one of the following is true:y2equalsvvis callable andv(self.get_y2()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_y3(v)[source]¶ Filter this
EagleFilePartobject based on the value ofy3. For use in combination withFromobjects.Return
selfif one of the following is true:y3equalsvvis callable andv(self.get_y3()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
Grid¶
-
class
Swoop.Grid[source]¶ Bases:
Swoop.Swoop.EagleFilePartClass representing the contents of a <grid> tag in Eagle files.
Attributes:
distanceunitdistunitstylemultipledisplayaltdistancealtunitdistaltunit
-
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
indenton recursive invocations.
Return type: None
-
get_altdistance()[source]¶ Return the value of
altdistancefor thisGrid. This corresponds to thealtdistanceattribute of a<grid>in an Eagle file.Return type: float
-
get_altunit()[source]¶ Return the value of
altunitfor thisGrid. This corresponds to thealtunitattribute of a<grid>in an Eagle file.Return type: str
-
get_altunitdist()[source]¶ Return the value of
altunitdistfor thisGrid. This corresponds to thealtunitdistattribute of a<grid>in an Eagle file.Return type: str
-
get_children()[source]¶ Get all the children of this
EagleFilePart.Return type: List of EagleFilePartobjects
-
get_display()[source]¶ Return the value of
displayfor thisGrid. This corresponds to thedisplayattribute of a<grid>in an Eagle file.Return type: bool
-
get_distance()[source]¶ Return the value of
distancefor thisGrid. This corresponds to thedistanceattribute of a<grid>in an Eagle file.Return type: float
-
get_multiple()[source]¶ Return the value of
multiplefor thisGrid. This corresponds to themultipleattribute of a<grid>in an Eagle file.Return type: int
-
get_style()[source]¶ Return the value of
stylefor thisGrid. This corresponds to thestyleattribute of a<grid>in an Eagle file.Return type: str
-
get_unit()[source]¶ Return the value of
unitfor thisGrid. This corresponds to theunitattribute of a<grid>in an Eagle file.Return type: str
-
get_unitdist()[source]¶ Return the value of
unitdistfor thisGrid. This corresponds to theunitdistattribute of a<grid>in an Eagle file.Return type: str
-
remove_child(efp)[source]¶ Remove a child
EagleFilePartobject.Parameters: efp – the class:EagleFilePart object to remove. Returns: Nothing
-
set_altdistance(v)[source]¶ Set the value of
altdistancefor thisGrid. This corresponds to thealtdistanceattribute of a<grid>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_altunit(v)[source]¶ Set the value of
altunitfor thisGrid. This corresponds to thealtunitattribute of a<grid>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_altunitdist(v)[source]¶ Set the value of
altunitdistfor thisGrid. This corresponds to thealtunitdistattribute of a<grid>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_display(v)[source]¶ Set the value of
displayfor thisGrid. This corresponds to thedisplayattribute of a<grid>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_distance(v)[source]¶ Set the value of
distancefor thisGrid. This corresponds to thedistanceattribute of a<grid>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_multiple(v)[source]¶ Set the value of
multiplefor thisGrid. This corresponds to themultipleattribute of a<grid>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_style(v)[source]¶ Set the value of
stylefor thisGrid. This corresponds to thestyleattribute of a<grid>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_unit(v)[source]¶ Set the value of
unitfor thisGrid. This corresponds to theunitattribute of a<grid>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_unitdist(v)[source]¶ Set the value of
unitdistfor thisGrid. This corresponds to theunitdistattribute of a<grid>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
with_altdistance(v)[source]¶ Filter this
EagleFilePartobject based on the value ofaltdistance. For use in combination withFromobjects.Return
selfif one of the following is true:altdistanceequalsvvis callable andv(self.get_altdistance()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_altunit(v)[source]¶ Filter this
EagleFilePartobject based on the value ofaltunit. For use in combination withFromobjects.Return
selfif one of the following is true:altunitequalsvvis callable andv(self.get_altunit()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_altunitdist(v)[source]¶ Filter this
EagleFilePartobject based on the value ofaltunitdist. For use in combination withFromobjects.Return
selfif one of the following is true:altunitdistequalsvvis callable andv(self.get_altunitdist()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_display(v)[source]¶ Filter this
EagleFilePartobject based on the value ofdisplay. For use in combination withFromobjects.Return
selfif one of the following is true:displayequalsvvis callable andv(self.get_display()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_distance(v)[source]¶ Filter this
EagleFilePartobject based on the value ofdistance. For use in combination withFromobjects.Return
selfif one of the following is true:distanceequalsvvis callable andv(self.get_distance()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_multiple(v)[source]¶ Filter this
EagleFilePartobject based on the value ofmultiple. For use in combination withFromobjects.Return
selfif one of the following is true:multipleequalsvvis callable andv(self.get_multiple()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_style(v)[source]¶ Filter this
EagleFilePartobject based on the value ofstyle. For use in combination withFromobjects.Return
selfif one of the following is true:styleequalsvvis callable andv(self.get_style()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_unit(v)[source]¶ Filter this
EagleFilePartobject based on the value ofunit. For use in combination withFromobjects.Return
selfif one of the following is true:unitequalsvvis callable andv(self.get_unit()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_unitdist(v)[source]¶ Filter this
EagleFilePartobject based on the value ofunitdist. For use in combination withFromobjects.Return
selfif one of the following is true:unitdistequalsvvis callable andv(self.get_unitdist()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
Hole¶
-
class
Swoop.Hole[source]¶ Bases:
Swoop.Swoop.EagleFilePartClass representing the contents of a <hole> tag in Eagle files.
Attributes:
xydrill
-
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
indenton recursive invocations.
Return type: None
-
get_children()[source]¶ Get all the children of this
EagleFilePart.Return type: List of EagleFilePartobjects
-
get_drill()[source]¶ Return the value of
drillfor thisHole. This corresponds to thedrillattribute of a<hole>in an Eagle file.Return type: float
-
get_x()[source]¶ Return the value of
xfor thisHole. This corresponds to thexattribute of a<hole>in an Eagle file.Return type: float
-
get_y()[source]¶ Return the value of
yfor thisHole. This corresponds to theyattribute of a<hole>in an Eagle file.Return type: float
-
remove_child(efp)[source]¶ Remove a child
EagleFilePartobject.Parameters: efp – the class:EagleFilePart object to remove. Returns: Nothing
-
set_drill(v)[source]¶ Set the value of
drillfor thisHole. This corresponds to thedrillattribute of a<hole>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_x(v)[source]¶ Set the value of
xfor thisHole. This corresponds to thexattribute of a<hole>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_y(v)[source]¶ Set the value of
yfor thisHole. This corresponds to theyattribute of a<hole>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
with_drill(v)[source]¶ Filter this
EagleFilePartobject based on the value ofdrill. For use in combination withFromobjects.Return
selfif one of the following is true:drillequalsvvis callable andv(self.get_drill()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_x(v)[source]¶ Filter this
EagleFilePartobject based on the value ofx. For use in combination withFromobjects.Return
selfif one of the following is true:xequalsvvis callable andv(self.get_x()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_y(v)[source]¶ Filter this
EagleFilePartobject based on the value ofy. For use in combination withFromobjects.Return
selfif one of the following is true:yequalsvvis callable andv(self.get_y()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
Label¶
-
class
Swoop.Label[source]¶ Bases:
Swoop.Swoop.EagleFilePartClass representing the contents of a <label> tag in Eagle files.
Attributes:
xysizelayerfontratiorotxref
-
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
indenton recursive invocations.
Return type: None
-
get_children()[source]¶ Get all the children of this
EagleFilePart.Return type: List of EagleFilePartobjects
-
get_font()[source]¶ Return the value of
fontfor thisLabel. This corresponds to thefontattribute of a<label>in an Eagle file.Return type: str
-
get_layer()[source]¶ Return the value of
layerfor thisLabel. This corresponds to thelayerattribute of a<label>in an Eagle file.Return type: layer_string
-
get_ratio()[source]¶ Return the value of
ratiofor thisLabel. This corresponds to theratioattribute of a<label>in an Eagle file.Return type: int
-
get_rot()[source]¶ Return the value of
rotfor thisLabel. This corresponds to therotattribute of a<label>in an Eagle file.Return type: str
-
get_size()[source]¶ Return the value of
sizefor thisLabel. This corresponds to thesizeattribute of a<label>in an Eagle file.Return type: float
-
get_x()[source]¶ Return the value of
xfor thisLabel. This corresponds to thexattribute of a<label>in an Eagle file.Return type: float
-
get_xref()[source]¶ Return the value of
xreffor thisLabel. This corresponds to thexrefattribute of a<label>in an Eagle file.Return type: bool
-
get_y()[source]¶ Return the value of
yfor thisLabel. This corresponds to theyattribute of a<label>in an Eagle file.Return type: float
-
remove_child(efp)[source]¶ Remove a child
EagleFilePartobject.Parameters: efp – the class:EagleFilePart object to remove. Returns: Nothing
-
set_font(v)[source]¶ Set the value of
fontfor thisLabel. This corresponds to thefontattribute of a<label>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_layer(v)[source]¶ Set the value of
layerfor thisLabel. This corresponds to thelayerattribute of a<label>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_ratio(v)[source]¶ Set the value of
ratiofor thisLabel. This corresponds to theratioattribute of a<label>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_rot(v)[source]¶ Set the value of
rotfor thisLabel. This corresponds to therotattribute of a<label>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_size(v)[source]¶ Set the value of
sizefor thisLabel. This corresponds to thesizeattribute of a<label>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_x(v)[source]¶ Set the value of
xfor thisLabel. This corresponds to thexattribute of a<label>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_xref(v)[source]¶ Set the value of
xreffor thisLabel. This corresponds to thexrefattribute of a<label>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_y(v)[source]¶ Set the value of
yfor thisLabel. This corresponds to theyattribute of a<label>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
with_font(v)[source]¶ Filter this
EagleFilePartobject based on the value offont. For use in combination withFromobjects.Return
selfif one of the following is true:fontequalsvvis callable andv(self.get_font()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_layer(v)[source]¶ Filter this
EagleFilePartobject based on the value oflayer. For use in combination withFromobjects.Return
selfif one of the following is true:layerequalsvvis callable andv(self.get_layer()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_ratio(v)[source]¶ Filter this
EagleFilePartobject based on the value ofratio. For use in combination withFromobjects.Return
selfif one of the following is true:ratioequalsvvis callable andv(self.get_ratio()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_rot(v)[source]¶ Filter this
EagleFilePartobject based on the value ofrot. For use in combination withFromobjects.Return
selfif one of the following is true:rotequalsvvis callable andv(self.get_rot()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_size(v)[source]¶ Filter this
EagleFilePartobject based on the value ofsize. For use in combination withFromobjects.Return
selfif one of the following is true:sizeequalsvvis callable andv(self.get_size()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_x(v)[source]¶ Filter this
EagleFilePartobject based on the value ofx. For use in combination withFromobjects.Return
selfif one of the following is true:xequalsvvis callable andv(self.get_x()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_xref(v)[source]¶ Filter this
EagleFilePartobject based on the value ofxref. For use in combination withFromobjects.Return
selfif one of the following is true:xrefequalsvvis callable andv(self.get_xref()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_y(v)[source]¶ Filter this
EagleFilePartobject based on the value ofy. For use in combination withFromobjects.Return
selfif one of the following is true:yequalsvvis callable andv(self.get_y()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
Note¶
-
class
Swoop.Note[source]¶ Bases:
Swoop.Swoop.EagleFilePartClass representing the contents of a <note> tag in Eagle files.
Attributes:
minversionversionseverity
-
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
indenton recursive invocations.
Return type: None
-
get_children()[source]¶ Get all the children of this
EagleFilePart.Return type: List of EagleFilePartobjects
-
get_minversion()[source]¶ Return the value of
minversionfor thisNote. This corresponds to theminversionattribute of a<note>in an Eagle file.Return type: str
-
get_severity()[source]¶ Return the value of
severityfor thisNote. This corresponds to theseverityattribute of a<note>in an Eagle file.Return type: str
-
get_version()[source]¶ Return the value of
versionfor thisNote. This corresponds to theversionattribute of a<note>in an Eagle file.Return type: str
-
remove_child(efp)[source]¶ Remove a child
EagleFilePartobject.Parameters: efp – the class:EagleFilePart object to remove. Returns: Nothing
-
set_minversion(v)[source]¶ Set the value of
minversionfor thisNote. This corresponds to theminversionattribute of a<note>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_severity(v)[source]¶ Set the value of
severityfor thisNote. This corresponds to theseverityattribute of a<note>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_version(v)[source]¶ Set the value of
versionfor thisNote. This corresponds to theversionattribute of a<note>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
with_minversion(v)[source]¶ Filter this
EagleFilePartobject based on the value ofminversion. For use in combination withFromobjects.Return
selfif one of the following is true:minversionequalsvvis callable andv(self.get_minversion()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_severity(v)[source]¶ Filter this
EagleFilePartobject based on the value ofseverity. For use in combination withFromobjects.Return
selfif one of the following is true:severityequalsvvis callable andv(self.get_severity()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_text(v)[source]¶ Filter this
EagleFilePartobject based on the value oftext. For use in combination withFromobjects.Return
selfif one of the following is true:textequalsvvis callable andv(self.get_text()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_version(v)[source]¶ Filter this
EagleFilePartobject based on the value ofversion. For use in combination withFromobjects.Return
selfif one of the following is true:versionequalsvvis callable andv(self.get_version()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
Param¶
-
class
Swoop.Param[source]¶ Bases:
Swoop.Swoop.EagleFilePartClass representing the contents of a <param> tag in Eagle files.
Attributes:
namevalue
-
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
indenton recursive invocations.
Return type: None
-
get_children()[source]¶ Get all the children of this
EagleFilePart.Return type: List of EagleFilePartobjects
-
get_name()[source]¶ Return the value of
namefor thisParam. This corresponds to thenameattribute of a<param>in an Eagle file.Return type: str
-
get_value()[source]¶ Return the value of
valuefor thisParam. This corresponds to thevalueattribute of a<param>in an Eagle file.Return type: str
-
remove_child(efp)[source]¶ Remove a child
EagleFilePartobject.Parameters: efp – the class:EagleFilePart object to remove. Returns: Nothing
-
set_name(v)[source]¶ Set the value of
namefor thisParam. This corresponds to thenameattribute of a<param>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_value(v)[source]¶ Set the value of
valuefor thisParam. This corresponds to thevalueattribute of a<param>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
with_name(v)[source]¶ Filter this
EagleFilePartobject based on the value ofname. For use in combination withFromobjects.Return
selfif one of the following is true:nameequalsvvis callable andv(self.get_name()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_value(v)[source]¶ Filter this
EagleFilePartobject based on the value ofvalue. For use in combination withFromobjects.Return
selfif one of the following is true:valueequalsvvis callable andv(self.get_value()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
Setting¶
-
class
Swoop.Setting[source]¶ Bases:
Swoop.Swoop.EagleFilePartClass representing the contents of a <setting> tag in Eagle files.
Attributes:
alwaysvectorfontverticaltext
-
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
indenton recursive invocations.
Return type: None
-
get_alwaysvectorfont()[source]¶ Return the value of
alwaysvectorfontfor thisSetting. This corresponds to thealwaysvectorfontattribute of a<setting>in an Eagle file.Return type: bool
-
get_children()[source]¶ Get all the children of this
EagleFilePart.Return type: List of EagleFilePartobjects
-
get_verticaltext()[source]¶ Return the value of
verticaltextfor thisSetting. This corresponds to theverticaltextattribute of a<setting>in an Eagle file.Return type: str
-
remove_child(efp)[source]¶ Remove a child
EagleFilePartobject.Parameters: efp – the class:EagleFilePart object to remove. Returns: Nothing
-
set_alwaysvectorfont(v)[source]¶ Set the value of
alwaysvectorfontfor thisSetting. This corresponds to thealwaysvectorfontattribute of a<setting>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_verticaltext(v)[source]¶ Set the value of
verticaltextfor thisSetting. This corresponds to theverticaltextattribute of a<setting>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
with_alwaysvectorfont(v)[source]¶ Filter this
EagleFilePartobject based on the value ofalwaysvectorfont. For use in combination withFromobjects.Return
selfif one of the following is true:alwaysvectorfontequalsvvis callable andv(self.get_alwaysvectorfont()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_verticaltext(v)[source]¶ Filter this
EagleFilePartobject based on the value ofverticaltext. For use in combination withFromobjects.Return
selfif one of the following is true:verticaltextequalsvvis callable andv(self.get_verticaltext()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
Technology¶
-
class
Swoop.Technology[source]¶ Bases:
Swoop.Swoop.EagleFilePartClass representing the contents of a <technology> tag in Eagle files.
Attributes:
name
Collections:
attribute: Map ofAttributeobjects indexed by theirname.
-
add_attribute(s)[source]¶ Add a
Attributeto theattributesof thisTechnology.Parameters: s – The Attributeto add.Return type: self
-
clear_attributes()[source]¶ Remove all the
Attributeobjects from theattributesof 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
indenton recursive invocations.
Return type: None
-
get_attribute(key)[source]¶ Lookup and return a
Attributefrom theattributesof thisTechnology.Parameters: key – A strto use for the lookup. The lookup uses thenameof theAttributeobjects.Return type: A Attributeobject orNone, if there is no such item.
-
get_attributes(attrs=None, type=None)[source]¶ Return (and possibly filter) items in the the
attributesmap ofAttributeobjects for thisTechnology.This functions provides a mechanism for filtering the items as well. The keys in
attrsare taken as attributes names and the values are requested values. Items in the list that have all the requested values for the corresponding attributes will be returned.A if
typeis notNone, the item will match if it is an instance of the type provided.Parameters: - attrs – A set of key-value pairs that represent a filter to apply to the item’s attributes.
- type – A type to filter on. Only items that are an instance of this type will be returned.
Returns: A List of
AttributeobjectsReturn type: List of
Attributeobjects
-
get_children()[source]¶ Get all the children of this
EagleFilePart.Return type: List of EagleFilePartobjects
-
get_et()[source]¶ Generate a <technology> element tree for a
Technology.Return type: ElementTree.
-
get_name()[source]¶ Return the value of
namefor thisTechnology. This corresponds to thenameattribute of a<technology>in an Eagle file.Return type: str
-
get_nth_attribute(n)[source]¶ get then nth
Attributeobject from theattributesof thisTechnology.Parameters: n – Index of the item to return. Return type: Attributeobject
-
remove_attribute(efp)[source]¶ Remove a
Attributefrom theattributesof thisTechnology.Parameters: efp – The Attributeobject to remove.Return type: self
-
remove_child(efp)[source]¶ Remove a child
EagleFilePartobject.Parameters: efp – the class:EagleFilePart object to remove. Returns: Nothing
-
set_name(v)[source]¶ Set the value of
namefor thisTechnology. This corresponds to thenameattribute of a<technology>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
with_name(v)[source]¶ Filter this
EagleFilePartobject based on the value ofname. For use in combination withFromobjects.Return
selfif one of the following is true:nameequalsvvis callable andv(self.get_name()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
Variant¶
-
class
Swoop.Variant[source]¶ Bases:
Swoop.Swoop.EagleFilePartClass representing the contents of a <variant> tag in Eagle files.
Attributes:
namepopulatevaluetechnology
-
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
indenton recursive invocations.
Return type: None
-
get_children()[source]¶ Get all the children of this
EagleFilePart.Return type: List of EagleFilePartobjects
-
get_name()[source]¶ Return the value of
namefor thisVariant. This corresponds to thenameattribute of a<variant>in an Eagle file.Return type: str
-
get_populate()[source]¶ Return the value of
populatefor thisVariant. This corresponds to thepopulateattribute of a<variant>in an Eagle file.Return type: bool
-
get_technology()[source]¶ Return the value of
technologyfor thisVariant. This corresponds to thetechnologyattribute of a<variant>in an Eagle file.Return type: str
-
get_value()[source]¶ Return the value of
valuefor thisVariant. This corresponds to thevalueattribute of a<variant>in an Eagle file.Return type: str
-
remove_child(efp)[source]¶ Remove a child
EagleFilePartobject.Parameters: efp – the class:EagleFilePart object to remove. Returns: Nothing
-
set_name(v)[source]¶ Set the value of
namefor thisVariant. This corresponds to thenameattribute of a<variant>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_populate(v)[source]¶ Set the value of
populatefor thisVariant. This corresponds to thepopulateattribute of a<variant>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_technology(v)[source]¶ Set the value of
technologyfor thisVariant. This corresponds to thetechnologyattribute of a<variant>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_value(v)[source]¶ Set the value of
valuefor thisVariant. This corresponds to thevalueattribute of a<variant>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
with_name(v)[source]¶ Filter this
EagleFilePartobject based on the value ofname. For use in combination withFromobjects.Return
selfif one of the following is true:nameequalsvvis callable andv(self.get_name()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_populate(v)[source]¶ Filter this
EagleFilePartobject based on the value ofpopulate. For use in combination withFromobjects.Return
selfif one of the following is true:populateequalsvvis callable andv(self.get_populate()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_technology(v)[source]¶ Filter this
EagleFilePartobject based on the value oftechnology. For use in combination withFromobjects.Return
selfif one of the following is true:technologyequalsvvis callable andv(self.get_technology()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_value(v)[source]¶ Filter this
EagleFilePartobject based on the value ofvalue. For use in combination withFromobjects.Return
selfif one of the following is true:valueequalsvvis callable andv(self.get_value()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
Variantdef¶
-
class
Swoop.Variantdef[source]¶ Bases:
Swoop.Swoop.EagleFilePartClass representing the contents of a <variantdef> tag in Eagle files.
Attributes:
namecurrent
-
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
indenton recursive invocations.
Return type: None
-
get_children()[source]¶ Get all the children of this
EagleFilePart.Return type: List of EagleFilePartobjects
-
get_current()[source]¶ Return the value of
currentfor thisVariantdef. This corresponds to thecurrentattribute 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
namefor thisVariantdef. This corresponds to thenameattribute of a<variantdef>in an Eagle file.Return type: str
-
remove_child(efp)[source]¶ Remove a child
EagleFilePartobject.Parameters: efp – the class:EagleFilePart object to remove. Returns: Nothing
-
set_current(v)[source]¶ Set the value of
currentfor thisVariantdef. This corresponds to thecurrentattribute of a<variantdef>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
set_name(v)[source]¶ Set the value of
namefor thisVariantdef. This corresponds to thenameattribute of a<variantdef>in an Eagle file.Parameters: v – EagleFilePartto set.Return type: self
-
with_current(v)[source]¶ Filter this
EagleFilePartobject based on the value ofcurrent. For use in combination withFromobjects.Return
selfif one of the following is true:currentequalsvvis callable andv(self.get_current()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone
-
with_name(v)[source]¶ Filter this
EagleFilePartobject based on the value ofname. For use in combination withFromobjects.Return
selfif one of the following is true:nameequalsvvis callable andv(self.get_name()isTrue
This is useful in combination with
Fromobject.Parameters: t – The value to check for or a callable object. Returns: selfif the criteria above are met andNoneotherwise.Return type: EagelFilePartorNone