def update(self, init_mode=False):
        """
        Re-adds all sets in the handler to have an updated current
        set.

        Args:
            init_mode (bool, optional): Used automatically right after
                this handler was created; it imports all permanent cmdsets
                from the database.
        """
        if init_mode:
            # reimport all permanent cmdsets
            storage = self.obj.cmdset_storage
            if storage:
                self.cmdset_stack = []
                for pos, path in enumerate(storage):
                    if pos == 0 and not path:
                        self.cmdset_stack = [_EmptyCmdSet(cmdsetobj=self.obj)]
                    elif path:
                        cmdset = self._import_cmdset(path)
                        if cmdset:
                            cmdset.permanent = cmdset.key != '_CMDSET_ERROR'
                            self.cmdset_stack.append(cmdset)

        # merge the stack into a new merged cmdset
        new_current = None
        self.mergetype_stack = []
        for cmdset in self.cmdset_stack:
            try:
                # for cmdset's '+' operator, order matters.
                new_current = cmdset + new_current
            except __HOLE__:
                continue
            self.mergetype_stack.append(new_current.actual_mergetype)
        self.current = new_current
dataset/ETHPy150Open evennia/evennia/evennia/commands/cmdsethandler.py/CmdSetHandler.update