summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Pipping <sebastian@pipping.org>2010-01-14 20:32:02 +0100
committerSebastian Pipping <sebastian@pipping.org>2010-01-14 20:32:02 +0100
commit7cf05fe5c4fb83340d9927ee03df4172cb0b8605 (patch)
tree250cbee6580c036464d54e16b65440badc322427
parent2a14ba6689f6104601533d0677fb9211a35c96e0 (diff)
downloadlayman-7cf05fe5c4fb83340d9927ee03df4172cb0b8605.tar.gz
layman-7cf05fe5c4fb83340d9927ee03df4172cb0b8605.tar.bz2
layman-7cf05fe5c4fb83340d9927ee03df4172cb0b8605.zip
Fix display of overlay type
-rw-r--r--layman/overlays/overlay.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/layman/overlays/overlay.py b/layman/overlays/overlay.py
index 6ec2f38..9965fdd 100644
--- a/layman/overlays/overlay.py
+++ b/layman/overlays/overlay.py
@@ -72,8 +72,6 @@ OVERLAY_TYPES = dict((e.type_key, e) for e in (
class Overlay(object):
''' Derive the real implementations from this.'''
- type = 'None'
-
def __init__(self, xml, config, ignore = 0, quiet = False):
'''
>>> here = os.path.dirname(os.path.realpath(__file__))
@@ -308,7 +306,10 @@ class Overlay(object):
result += u'\nContact : %s <%s>' % (self.owner_name, self.owner_email)
else:
result += u'\nContact : ' + self.owner_email
- result += u'\nType : ' + self.type
+ if len(self.sources) == 1:
+ result += u'\nType : ' + self.sources[0].type
+ else:
+ result += u'\nType : ' + '/'.join(sorted(set(e.type for e in self.sources)))
result += u'; Priority: ' + str(self.priority) + u'\n'
description = self.description
@@ -366,7 +367,13 @@ class Overlay(object):
return 80
name = pad(self.name, 25)
- mtype = ' [' + pad(self.type, 10) + ']'
+
+ if len(set(e.type for e in self.sources)) == 1:
+ _type = self.sources[0].type
+ else:
+ _type = '%s/..' % self.sources[0].type
+
+ mtype = ' [' + pad(_type, 10) + ']'
if not width:
width = terminal_width()
srclen = width - 43