[Python-checkins] python/dist/src/Lib/plat-mac pimp.py,1.23,1.24

jackjansen@users.sourceforge.net jackjansen@users.sourceforge.net
Sun, 01 Jun 2003 13:03:45 -0700


Update of /cvsroot/python/python/dist/src/Lib/plat-mac
In directory sc8-pr-cvs1:/tmp/cvs-serv671/Lib/plat-mac

Modified Files:
	pimp.py 
Log Message:
Use splitlines() in stead of split() to split lines, and added a method
shortdescription() so the code to split off the first line of the
description isn't all over the place.


Index: pimp.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/plat-mac/pimp.py,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -d -r1.23 -r1.24
*** pimp.py	29 May 2003 22:07:27 -0000	1.23
--- pimp.py	1 Jun 2003 20:03:40 -0000	1.24
***************
*** 392,395 ****
--- 392,396 ----
      def flavor(self): return self._dict.get('Flavor')
      def description(self): return self._dict['Description'].strip()
+     def shortdescription(self): return self.description().splitlines()[0]
      def homepage(self): return self._dict.get('Home-page')
      def downloadURL(self): return self._dict.get('Download-URL')
***************
*** 501,505 ****
                      descr = "Requires unknown %s"%name
                  else:
!                     descr = pkg.description()
              rv.append((pkg, descr))
          return rv
--- 502,506 ----
                      descr = "Requires unknown %s"%name
                  else:
!                     descr = pkg.shortdescription()
              rv.append((pkg, descr))
          return rv
***************
*** 826,830 ****
              pkg = db.find(pkgname)
              if pkg:
!                 description = pkg.description().split('\r\n')[0]
                  pkgname = pkg.fullname()
              else:
--- 827,831 ----
              pkg = db.find(pkgname)
              if pkg:
!                 description = pkg.shortdescription()
                  pkgname = pkg.fullname()
              else:
***************
*** 838,842 ****
                      pass
                  description = pkg.description()
!                 description = '\n\t\t\t\t\t'.join(description.split('\r\n'))
                  print "\tDescription:\t%s" % description
      elif mode =='status':
--- 839,843 ----
                      pass
                  description = pkg.description()
!                 description = '\n\t\t\t\t\t'.join(description.splitlines())
                  print "\tDescription:\t%s" % description
      elif mode =='status':