示例#1
0
def sizeinbytes(searchString,cacheItems=[],cache=False):
    if not util.is_number(searchString):
        return False
    for afile in cacheItems:
        if long(os.path.getsize(afile))==long(searchString):
            return True
    return False
示例#2
0
def sizeinbytes(searchString, cacheItems=[], cache=False):
    if not util.is_number(searchString):
        return False
    for afile in cacheItems:
        if os.path.isfile(afile):
            if long(os.path.getsize(afile)) == long(searchString):
                return True
    return False
示例#3
0
    def addStats(self, site, response):

        # Iterate over the desired stats, and if this stat exists
        # in the response object, add the value
        for statType in self.stats:
            if statType in response:

                # Make sure it's a number
                if is_number(response[statType]):
                    self.stats[statType][TOTAL] += response[statType]
                    self.stats[statType][site] = response[statType]
                #self.stats[statType][statType] = response[statType]
        return ""