mcx.py 文件源码

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

项目:managedmacadmin 作者: cabal95 项目源码 文件源码
def build_custom_preference_profile_pref(content, pref):
    plist = plistlib.readPlistFromString(pref.plist)

    for freq in ['Once', 'Often', 'Always']:
        if len(plist[freq]) == 0:
            continue

        data = dict()
        data['mcx_preference_settings'] = plist[freq]
        if freq == 'Once':
            data['mcx_data_timestamp'] = datetime.now().strftime('%Y-%m-%dT%H:%M:%SZ')
            key = 'Set-Once'
        elif freq == 'Often':
            key = 'Set-Once'
        else:
            key = 'Forced'

        if pref.identifier not in content:
            content[pref.identifier] = { }
        if key not in content[pref.identifier]:
            content[pref.identifier][key] = [ ]

        content[pref.identifier][key].append(data)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号