[pod] Bugfix while dumping large size images into pod templates from appy.gen FileWrapper instances.

This commit is contained in:
Gaetan Delannay 2012-05-22 22:23:54 +02:00
parent e66daeb151
commit 9477865f44

View file

@ -68,16 +68,17 @@ class DocImporter:
# We need to dump the file content (in self.content) in a temp file
# first. self.content may be binary, a file handler or a
# FileWrapper.
if isinstance(self.content, FileWrapper):
self.content.dump(self.importPath)
else:
if isinstance(self.content, file):
fileContent = self.content.read()
elif isinstance(self.content, FileWrapper):
fileContent = content.content
else:
fileContent = self.content
f = file(self.importPath, 'wb')
f.write(fileContent)
f.close()
# ImageImporter adds additional, image-specific attrs, through
# ImageImporter adds image-specific attrs, through
# ImageImporter.setImageInfo.
def getImportFolder(self):