When I run the script, I get an error that the file object does not have
 the attribute getblocks.

 Did you mean this instead?

 def getblocks(f, blocksize=1024):
        while True:
                s = f.read(blocksize)
                if not s: return
                yield s

 def getsum(self):
        md5sum = md5.new()
         f = open(self.file_name, 'rb')
         for line in getblocks(f) :
             md5sum.update(line)
         f.close()
        return md5sum.hexdigest()

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to