def setFileSize(self): "Store the file size of this object" try: fileSize = utility.fileSizeString(self.image.size) self.setObject('fileSize', fileSize) except AttributeError: pass
def setFileSize(self): "Store the file size of this object" try: #0 length files should not have this field set size = self.data.size if size: fileSize = utility.fileSizeString(size) self.setObject('fileSize', fileSize) except AttributeError: pass