Thread Previous • Date Previous • Date Next • Thread Next |
On 2019-06-04 14:23, Andrew Lutsenko wrote:
Seth, 1. No, it's not needed. At first I didn't find Cast() in BOARD_ITEMS cpp code so thought it's implemented in descendant classes only and added the check as safeguard like it was done in DList. But now I found that Cast() is in swig python extension for BOARD_ITEM so it will always be defined. See amended patch attached. 2. Yes, it works and it was tested on py3 build. Self reference is passed implicitly in python.
Hi Andrew- Thanks for the clear details.I tested this (Linux/python3) but I'm getting the StopIteration raised rather than handled by the standard python loops. The example code I used was
import pcbnew b = pcbnew.GetBoard() d = b.GetDrawings() for dwg in d: print(dwg) m = b.GetModules() for mod in m: print(mod)Here, the modules print normally and the StopIteration is handled internally by python. The drawings pass the StopIteration back up to the UI.
-Seth
Thread Previous • Date Previous • Date Next • Thread Next |