summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Pipping <sebastian@pipping.org>2010-01-15 01:54:48 +0100
committerSebastian Pipping <sebastian@pipping.org>2010-01-15 01:54:55 +0100
commit6db71f043212980cd590ced1790c0c91b7b8a553 (patch)
treeac0a2eb2968a5bba9697a5a6d68da76aeb24a857
parente7773dee5669e65afbecc9f3f0a14497e7d6d5a5 (diff)
downloadlayman-6db71f043212980cd590ced1790c0c91b7b8a553.tar.gz
layman-6db71f043212980cd590ced1790c0c91b7b8a553.tar.bz2
layman-6db71f043212980cd590ced1790c0c91b7b8a553.zip
Fix whitspace handling for description field (with layman -i)
-rw-r--r--CHANGES7
-rw-r--r--layman/overlays/overlay.py5
2 files changed, 8 insertions, 4 deletions
diff --git a/CHANGES b/CHANGES
index 5f44ecc..248e88c 100644
--- a/CHANGES
+++ b/CHANGES
@@ -8,9 +8,10 @@ Version TODO
On addition all sources will be probed until a working
one is found. This should help Layman through many firewalls.
- - Include more information in overlay info display (i.e. layman -i):
- - quality indicator (not guarantee)
- - feed URIs
+ - Improve overlay info display (i.e. layman -i):
+ - Add quality indicator (not guarantee)
+ - Add feed URIs
+ - Fix whitspace handling for description field
- Improve usage display
diff --git a/layman/overlays/overlay.py b/layman/overlays/overlay.py
index 179123c..ddb118e 100644
--- a/layman/overlays/overlay.py
+++ b/layman/overlays/overlay.py
@@ -65,6 +65,7 @@ OVERLAY_TYPES = dict((e.type_key, e) for e in (
QUALITY_LEVELS = 'core|stable|testing|experimental|graveyard'.split('|')
+WHITESPACE_REGEX = re.compile('\s+')
#===============================================================================
#
@@ -162,7 +163,9 @@ class Overlay(object):
_desc = xml.find('description')
if _desc != None:
- self.description = ensure_unicode(_desc.text.strip())
+ d = WHITESPACE_REGEX.sub(' ', _desc.text.strip())
+ self.description = ensure_unicode(d)
+ del d
else:
self.description = ''
if not ignore: