On Thu, 2007-10-18 at 15:27 -0400, seth vidal wrote: > On Thu, 2007-10-18 at 13:41 -0400, James Antill wrote: > > In current search results for some packages the summary line has a '\n' > > at the end, so you get blank lines. Attached is a simple patch to fix > > that up. > > > > I've attached it and it can be merged from: > > > > git pull http://people.redhat.com/jantill/gits/yum search-empty-lines > > couldn't it just be: > summary = summary.replace('\n','') > > summary's should never be multiline anyway.
Sure, that's fine by me. I've also moved the change to a more generic location. -- James Antill <[EMAIL PROTECTED]>
diff --git a/yum/packages.py b/yum/packages.py
index 6089730..fb7d1b7 100644
--- a/yum/packages.py
+++ b/yum/packages.py
@@ -569,6 +569,7 @@ class YumAvailablePackage(PackageObject, RpmBase):
for item in ['summary', 'description', 'packager', 'group',
'buildhost', 'sourcerpm', 'url', 'vendor']:
setattr(self, item, pkgdict.info[item])
+ self.summary = self.summary.replace('\n', '')
self.licenses.append(pkgdict.info['license'])
@@ -626,7 +627,7 @@ class YumHeaderPackage(YumAvailablePackage):
self.release = self.hdr['release']
self.ver = self.version
self.rel = self.release
- self.summary = self.hdr['summary']
+ self.summary = self.hdr['summary'].replace('\n', '')
self.description = self.hdr['description']
self.pkgid = self.hdr[rpm.RPMTAG_SHA1HEADER]
if not self.pkgid:
signature.asc
Description: This is a digitally signed message part
_______________________________________________ Yum-devel mailing list [email protected] https://lists.dulug.duke.edu/mailman/listinfo/yum-devel
