

def update(self, config):
    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):
                tree = self.keytree
                for (i, innerkey) in enumerate(key):
                    tree = self.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/VarMisuse@148/166 `tree`->`self`