favorites.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:sublime-favorites 作者: oleg-shilo 项目源码 文件源码
def get_favorite_files_data():
    """ 
        Integration with Favorit_Files plugin
        It goes only as far as reading its data file, flattening it and allowing to 
        open files on double-click on the item in the Favorites panel  
    """
    import json

    file_name = os.path.join(sublime.packages_path(), 'User', 'favorite_files_list.json')

    with open(file_name) as data_file:    
        data = json.load(data_file)

    result = []    
    for f in data["files"]:
        result.append(f)

    for name in data["groups"].keys():
        for f in data["groups"][name]:
            result.append(f)

    return result
# -------------------------
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号