diff options
author | Sebastian Pipping <sebastian@pipping.org> | 2010-01-15 01:54:48 +0100 |
---|---|---|
committer | Sebastian Pipping <sebastian@pipping.org> | 2010-01-15 01:54:55 +0100 |
commit | 6db71f043212980cd590ced1790c0c91b7b8a553 (patch) | |
tree | ac0a2eb2968a5bba9697a5a6d68da76aeb24a857 | |
parent | Include quality indicator in overlay info display (diff) | |
download | layman-6db71f043212980cd590ced1790c0c91b7b8a553.tar.gz layman-6db71f043212980cd590ced1790c0c91b7b8a553.tar.bz2 layman-6db71f043212980cd590ced1790c0c91b7b8a553.zip |
Fix whitspace handling for description field (with layman -i)
-rw-r--r-- | CHANGES | 7 | ||||
-rw-r--r-- | layman/overlays/overlay.py | 5 |
2 files changed, 8 insertions, 4 deletions
@@ -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: |