def is_fingerprinted(self): """ Lazy implementation (needs to be fixed); we'll re-fingerprint the file and check whether that happens to be in the filename. """ #TODO: FixMe! return checksum(self.data()) in self.path
def prepare(self): """ Prepare the file for upload """ payload = self.payload() # Decide whether we'll compress or not. self.payload_checksum = checksum(payload) self.lastUpload = 0
def put_object(self, req): return TestHTTPResponse( 200, headers={"ETag": '"{0}"'.format(checksum(req.body))})
def file_changed_hash(path): info = os.stat(path) hashKey = text_type(info.st_mtime) + text_type(info.st_size) return checksum(hashKey.encode('utf-8'))
def file_changed_hash(path): info = os.stat(path) hashKey = str(info.st_mtime) + str(info.st_size) return checksum(hashKey)
def calculate_file_checksum(path): """ Calculate the MD5 sum for a file (needs to fit in memory) """ with open(path, 'rb') as f: return checksum(f.read())
def put_object(self, req): return TestHTTPResponse(200, headers={"ETag":'"{0}"'.format(checksum(req.body))})