def build_shortcuts_dict(path, shortcuts):
    """Build a shortcuts dictionary with script paths, names and shortcut keys."""
    #   shortcuts_dict = {
    #       u'/path/to/script.py': {
    #           'preferredName' : 'my script',
    #           'shortKey' : 'n',
    #           'modifier' : createModifier(command=True, shift=True),
    #       }
    #   }
    _shortcuts_dict = {}
    for shortcut in shortcuts:
        _key, _name, _file = shortcut
        _file_path = os.path.join(path, _file)
        if os.path.exists(_file_path):
            _shortcuts_dict[_file_path] = {}
            _shortcuts_dict[_file_path]['preferredName'] = _name
            _shortcuts_dict[_file_path]['shortKey'] = _key
            _shortcuts_dict[_file_path]['modifier'] = createModifier(command=True, shift=True)
        else:
            print '%s does not exist.' % _file_path
    return _shortcuts_dict
dataset/ETHPy150Open gferreira/hTools2/Lib/hTools2/modules/sysutils.py/build_shortcuts_dict/original