[Pythonmac-SIG] convert binary plist to xml string

Bob Ippolito bob at redivi.com
Sat May 14 18:58:57 CEST 2005


On May 14, 2005, at 12:44 AM, Bob Ippolito wrote:

>
> On May 13, 2005, at 7:11 PM, brad.allen at omsdal.com wrote:
>
>
>> Thanks, Florian, for the instructions on how to convert the new
>> binary plist files into something parseable.
>>
>> I'm wondering if it's going to be possible to bundle this sort of
>> functionality into plistlib. Since PyObjC is needed, I guess the
>> normal plistlib won't be able to do it. Maybe a special version of
>> plistlib could be bundled with PyObjC, just to handle this?
>>
>
> I'd rather not see plistlib change.  It does the XML stuff properly,
> doing anything else doesn't really belong in the standard library.  I
> would rather see plistlib move from plat-mac to the standard
> distribution than have it bring on optional PyObjC dependencies that
> work sometimes and not others.  This is like when it used to have
> pyxml dependencies (that weren't implemented properly in the first
> place).
>
> I'll go ahead and add some stuff to PyObjCTools.Conversion before
> 1.3.5 to read and write plists from data and files, but it's not very
> hard to do this with just raw PyObjC.
>
> thePlist = NSDictionary.dictionaryWithContentsOfFile_(somePath)
>
> someDict.writeToFile_atomically_(somePath, True)
>
> There are already functions in PyObjCTools.Conversion to convert
> python data structures to/from the Objective-C counterparts (though
> as long as the outer thing is a NSDictionary, the write will still
> work, because all the property lists types are bridged).

I've added this functionality to PyObjCTools.Conversion, in svn r1644.

-bob



More information about the Pythonmac-SIG mailing list