build.py 文件源码

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

项目:WTFJH 作者: Naville 项目源码 文件源码
def BuildPF():
    CustomPrefList = buildlistdir("./Preferences")
    Plist = plistlib.readPlist('./BasePreferences.plist')
    #Sort Modules
    for key in ModuleDict.keys():
        ModuleDict[key].sort()
    #Start
    SortedKeys=ModuleDict.keys()
    for key in SortedKeys:
        if len(ModuleDict[key])<=0:
            continue
        Dict = {
        "cell": "PSGroupCell",
        "label": key
        }
        Plist["items"].append(Dict)
        for x in ModuleDict[key]:
            CustomPrefPath = x + ".plist"
            if (CustomPrefPath in CustomPrefList):
                custom = plistlib.readPlist('./Preferences/' + CustomPrefPath)
                Plist["items"].append(custom)
            Dict = {
                "cell": "PSSwitchCell",
                "label": x,
                "key": x,
                "default": False,
                "defaults": "naville.wtfjh"
            }
            Plist["items"].append(Dict)


    Dict = {
        "cell": "PSGroupCell",
        "footerText": "https://github.com/Naville/WTFJH"
    }
    Plist["items"].append(Dict)
    plistlib.writePlist(Plist, "./layout/Library/PreferenceLoader/Preferences/WTFJHPreferences.plist")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号