Setting up gamepad logitech F310 on mac

So, I’m trying to run Jon’s script on one of his old posts. Setting some obvious typos aside (see the correct script below), it gives me an error because

NameError: name joystickVendorID is not defined

from ioLabs import hid
from psychopy import visual, event

win = visual.Window([800,800])
msg = visual.TextStim(win, text='nothing yet')
msg.setAutoDraw(True)

def gotNewData(newData):
    msg.setText(repr(newData))

#you need to work out what your device is
devs = hid.find_hid_devices()
for thisDev in devs:
    print thisDev.vendor, thisDev.product
    if thisDev.vendor == joystickVendorID:
        joy = thisDev

#now set calllback
joy.set_interrupt_report_callback(gotNewData)

while len(event.getKeys())==0: #press a key to quit
    win.flip()

I can’t find any reference to this name anywhere. Does anybody have any idea of how to solve this?