aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Dolbec <brian.dolbec@gmail.com>2011-02-06 15:37:30 -0800
committerBrian Dolbec <brian.dolbec@gmail.com>2011-02-06 15:37:30 -0800
commit3684c28f8f1c8a88304c538393c478a12998fe1a (patch)
tree0834bd45f7d32a3f5526c0750e885bce1245e8fc
parentadd the ability to plugin repository definition xml files without editing the... (diff)
downloadoverlord-3684c28f8f1c8a88304c538393c478a12998fe1a.tar.gz
overlord-3684c28f8f1c8a88304c538393c478a12998fe1a.tar.bz2
overlord-3684c28f8f1c8a88304c538393c478a12998fe1a.zip
rename Overlay's __str__(). split out UnknownOverlayMessage() from the exception class
-rw-r--r--overlord/dbbase.py8
-rw-r--r--overlord/overlays/overlay.py2
2 files changed, 6 insertions, 4 deletions
diff --git a/overlord/dbbase.py b/overlord/dbbase.py
index 7821aea..e152578 100644
--- a/overlord/dbbase.py
+++ b/overlord/dbbase.py
@@ -41,10 +41,12 @@ from overlord.overlays.overlay import Overlay
# Class UnknownOverlayException
#
#-------------------------------------------------------------------------------
+def UnknownOverlayMessage(ovl):
+ return 'Overlay "%s" does not exist.' % ovl
class UnknownOverlayException(Exception):
def __init__(self, repo_name):
- message = 'Overlay "%s" does not exist.' % repo_name
+ UnknownOverlayMessage(repo_name)
super(UnknownOverlayException, self).__init__(message)
#===============================================================================
@@ -242,8 +244,8 @@ class DbBase:
for overlay in selection:
if verbose:
- result.append((str(overlay), overlay.is_supported(),
- overlay.is_official()))
+ result.append(overlay.get_infostr(), overlay.is_supported(),
+ overlay.is_official())
else:
result.append((overlay.short_list(width), overlay.is_supported(),
overlay.is_official()))
diff --git a/overlord/overlays/overlay.py b/overlord/overlays/overlay.py
index e8730f9..b827fd8 100644
--- a/overlord/overlays/overlay.py
+++ b/overlord/overlays/overlay.py
@@ -305,7 +305,7 @@ class Overlay(object):
assert len(self.sources) == 1
return self.sources[0].delete(base)
- def __str__(self):
+ def get_infostr(self):
'''
>>> here = os.path.dirname(os.path.realpath(__file__))
>>> import xml.etree.ElementTree as ET # Python 2.5