def update(self, config):
        # command -> [keys]
        for command, keys in config.items():
            if command == 'name':
                continue
            command = command.replace('-', ' ')
            if type(keys) != type([]):
                keys = [keys]
            self.commandmap[command] = keys
        self.keytree = Key(None)
        for command, keys in self.commandmap.items():
            for key in keys:
                if isinstance(key, list):
                    # This is a command series
                    tree = self.keytree
                    for i, innerkey in enumerate(key):
                        tree = tree.addKey(innerkey)
                        if i+1 == len(key):
                            tree.commands.append(command)
                else:
                    tree = self.keytree.addKey(key)
                    tree.commands.append(command)
dataset/ETHPy150Open openstack/gertty/gertty/keymap.py/KeyMap.update/original