[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 # 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 # first. self.content may be binary, a file handler or a
# FileWrapper. # FileWrapper.
if isinstance(self.content, file): if isinstance(self.content, FileWrapper):
fileContent = self.content.read() self.content.dump(self.importPath)
elif isinstance(self.content, FileWrapper):
fileContent = content.content
else: else:
fileContent = self.content if isinstance(self.content, file):
f = file(self.importPath, 'wb') fileContent = self.content.read()
f.write(fileContent) else:
f.close() fileContent = self.content
# ImageImporter adds additional, image-specific attrs, through f = file(self.importPath, 'wb')
f.write(fileContent)
f.close()
# ImageImporter adds image-specific attrs, through
# ImageImporter.setImageInfo. # ImageImporter.setImageInfo.
def getImportFolder(self): def getImportFolder(self):