Damian Cugley’s Weblog
I’ve been amusing myself by concocting an RSS reader using XSLT to do the processing. XSLT can even handle the downloading of the RSS files, but this does not allow for caching or aggregating—so I thought I would knock something together in Python.
Python is installed on Mac OS
X out of the box. But
I discovered to my dismay that it has no XML
parsers! Since I wanted to store my list
of RSS feeds as XML, this was something of a bother. Not
to worry—I visited the XML Topic Guide on the
Python web site and downloaded
pyxml 0.8.2. This then
failed to install. I fixed this little problem by
editing setup.py
. In the imports I added
get_config_var
to the line
from distutils.sysconfig import get_config_vars
And I deleted distutils.sysconfig
from
the line
if sys.platform[:6] == "darwin" and \
distutils.sysconfig.get_config_var("LDSHARED").find("-flat_namespace") == -1:
This line would have worked if the import
line had just said import
distutils.sysconfig
(and if other references to
get_code_vars
had been fully qualified
names).
I generally prefer to avoid the
from ... import
style of imports for just
this sort of reason.
Now all I have to do is persuade the SAX2 parser to grok XML namespaces...