'Run a function or node as a callback (with the \'exec\' option key).
Args:
nodename (callable or str): A callable to run as
`callable(caller, raw_string)`, or the Name of an existing
node to run as a callable. This may or may not return
a string.
raw_string (str): The raw default string entered on the
previous node (only used if the node accepts it as an
argument)
Returns:
new_goto (str or None): A replacement goto location string or
None (no replacement).
Notes:
Relying on exec callbacks to set the goto location is
very powerful but will easily lead to spaghetti structure and
hard-to-trace paths through the menu logic. So be careful with
relying on this.'

def callback(self, nodename, raw_string):

    if callable(nodename):
        try:
            if (len(getargspec(nodename).args) > 1):
                ret = nodename(self.caller, raw_string)
            else:
                ret = nodename(self.caller)
        except Exception:
            self.caller.msg(_ERR_GENERAL.format(nodename=nodename), self._session)
            raise
    else:
        try:
            ret = self._execute_node(nodename, raw_string)
        except EvMenuError:
            return
    if isinstance(ret, basestring):
        return ret
    return None
