def eval(myself, ctx): self = ctx # Ok we can declare for this trigger call our functions for (n, f) in trigger_functions.iteritems(): locals()[n] = f code = myself.code_bin # Comment? => compile(myself.code_bin, "<irc>", "exec") exec code in dict(locals())
def eval(myself, ctx): self = ctx # Ok we can declare for this trigger call our functions for (n, f) in trigger_functions.iteritems(): locals()[n] = f code = myself.code_bin # Comment? => compile(myself.code_bin, "<irc>", "exec") exec code in dict(locals())
def eval(myself, ctx): logger.debug("[trigger::%s] running following code: %s" % \ (myself.get_name(), myself.code_src)) self = ctx # Ok we can declare for this trigger call our functions for (n, f) in trigger_functions.iteritems(): locals()[n] = f code = myself.code_bin # Comment? => compile(myself.code_bin, "<irc>", "exec") exec code in dict(locals())
def eval(myself, ctx): self = ctx # Ok we can declare for this trigger call our functions for (n, f) in trigger_functions.iteritems(): locals()[n] = f code = myself.code_bin # Comment? => compile(myself.code_bin, "<irc>", "exec") try: exec code in dict(locals()) except Exception as err: set_value(self, "UNKNOWN: Trigger error: %s" % err, "", 3) logger.error('%s Trigger %s failed: %s ; %s' % (self.host_name, myself.trigger_name, err, traceback.format_exc()))
def eval(myself, ctx): self = ctx # Ok we can declare for this trigger call our functions for (n, f) in trigger_functions.iteritems(): locals()[n] = f code = myself.code_bin # Comment? => compile(myself.code_bin, "<irc>", "exec") try: exec code in dict(locals()) except Exception as err: set_value(self, "UNKNOWN: Trigger error: %s" % err, "", 3) logger.error('%s Trigger %s failed: %s ; %s' % (self.host_name, myself.trigger_name, err, traceback.format_exc()))