[Python-checkins] python/dist/src/Lib gopherlib.py,1.12,1.12.16.1

doerwalter at users.sourceforge.net doerwalter at users.sourceforge.net
Mon Sep 22 08:44:49 EDT 2003


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

Modified Files:
      Tag: release23-maint
	gopherlib.py 
Log Message:
Backport checkin:
Avoid list as a variable name.


Index: gopherlib.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/gopherlib.py,v
retrieving revision 1.12
retrieving revision 1.12.16.1
diff -C2 -d -r1.12 -r1.12.16.1
*** gopherlib.py	1 Jun 2002 14:18:45 -0000	1.12
--- gopherlib.py	22 Sep 2003 12:44:47 -0000	1.12.16.1
***************
*** 96,100 ****
  def get_directory(f):
      """Get a directory in the form of a list of entries."""
!     list = []
      while 1:
          line = f.readline()
--- 96,100 ----
  def get_directory(f):
      """Get a directory in the form of a list of entries."""
!     entries = []
      while 1:
          line = f.readline()
***************
*** 123,134 ****
              parts.append('')
          parts.insert(0, gtype)
!         list.append(parts)
!     return list
  
  def get_textfile(f):
      """Get a text file as a list of lines, with trailing CRLF stripped."""
!     list = []
!     get_alt_textfile(f, list.append)
!     return list
  
  def get_alt_textfile(f, func):
--- 123,134 ----
              parts.append('')
          parts.insert(0, gtype)
!         entries.append(parts)
!     return entries
  
  def get_textfile(f):
      """Get a text file as a list of lines, with trailing CRLF stripped."""
!     lines = []
!     get_alt_textfile(f, lines.append)
!     return lines
  
  def get_alt_textfile(f, func):
***************
*** 192,200 ****
          f = send_selector(selector, host)
      if type == A_TEXT:
!         list = get_textfile(f)
!         for item in list: print item
      elif type in (A_MENU, A_INDEX):
!         list = get_directory(f)
!         for item in list: print item
      else:
          data = get_binary(f)
--- 192,200 ----
          f = send_selector(selector, host)
      if type == A_TEXT:
!         lines = get_textfile(f)
!         for item in lines: print item
      elif type in (A_MENU, A_INDEX):
!         entries = get_directory(f)
!         for item in entries: print item
      else:
          data = get_binary(f)





More information about the Python-checkins mailing list