mabl / PyPylon

An experimental python wrapper around the Basler Pylon 5 library
BSD 3-Clause "New" or "Revised" License
53 stars 34 forks source link

Feat/issue 20 add grab strategies #23

Open RichardLangFromNZ opened 8 years ago

RichardLangFromNZ commented 8 years ago

Seems to work as advertised. EGrabStrategy enum. values end up deeply nested pypylon.cython.factory namespace which is a bit painful... but presume that this is just a consequence of the project structure (I'm not a cython expert...) Could perhaps alias them in top level _init.py, but seems a bit ugly

RichardLangFromNZ commented 8 years ago

So this worked OK with python 2.7.12, and I'd be surprised if it wasn't good on recent 3 versions as well, however fell over on a Ubuntu 14 box running 2.7.6. Looks like cython is exporting the C++ EGrabStrategy enum. as a PEP 435 enum, which is a fairly recent python edition, but silently dropping it for earlier versions. will take another look.

RichardLangFromNZ commented 8 years ago

OK, put in place a slightly hacky workaround for earlier python versions that don't export the EGrabStrategy enum. properly.