[Pythonmac-SIG] Some new tools: plistservices, userdefaults,
and CFPython
by Sarwat Khan other posts by this author
Sep 4 2003 11:31PM messages near this date
[Pythonmac-SIG] Quiting a CGIHttpServer
|
Re: [Pythonmac-SIG] Some new tools: plistservices, userdefaults,
and CFPython
Hi all,
I released some stuff today that should interest you guys.
plistservices and userdefaults are Python modules. CFPython is a
library to make working with the Python C API and CoreFoundation easier.
plistservices is like plistlib in that it supports reading and writing
of property list data, but unlike the version included with Python 2.3
it supports plists of any time (not just dictionaries). Most
importantly plistservices includes an ISO 8601 parser to create
datetime objects, so you don't need to install PyXML to use property
lists that use dates. However, plistservices requires Python 2.3.
plistservices is very Cocoa-like in its interface; it's intended to be
used like NSPropertyListSerialization. plistservices includes Date
(datetime.datetime), Data, and TimeInterval classes to make it easier
to work with code or data that was intended for Cocoa or PyObjC.
userdefaults is a Python interface to CFPreferences (or
NSUserDefaults). This lets you read and write your script's preferences
to the current user's ~/Library/Preferences folder as well as access
system preferences (such as NSCurrencySymbol or
com.apple.sound.beep.sound).
CFPython was used to implement userdefaults and is a translator between
PyObject<=> CFTypeRef. It's more functional than the pycfbridge.c
included with the Python 2.3 source, however. Currently it only
supports translation of property list types, as that was all I was
interested in implementing. It's a very useful library however, as it
lets you write all your logic using Cocoa or Carbon and then perform
the data translations as necessary when you need to supply or get data
from Python.
You can get this stuff from my website at
http://sarwat.net/opensource/
The stuff's released under a BSD-style license. Use 'bzcat <file> | pax
-r' to extract the archives.
_______________________________________________
Pythonmac-SIG maillist - Pythonmac-SIG@[...].org
http://mail.python.org/mailman/listinfo/pythonmac-sig
Thread:
Sarwat Khan
Bob Ippolito
Sarwat Khan
Bob Ippolito
|