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