[Pythonmac-SIG] obtaining versions of application bundles

Bob Ippolito bob at redivi.com
Fri Oct 22 20:52:26 CEST 2004


On Oct 22, 2004, at 5:21, Jack Jansen wrote:

>
> On 22-okt-04, at 6:58, brad.allen at omsdal.com wrote:
>> We have already crossed that bridge by hiring a developer (Walker 
>> Hale) to
>> build a Python module to do that. He came up with a way to do it using
>> Python's built-in support for Carbon on OS X. I'm hoping my employer 
>> will
>> allow me to post more of the project code publicly, because we can 
>> benefit
>> from "open source" scrutiny, and because some of it may prove useful 
>> to
>> others.
>
> Getting this plist from a 'plst' resource should be 10 lines at most 
> (but the challenge is of course finding the correct 10 lines:-).
>
> If you structure this as an addition to plistlib (such as 
> plistlib.Plist.fromResource(filename, restype='plst', resid=0)) and 
> you can live with the rules for donating code to Python (basically 
> that you transfer ownership to the Python Software Foundation, 
> www.python.org has the details) I'd be happy to incorporate it into 
> the standard distribution.

Ok, I'll bite:
- added plistlib.readPlistFromResource and plistlib.writePlistToResource
- changed aliasing of builtin (file -> fileobj)
- made float use the correct accuracy (str -> repr)
- fixed date parsing (current version requires PyXML, and it was wrong 
even then.. fixed to use stdlib and correct semantics)
- changed internal representation of dates to datetime.datetime instead 
of float timestamp

http://svn.red-bean.com/bob/plistlib/trunk/plistlib.py

I'll add a patch to sourceforge, would you like me to assign it to you 
or someone else?  ;)

-bob



More information about the Pythonmac-SIG mailing list