'A coroutine that executes the command on the given
connection.'

def run(self, conn):

    func_name = ('cmd_' + self.name)
    if (not hasattr(conn.server, func_name)):
        raise BPDError(ERROR_UNKNOWN, u'unknown    command', self.name)
    func = getattr(conn.server, func_name)
    if (conn.server.password and (not conn.authenticated) and (self.name not in SAFE_COMMANDS)):
        raise BPDError(ERROR_PERMISSION, u'insufficient    privileges')
    try:
        args = ([conn] + self.args)
        results = func(*args)
        if results:
            for data in results:
                (yield conn.send(data))
    except BPDError as e:
        e.cmd_name = self.name
        raise e
    except BPDClose:
        raise
    except Exception as e:
        log.error('{}', traceback.format_exc(e))
        raise BPDError(ERROR_SYSTEM, u'server    error', self.name)
