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:
qu1ck 2019-06-03 23:49:58 -07:00 committed by Seth Hillbrand
parent f007d2857a
commit 3cb90063a1
2 changed files with 15 additions and 3 deletions

View File

@ -106,6 +106,21 @@ HANDLE_EXCEPTIONS(BOARD::TracksInNetBetweenPoints)
#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
{
// BOARD_ITEM_CONTAINER's interface functions will be implemented by SWIG

View File

@ -50,9 +50,6 @@
%pythoncode
%{
def Pads(self): return self.Pads()
def GraphicalItems(self): return self.GraphicalItems()
#def SaveToLibrary(self,filename):
# return SaveModuleToLibrary(filename,self)