def command(self, cmd, *args):
        func = getattr(self.__class__, cmd, False)
        # silently ignore nonsensical calls because the logger loops over each
        # writer and passes the command separately to all of them
        if func and func.__dict__.get('_callable', False):
            try:
                return func(self, *args)
            except __HOLE__:
                # Probably the wrong number of arguments; make it
                # possible to debug the problem
                self.freetext('\nERROR: failed attempt to call'
                    ' function %s with arguments %s\n' %(cmd, repr(args)))
            except Exception, e:
                # Unknown problem; provide information so that we can
                # debug it and fix it later
                self.freetext('\nERROR: unhandled exception %s: %s'
                    ' calling function %s with arguments %s\n' %(
                    str(e.__class__), str(e), cmd, repr(args)))
dataset/ETHPy150Open sassoftware/conary/conary/lib/logger.py/LogWriter.command