aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGunnar Wrobel <p@rdus.de>2009-01-01 07:39:39 +0000
committerGunnar Wrobel <p@rdus.de>2009-01-01 07:39:39 +0000
commit6d9311c911387ef9e58a1fd21921672dd10ef82b (patch)
tree1d7486c09aa0808b8a3f0bec56e379f41f05e4ee /layman/overlays/overlay.py
parentlayman-1.2.2. (diff)
downloadoverlord-6d9311c911387ef9e58a1fd21921672dd10ef82b.tar.gz
overlord-6d9311c911387ef9e58a1fd21921672dd10ef82b.tar.bz2
overlord-6d9311c911387ef9e58a1fd21921672dd10ef82b.zip
layman-1.2.3.
Diffstat (limited to 'layman/overlays/overlay.py')
-rw-r--r--layman/overlays/overlay.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/layman/overlays/overlay.py b/layman/overlays/overlay.py
index 2887ec4..b9568b1 100644
--- a/layman/overlays/overlay.py
+++ b/layman/overlays/overlay.py
@@ -214,7 +214,7 @@ class Overlay:
return result
- def short_list(self):
+ def short_list(self, width = 0):
'''
>>> here = os.path.dirname(os.path.realpath(__file__))
>>> document = open(here + '/../tests/testfiles/global-overlays.xml').read()
@@ -222,8 +222,8 @@ class Overlay:
>>> document = xml.dom.minidom.parseString(document)
>>> overlays = document.getElementsByTagName('overlay')
>>> a = Overlay(overlays[0])
- >>> print a.short_list() #doctest: +ELLIPSIS
- wrobel [None ] (https://overlays.gentoo.or...)
+ >>> print a.short_list(80)
+ wrobel [None ] (https://o.g.o/svn/dev/wrobel )
'''
def pad(string, length):
@@ -254,7 +254,9 @@ class Overlay:
name = pad(self.name, 25)
mtype = ' [' + pad(self.type, 10) + ']'
- srclen = terminal_width() - 43
+ if not width:
+ width = terminal_width()
+ srclen = width - 43
source = self.src
if len(source) > srclen:
source = source.replace("overlays.gentoo.org", "o.g.o")