1 |
commit: 3684c28f8f1c8a88304c538393c478a12998fe1a |
2 |
Author: Brian Dolbec <brian.dolbec <AT> gmail <DOT> com> |
3 |
AuthorDate: Sun Feb 6 23:37:30 2011 +0000 |
4 |
Commit: Brian Dolbec <brian.dolbec <AT> gmail <DOT> com> |
5 |
CommitDate: Sun Feb 6 23:37:30 2011 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/overlord.git;a=commit;h=3684c28f |
7 |
|
8 |
rename Overlay's __str__(). split out UnknownOverlayMessage() from the exception class |
9 |
|
10 |
--- |
11 |
overlord/dbbase.py | 8 +++++--- |
12 |
overlord/overlays/overlay.py | 2 +- |
13 |
2 files changed, 6 insertions(+), 4 deletions(-) |
14 |
|
15 |
diff --git a/overlord/dbbase.py b/overlord/dbbase.py |
16 |
index 7821aea..e152578 100644 |
17 |
--- a/overlord/dbbase.py |
18 |
+++ b/overlord/dbbase.py |
19 |
@@ -41,10 +41,12 @@ from overlord.overlays.overlay import Overlay |
20 |
# Class UnknownOverlayException |
21 |
# |
22 |
#------------------------------------------------------------------------------- |
23 |
+def UnknownOverlayMessage(ovl): |
24 |
+ return 'Overlay "%s" does not exist.' % ovl |
25 |
|
26 |
class UnknownOverlayException(Exception): |
27 |
def __init__(self, repo_name): |
28 |
- message = 'Overlay "%s" does not exist.' % repo_name |
29 |
+ UnknownOverlayMessage(repo_name) |
30 |
super(UnknownOverlayException, self).__init__(message) |
31 |
|
32 |
#=============================================================================== |
33 |
@@ -242,8 +244,8 @@ class DbBase: |
34 |
|
35 |
for overlay in selection: |
36 |
if verbose: |
37 |
- result.append((str(overlay), overlay.is_supported(), |
38 |
- overlay.is_official())) |
39 |
+ result.append(overlay.get_infostr(), overlay.is_supported(), |
40 |
+ overlay.is_official()) |
41 |
else: |
42 |
result.append((overlay.short_list(width), overlay.is_supported(), |
43 |
overlay.is_official())) |
44 |
|
45 |
diff --git a/overlord/overlays/overlay.py b/overlord/overlays/overlay.py |
46 |
index e8730f9..b827fd8 100644 |
47 |
--- a/overlord/overlays/overlay.py |
48 |
+++ b/overlord/overlays/overlay.py |
49 |
@@ -305,7 +305,7 @@ class Overlay(object): |
50 |
assert len(self.sources) == 1 |
51 |
return self.sources[0].delete(base) |
52 |
|
53 |
- def __str__(self): |
54 |
+ def get_infostr(self): |
55 |
''' |
56 |
>>> here = os.path.dirname(os.path.realpath(__file__)) |
57 |
>>> import xml.etree.ElementTree as ET # Python 2.5 |