diff --git a/pcbnew/swig/board.i b/pcbnew/swig/board.i index ca6d7b119f..91c41cc90a 100644 --- a/pcbnew/swig/board.i +++ b/pcbnew/swig/board.i @@ -106,6 +106,21 @@ HANDLE_EXCEPTIONS(BOARD::TracksInNetBetweenPoints) #include %} +%extend std::deque +{ + %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 diff --git a/pcbnew/swig/footprint.i b/pcbnew/swig/footprint.i index 2c3108b17e..15b5214aaf 100644 --- a/pcbnew/swig/footprint.i +++ b/pcbnew/swig/footprint.i @@ -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)