summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Pipping <sebastian@pipping.org>2010-03-06 20:43:34 +0100
committerSebastian Pipping <sebastian@pipping.org>2010-03-06 20:43:34 +0100
commita236c7986d904abddff5deb8bd08d0e6463847e0 (patch)
tree5d561572858e84891244f6116af203047a2101f4
parentrepsitories.xml converted: Allow overriding input and output location (diff)
downloadrepositories-xml-format-a236c7986d904abddff5deb8bd08d0e6463847e0.tar.gz
repositories-xml-format-a236c7986d904abddff5deb8bd08d0e6463847e0.tar.bz2
repositories-xml-format-a236c7986d904abddff5deb8bd08d0e6463847e0.zip
repsitories.xml converted: Strip whitespace around homepage and description
-rwxr-xr-xwrite-repositories-xml.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/write-repositories-xml.py b/write-repositories-xml.py
index 61cc7a0..1bbfd9c 100755
--- a/write-repositories-xml.py
+++ b/write-repositories-xml.py
@@ -43,6 +43,9 @@ def append_feed(feed_uri, overlay_object):
feed.text = feed_uri
overlay_object.append(feed)
+def strip(node):
+ node.text = node.text.strip()
+
a = ET.parse(open(layman_global_txt_location))
overlays = a.getroot()
@@ -50,10 +53,11 @@ for overlay in overlays:
repo_name = overlay.attrib['name']
extra_data = TRANSITION_DATA_EXTRA.get(repo_name, {})
- # Move 'description' tag
+ # Move (and strip) 'description' tag
description = overlay.find('description')
overlay.remove(description)
overlay.insert(0, description)
+ strip(description)
# Transform 'overlay' tag
overlay.tag = 'repo'
@@ -66,6 +70,7 @@ for overlay in overlays:
link = overlay.find('link')
if link != None:
link.tag = 'homepage'
+ strip(link)
# Transform 'contact' attribute
owner = ET.Element('owner')