summaryrefslogtreecommitdiff
path: root/apt
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2006-05-17 18:11:55 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2006-05-17 18:11:55 +0200
commit0a6e7dc1aac196e640bda1160c9561a398d76044 (patch)
treefed3b0e937373b1751d31b1963774c8f07c295b0 /apt
parent0e8fd33b1b741cc65c284a08faa50b3a2995ac3c (diff)
downloadpython-apt-0a6e7dc1aac196e640bda1160c9561a398d76044.tar.gz
* apt/package.py:
- check if _lookupRecords() succeeded when checking description/maintainer
Diffstat (limited to 'apt')
-rw-r--r--apt/package.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/apt/package.py b/apt/package.py
index 4fceb904..55e1cd01 100644
--- a/apt/package.py
+++ b/apt/package.py
@@ -49,7 +49,7 @@ class Package(object):
# check if we found a version
if ver == None:
- #print "No version for: %s (Candidate: %s)" % (self._pkg.Name, UseCandidate)
+ print "No version for: %s (Candidate: %s)" % (self._pkg.Name, UseCandidate)
return False
if ver.FileList == None:
@@ -149,13 +149,15 @@ class Package(object):
def summary(self):
""" Return the short description (one line summary) """
- self._lookupRecord()
+ if not self._lookupRecord():
+ return ""
return self._records.ShortDesc
summary = property(summary)
def description(self, format=True):
""" Return the formated long description """
- self._lookupRecord()
+ if not self._lookupRecord():
+ return ""
desc = ""
for line in string.split(self._records.LongDesc, "\n"):
tmp = string.strip(line)
@@ -168,7 +170,8 @@ class Package(object):
def rawDescription(self):
""" return the long description (raw)"""
- self._lookupRecord()
+ if not self._lookupRecord():
+ return ""
return self._records.LongDesc
rawDescription = property(rawDescription)