From fc6e39a388cfa365388182d6ffe1aef9664fb430 Mon Sep 17 00:00:00 2001 From: Sam Ruby Date: Tue, 5 Sep 2006 20:19:48 -0400 Subject: [PATCH] Default feed.id to feed.link (if present) --- planet/reconstitute.py | 2 +- tests/data/reconstitute/link_rel.xml | 2 +- tests/data/reconstitute/source_link.xml | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/planet/reconstitute.py b/planet/reconstitute.py index f578c7e..9ec908d 100644 --- a/planet/reconstitute.py +++ b/planet/reconstitute.py @@ -151,7 +151,7 @@ def source(xsource, source, bozo): """ copy source information to the entry """ xdoc = xsource.ownerDocument - createTextElement(xsource, 'id', source.get('id', None)) + createTextElement(xsource, 'id', source.get('id', source.get('link',None))) createTextElement(xsource, 'icon', source.get('icon', None)) createTextElement(xsource, 'logo', source.get('logo', None)) diff --git a/tests/data/reconstitute/link_rel.xml b/tests/data/reconstitute/link_rel.xml index 607d72a..26198af 100644 --- a/tests/data/reconstitute/link_rel.xml +++ b/tests/data/reconstitute/link_rel.xml @@ -1,6 +1,6 @@ diff --git a/tests/data/reconstitute/source_link.xml b/tests/data/reconstitute/source_link.xml index 8753a04..5ac54de 100644 --- a/tests/data/reconstitute/source_link.xml +++ b/tests/data/reconstitute/source_link.xml @@ -1,10 +1,11 @@ +