From 9477865f445604e4cec9e7706c98bbaa7526cf49 Mon Sep 17 00:00:00 2001 From: Gaetan Delannay Date: Tue, 22 May 2012 22:23:54 +0200 Subject: [PATCH] [pod] Bugfix while dumping large size images into pod templates from appy.gen FileWrapper instances. --- pod/doc_importers.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/pod/doc_importers.py b/pod/doc_importers.py index 05a28c2..c2debb5 100644 --- a/pod/doc_importers.py +++ b/pod/doc_importers.py @@ -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, file): - fileContent = self.content.read() - elif isinstance(self.content, FileWrapper): - fileContent = content.content + if isinstance(self.content, FileWrapper): + self.content.dump(self.importPath) else: - fileContent = self.content - f = file(self.importPath, 'wb') - f.write(fileContent) - f.close() - # ImageImporter adds additional, image-specific attrs, through + if isinstance(self.content, file): + fileContent = self.content.read() + else: + fileContent = self.content + f = file(self.importPath, 'wb') + f.write(fileContent) + f.close() + # ImageImporter adds image-specific attrs, through # ImageImporter.setImageInfo. def getImportFolder(self):