Re: [Pythonmac-SIG] convert binary plist to xml string

2005-05-16 Thread Bill Janssen
> > On May 16, 2005, at 2:08 PM, Bill Janssen wrote: > > > Pascal data structures?! > > Have you ever looked at the Carbon/QuickTime APIs? I guess not. Nope. > Mac OS past was originally written with Pascal calling conventions and > pascal strings (unsigned char length prefixed strings), so

Re: [Pythonmac-SIG] convert binary plist to xml string

2005-05-16 Thread Bob Ippolito
On May 16, 2005, at 2:08 PM, Bill Janssen wrote: > Pascal data structures?! Have you ever looked at the Carbon/QuickTime APIs? I guess not. Mac OS past was originally written with Pascal calling conventions and pascal strings (unsigned char length prefixed strings), so you see them all o

Re: [Pythonmac-SIG] convert binary plist to xml string

2005-05-16 Thread Bill Janssen
Pascal data structures?! Bill ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig

Re: [Pythonmac-SIG] convert binary plist to xml string

2005-05-16 Thread Bob Ippolito
On May 16, 2005, at 1:31 PM, Bill Janssen wrote: >> first, second, third, fourth, fifth, . = struct.unpack >> ("iiIIiIiiILllfd", data) >> >> It is SO EASY to screw this up. Pick the wrong type code, or >> misalign the type and field. It needs to look more like something >> sane: >> >> cla

Re: [Pythonmac-SIG] convert binary plist to xml string

2005-05-16 Thread Bill Janssen
> first, second, third, fourth, fifth, . = struct.unpack > ("iiIIiIiiILllfd", data) > > It is SO EASY to screw this up. Pick the wrong type code, or > misalign the type and field. It needs to look more like something sane: > > class Point(struct.BigEndianStruct): > x = struct.SInt32(

Re: [Pythonmac-SIG] convert binary plist to xml string

2005-05-15 Thread Bob Ippolito
On May 15, 2005, at 10:22 PM, Bill Janssen wrote: >> If "works pretty well" means that it's one of the most common sources >> of bugs in the Python standard library (that corrupt data for years >> before being found) > > Do you mean it contained (contains?) bugs, or that it's easy to misuse > and

Re: [Pythonmac-SIG] convert binary plist to xml string

2005-05-15 Thread Bill Janssen
> If "works pretty well" means that it's one of the most common sources > of bugs in the Python standard library (that corrupt data for years > before being found) Do you mean it contained (contains?) bugs, or that it's easy to misuse and someone misused it in some other part of the std librar

Re: [Pythonmac-SIG] convert binary plist to xml string

2005-05-15 Thread Bob Ippolito
On May 15, 2005, at 6:26 PM, Bill Janssen wrote: >> Yeah, the NeXT style plists could be done too. But the question is, >> why bother? > > In case I encounter a file of this format on a non-Apple platform, of > course. It's particularly interesting because Safari is now storing > web-archive fi

Re: [Pythonmac-SIG] convert binary plist to xml string

2005-05-15 Thread Bill Janssen
> Yeah, the NeXT style plists could be done too. But the question is, > why bother? In case I encounter a file of this format on a non-Apple platform, of course. It's particularly interesting because Safari is now storing web-archive files in this format (binary plist). There's a good chance

Re: [Pythonmac-SIG] convert binary plist to xml string

2005-05-14 Thread Bob Ippolito
On May 14, 2005, at 12:44 AM, Bob Ippolito wrote: > > On May 13, 2005, at 7:11 PM, [EMAIL PROTECTED] 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 o

Re: [Pythonmac-SIG] convert binary plist to xml string

2005-05-13 Thread Bob Ippolito
On May 13, 2005, at 11:19 PM, Bill Janssen wrote: > The binary plist format is also documented on the Web in > http://cvs.opendarwin.org/index.cgi/~checkout~/src/CoreFoundation/ > Parsing.subproj/CFBinaryPList.c?rev=1.1.1.3&content-type=text/plain > so a parser could be written for it in pure Pyt

Re: [Pythonmac-SIG] convert binary plist to xml string

2005-05-13 Thread Bob Ippolito
On May 13, 2005, at 7:11 PM, [EMAIL PROTECTED] 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

Re: [Pythonmac-SIG] convert binary plist to xml string

2005-05-13 Thread Bill Janssen
The binary plist format is also documented on the Web in http://cvs.opendarwin.org/index.cgi/~checkout~/src/CoreFoundation/Parsing.subproj/CFBinaryPList.c?rev=1.1.1.3&content-type=text/plain so a parser could be written for it in pure Python. Bill ___ Py

Re: [Pythonmac-SIG] convert binary plist to xml string

2005-05-13 Thread brad . allen
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

Re: [Pythonmac-SIG] convert binary plist to xml string

2005-05-08 Thread Bob Ippolito
On May 8, 2005, at 6:40 PM, Florian Munz wrote: > Nicholas Riley <[EMAIL PROTECTED]> wrote: > > >> In [3]: plist, format, error = >> NSPropertyListSerialization.propertyListFromData_mutabilityOption_for >> ma >> t_errorDescription_(NSData.dataWithContentsOfMappedFile_ >> (os.path.expand >> user(

Re: [Pythonmac-SIG] convert binary plist to xml string

2005-05-08 Thread Florian Munz
Nicholas Riley <[EMAIL PROTECTED]> wrote: > In [3]: plist, format, error = >NSPropertyListSerialization.propertyListFromData_mutabilityOption_forma >t_errorDescription_(NSData.dataWithContentsOfMappedFile_(os.path.expand >user('~/Library/Preferences/com.apple.keychainsync.plist')), >NSPropertyList

Re: [Pythonmac-SIG] convert binary plist to xml string

2005-05-07 Thread Nicholas Riley
On May 7, 2005, at 12:13 PM, Florian Munz wrote: > since the format of plist files changed to binary by default on > Tiger my little program, which works on xml plists doesn't work > anymore. > > Is there a way to convert a binary plist to xml with Python or PyObjC? > > I know this on the command

[Pythonmac-SIG] convert binary plist to xml string

2005-05-07 Thread Florian Munz
Hello, since the format of plist files changed to binary by default on Tiger my little program, which works on xml plists doesn't work anymore. Is there a way to convert a binary plist to xml with Python or PyObjC? I know this on the command line: plutil -convert xml1 Bookmarks.plist but I'm s