Pcbnew scripting fixes
* Remove infinite recursion calls in footprint.i * Extend DRAWINGS deque iterator to auto cast contained BOARD_ITEMS, similar to what dlist implementation did.
This commit is contained in:
parent
f007d2857a
commit
3cb90063a1
|
@ -106,6 +106,21 @@ HANDLE_EXCEPTIONS(BOARD::TracksInNetBetweenPoints)
|
||||||
#include <class_board.h>
|
#include <class_board.h>
|
||||||
%}
|
%}
|
||||||
|
|
||||||
|
%extend std::deque<BOARD_ITEM *>
|
||||||
|
{
|
||||||
|
%pythoncode
|
||||||
|
%{
|
||||||
|
def __iter__(self):
|
||||||
|
it = self.iterator()
|
||||||
|
try:
|
||||||
|
while True:
|
||||||
|
item = it.next() # throws StopIteration when iterator reached the end.
|
||||||
|
yield item.Cast()
|
||||||
|
except StopIteration:
|
||||||
|
return
|
||||||
|
%}
|
||||||
|
}
|
||||||
|
|
||||||
%extend BOARD
|
%extend BOARD
|
||||||
{
|
{
|
||||||
// BOARD_ITEM_CONTAINER's interface functions will be implemented by SWIG
|
// BOARD_ITEM_CONTAINER's interface functions will be implemented by SWIG
|
||||||
|
|
|
@ -50,9 +50,6 @@
|
||||||
%pythoncode
|
%pythoncode
|
||||||
%{
|
%{
|
||||||
|
|
||||||
def Pads(self): return self.Pads()
|
|
||||||
def GraphicalItems(self): return self.GraphicalItems()
|
|
||||||
|
|
||||||
#def SaveToLibrary(self,filename):
|
#def SaveToLibrary(self,filename):
|
||||||
# return SaveModuleToLibrary(filename,self)
|
# return SaveModuleToLibrary(filename,self)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue