def __init__(self, source, record=True, when="end", order=0,
name="spikemonitor*", codeobj_class=None):
self.record = bool(record)
//: The source we are recording from
self.source =source
self.codeobj_class = codeobj_class
After Change
// Since this now works for general events not only spikes, we have to
// pass the information about which variable to use to the template,
// it can not longer simply refer to "_spikespace"
eventspace_name = "_{}space".format(event)
template_kwds = {"eventspace_variable": source.variables[eventspace_name]}
needed_variables= [eventspace_name]
CodeRunner.__init__(self, group=self, code="", template="spikemonitor",
name=name, clock=source.clock, when=when,