'delete the character'

def func(self):

    player = self.player
    if (not self.args):
        self.msg('Usage:    @chardelete    <charactername>')
        return
    match = [char for char in utils.make_iter(player.db._playable_characters) if (char.key.lower() == self.args.lower())]
    if (not match):
        self.msg('You    have    no    such    character    to    delete.')
        return
    elif (len(match) > 1):
        self.msg('Aborting    -    there    are    two    characters    with    the    same    name.    Ask    an    admin    to    delete    the    right    one.')
        return
    else:
        from evennia.utils.evmenu import get_input
        def _callback(caller, callback_prompt, result):
            if (result.lower() == 'yes'):
                delobj = caller.ndb._char_to_delete
                key = delobj.key
                caller.db._playable_characters = [pc for pc in caller.db._playable_characters if (pc != delobj)]
                delobj.delete()
                self.msg(("Character    '%s'    was    permanently    deleted." % key))
            else:
                self.msg('Deletion    was    aborted.')
            del caller.ndb._char_to_delete
        match = match[0]
        player.ndb._char_to_delete = match
        prompt = "|rThis    will    permanently    destroy    '%s'.    This    cannot    be    undone.|n    Continue    yes/[no]?"
        get_input(player, (prompt % match.key), _callback)
