Open wkruijne opened 9 years ago
Thanks for finding this out! You're right, the init
plug-in lacks a prepare phase. I'll see whether I can get to it anytime soon. Otherwise maybe @smathot could help?
Moving all the code to the prepare phase will break with the idea that, from the user's perspective, nothing happens during the prepare phase. So it's not optimal. I'll take a look at it to see if I can find a better way.
Hey Edwin -- Nice work on pygaze!
I found a small issue in the OS plugins . This minimal example, which is basically:
...causes a crash, because
pygaze_eyetracker
is not available inexp
.I think it's because since there is no
prepare
inpygaze_init
, thepygaze_eyetracker
hasn't been set yet, which is needed by the other items e.g. line 88 in pygaze_drift_correct.pyThe reason you may not have noticed this before is that if you put the items in a loop-item (as people tend to do) initialization is run before any item is prepared. (See here)
The simple solution seems to be that it needs a prepare phase that sets the variables needed. I don't really have time right now to review what parts of the init would have to go in that prepare function -- hence no pull request with a proposed fix from me :) -- but it seems like this could be an easy fix for you