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)
评论列表
文章目录