Changeset 213:a9fe73654ee1


Ignore:
Timestamp:
Mar 16, 2003, 12:03:23 AM (17 years ago)
Author:
Stefan Schwarzer <sschwarzer@…>
Branch:
default
Tags:
Refactoring_2003-03-16
Convert:
svn:778c30c8-61e0-0310-89d4-fe2f97a467b2/trunk@221
Message:
FTPHost: Used `True` and `False` instead of `1` and `0` for flag `fail`.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • ftputil.py

    r212 r213  
    3030# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    3131
    32 # $Id: ftputil.py,v 1.109 2003/03/15 22:44:00 schwa Exp $
     32# $Id: ftputil.py,v 1.110 2003/03/15 23:03:23 schwa Exp $
    3333
    3434"""
     
    333333                          'truncate name softspace'.split() ):
    334334            return getattr(self._fo, attr_name)
    335         raise AttributeError("'FTPFile' object has no "
    336               "attribute '%s'" % attr_name)
     335        raise AttributeError(
     336              "'FTPFile' object has no attribute '%s'" % attr_name)
    337337
    338338    def close(self):
     
    510510        """
    511511        minute = 60.0
    512         hour = 60 * minute
     512        hour = 60.0 * minute
    513513        # avoid division by zero below
    514514        if time_shift == 0:
     
    520520        #  versions because of the explicit `int`
    521521        absolute_rounded_time_shift = \
    522           int( (absolute_time_shift+30*minute) / hour) * hour
     522          int( (absolute_time_shift + 30*minute) / hour) * hour
    523523        # return with correct sign
    524524        return signum * absolute_rounded_time_shift
     
    531531        """
    532532        minute = 60.0
    533         hour = 60 * minute
     533        hour = 60.0 * minute
    534534        absolute_rounded_time_shift = \
    535535          abs( self.__rounded_time_shift(time_shift) )
     
    736736        names = []
    737737        def callback(line):
    738             stat_result = self._parse_line(line, fail=0)
     738            stat_result = self._parse_line(line, fail=False)
    739739            if stat_result is not None:
    740740                names.append(stat_result._st_name)
     
    866866        return result
    867867
    868     def _parse_line(self, line, fail=1):
     868    def _parse_line(self, line, fail=True):
    869869        """Return `_Stat` instance corresponding to the given text line."""
    870870        try:
     
    893893        # parse candidates
    894894        for line in candidates:
    895             stat_result = self._parse_line(line, fail=0)
     895            stat_result = self._parse_line(line, fail=False)
    896896            if (stat_result is not None) and \
    897897              (stat_result._st_name == basename):
     
    911911            if visited_paths.has_key(path):
    912912                raise PermanentError("recursive link structure detected")
    913             visited_paths[path] = 1
     913            visited_paths[path] = True
    914914
    915915
Note: See TracChangeset for help on using the changeset viewer.