Changeset 254

Show
Ignore:
Timestamp:
2003-06-09 17:22:57 (6 years ago)
Author:
schwa
Message:
_StatParser: Changed name and interface of former
    `parse_directory_listing`. That method was renamed to `parse_lines`
    and now takes a list `lines`. This change was made because FTP's
    `DIR` command (respectively, `FTPHost._dir`) already yields a list
    of strings. i. e. the directory lines.
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/ftp_stat.py

    r252 r254  
    3434""" 
    3535 
    36 # $Id: ftp_stat.py,v 1.7 2003/06/09 16:52:57 schwa Exp $ 
     36# $Id: ftp_stat.py,v 1.8 2003/06/09 17:22:57 schwa Exp $ 
    3737 
    3838import stat 
     
    8181        raise NotImplementedError("must be defined by subclass") 
    8282 
    83     def parse_directory_listing(self, listing): 
     83    def parse_lines(self, lines): 
    8484        """ 
    8585        Return a list of `_Stat` objects with one `_Stat` object per 
    86         line in the listing. The order of the entries is kept. 
    87         """ 
    88         lines = listing.splitlines() 
    89         stat_results = [ self.parse_line( line.strip() ) 
    90                          for line in lines ] 
     86        line in the list `lines`. The order of the entries is kept. 
     87        """ 
     88        stat_results = [ self.parse_line(line) for line in lines ] 
    9189        return stat_results 
    9290