def __call__(self, transport, line): """This command takes no arguments.""" super(Quit, self).__call__(transport, line) if line: connection.send_local('This command takes no arguments.') else: transport.write('Goodbye.\r\n') transport.loseConnection()
def eval(self, *args, **kwargs): """Execute this trigger's code.""" kwargs['trigger'] = self kwargs = dict(get_environment(), **kwargs) try: eval(self.code, dict(args = args, **kwargs)) except Exception as e: logger.exception(e) connection.send_local('Error in trigger %s: %s' % (self.title, str(e)))