esdalmaijer / PyGaze

an open-source, cross-platform toolbox for minimal-effort programming of eye tracking experiments
www.pygaze.org
GNU General Public License v3.0
671 stars 211 forks source link

send_command() causes TypeError when used with EyeTribe eyetracker #31

Open dschreij opened 9 years ago

dschreij commented 9 years ago

When calling the exp.pygaze_eyetracker.send_command() from OpenSesame when the tracker type is EyeTribe, the program quits with the following message:

Error while executing inline script
phase: run
item: stimulus_display
line: 603
exception message: request() takes exactly 4 arguments (2 given)
exception type: TypeError

Traceback (also in debug window):
  File "C:\Users\Daniel\Documents\GitHub\OpenSesame\libopensesame\inline_script.py", line 173, in run
    self.experiment.python_workspace._exec(self.crun)
  File "C:\Users\Daniel\Documents\GitHub\OpenSesame\libopensesame\python_workspace.py", line 111, in _exec
    exec(bytecode, self._globals)
  File "<string>", line 10, in <module>
  File "C:\Python27\lib\site-packages\pygaze\_eyetracker\libeyetribe.py", line 604, in send_command
    self.eyetribe._connection.request(cmd)
TypeError: request() takes exactly 4 arguments (2 given)

OpenSesame 2.9.2 pygaze 0.5.0 pytribe #18f66d8

esdalmaijer commented 9 years ago

Hi Daniel,

Thanks for this! What command are you sending?

Cheers, Edwin

dschreij commented 9 years ago

I think this was my bad (but this bug is still valid). I actually wanted to log a message and thus should have used the .log() function, but I think this function would also have crashed when sending a real command (as the argument count seems to mismatch). In short, I was not really trying to send a command ;)

esdalmaijer commented 9 years ago

Ah, I see where it went wrong. The send_command passes a tuple/list to request, whereas this expects the unpacked contents. Woops!

Thanks for finding out!