def setFile(self, value, **kwargs): """Saves file and stores flash informations (size, flash version)""" ATFile.setFile(self, value, **kwargs) data_sample = str(self.getFile())[:1024] if len(data_sample): tags = analyseContent(data_sample) self.width = tags['width'] self.height = tags['height'] self.flashversion = tags['flashversion']
def setFile(self, value, **kwargs): """Saves file and stores flash informations (size, flash version)""" ATFile.setFile(self, value, **kwargs) if value: value.seek(0) # rewind tags = analyseContent(value.read(1024)) self.setWidth(tags['width']) self.setHeight(tags['height']) self.setFlashversion(tags['flashversion'])