From d3838e1a5affe49ea454c3730d944e8c84a6bdc8 Mon Sep 17 00:00:00 2001 From: Sam Ruby Date: Wed, 25 Oct 2006 14:09:37 -0400 Subject: [PATCH] Support rss images --- planet/reconstitute.py | 3 +++ tests/data/reconstitute/rss_image.xml | 12 ++++++++++++ .../reconstitute/{rsssource.xml => rss_source.xml} | 0 3 files changed, 15 insertions(+) create mode 100644 tests/data/reconstitute/rss_image.xml rename tests/data/reconstitute/{rsssource.xml => rss_source.xml} (100%) diff --git a/planet/reconstitute.py b/planet/reconstitute.py index 1cee1bb..a7eace3 100644 --- a/planet/reconstitute.py +++ b/planet/reconstitute.py @@ -172,6 +172,9 @@ def source(xsource, source, bozo, format): createTextElement(xsource, 'icon', source.get('icon', None)) createTextElement(xsource, 'logo', source.get('logo', None)) + if not source.has_key('logo') and source.has_key('image'): + createTextElement(xsource, 'logo', source.image.get('href',None)) + for tag in source.get('tags',[]): category(xsource, tag) diff --git a/tests/data/reconstitute/rss_image.xml b/tests/data/reconstitute/rss_image.xml new file mode 100644 index 0000000..392ea2b --- /dev/null +++ b/tests/data/reconstitute/rss_image.xml @@ -0,0 +1,12 @@ + + + + + http://example.com/logo.jpg + + + + diff --git a/tests/data/reconstitute/rsssource.xml b/tests/data/reconstitute/rss_source.xml similarity index 100% rename from tests/data/reconstitute/rsssource.xml rename to tests/data/reconstitute/rss_source.xml