Skip to content
This repository was archived by the owner on Jan 24, 2018. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions otrapps/adium.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import os
import platform
import plistlib
import biplist
import sys

if __name__ == '__main__':
Expand Down Expand Up @@ -38,10 +39,13 @@ def _get_accounts_from_plist(settingsdir):
print('Adium ERROR: No usable Accounts.plist file found, cannot create Adium files!')
return []
# make sure the plist is in XML format, not binary,
# this should be converted to use python-biplist.
if platform.system() == 'Darwin':
os.system("plutil -convert xml1 '" + accountsfile + "'")
return plistlib.readPlist(accountsfile)['Accounts']
AdiumProperties._convert_binary_plist_to_xml_plist(accountsfile)
return biplist.readPlist(accountsfile)['Accounts']

@staticmethod
def _convert_binary_plist_to_xml_plist(binary_plist):
plist_data = biplist.readPlist(binary_plist)
biplist.writePlist(plist_data, binary_plist, False) #False => XML, not Binary formatted PList

@staticmethod
def parse(settingsdir=None):
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def read(fname):
'pgpdump',
'qrcode >= 4.0.1',
'six',
'biplist',
]

# argparse and ordereddict are included in Python starting in 2.7
Expand Down