From 0df474c8ff6feda95506b26e5ea6f352a1b518ba Mon Sep 17 00:00:00 2001 From: Sam Ruby Date: Tue, 14 Nov 2006 10:28:40 -0500 Subject: [PATCH] Support backlevel versions of Python --- docs/installation.html | 18 +++++++++++++----- planet/__init__.py | 3 ++- planet/spider.py | 4 ++-- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/docs/installation.html b/docs/installation.html index 9994984..6a668d1 100644 --- a/docs/installation.html +++ b/docs/installation.html @@ -69,7 +69,7 @@ right directory.

Build your own themes, templates, or filters! And share!

-

Mac OS X and Fink Instructions

+

Mac OS X and Fink Instructions

The Fink Project packages @@ -101,12 +101,20 @@ not yet ported to the newer python so Venus will be less featureful. may want to explicitly specify python2.4.

-

Ubuntu Linux (Edgy Eft) instructions

+

Ubuntu Linux (Edgy Eft) instructions

Before starting, issue the following command:

- + +
sudo apt-get install bzr python2.4-librdf
+ +

Python 2.2 instructions

+ +

If you are running Python 2.2, you may also need to install pyxml. If the +following runs without error, you do not have the problem.

+
python -c "__import__('xml.dom.minidom').dom.minidom.parseString('<entry xml:lang=\"en\"/>')"
+

Installation of pyxml varies by platform. For Ubuntu Linux (Dapper Drake), issue the following command:

+ +
sudo apt-get install python2.2-xml
diff --git a/planet/__init__.py b/planet/__init__.py index 6be34ed..0902bd8 100644 --- a/planet/__init__.py +++ b/planet/__init__.py @@ -16,10 +16,11 @@ def getLogger(level, format): try: import logging + logging.basicConfig(format=format) except: import compat_logging as logging + logging.basicConfig(format=format) - logging.basicConfig(format=format) logging.getLogger().setLevel(logging.getLevelName(level)) logger = logging.getLogger("planet.runner") try: diff --git a/planet/spider.py b/planet/spider.py index aff3884..72f339c 100644 --- a/planet/spider.py +++ b/planet/spider.py @@ -260,7 +260,7 @@ def spiderFeed(feed, only_if_new=0): # apply any filters xdoc = reconstitute.reconstitute(data, entry) - output = xdoc.toxml('utf-8') + output = xdoc.toxml().encode('utf-8') xdoc.unlink() for filter in config.filters(feed): output = shell.run(filter, output, mode="filter") @@ -320,7 +320,7 @@ def spiderFeed(feed, only_if_new=0): xdoc=minidom.parseString('''\n''' % planet.xmlns) reconstitute.source(xdoc.documentElement,data.feed,data.bozo,data.version) - write(xdoc.toxml('utf-8'), filename(sources, feed)) + write(xdoc.toxml().encode('utf-8'), filename(sources, feed)) xdoc.unlink() def spiderPlanet(only_if_new = False):