From: yomguy Date: Thu, 17 Feb 2011 11:16:54 +0000 (+0100) Subject: bugfix X-Git-Tag: 1.1~441 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=16be1f4639016f81f82eb61c615bb29125cb0712;p=telemeta.git bugfix --- diff --git a/telemeta/cache.py b/telemeta/cache.py index d8569175..d52e08d7 100644 --- a/telemeta/cache.py +++ b/telemeta/cache.py @@ -78,9 +78,9 @@ class TelemetaCache(object): while True: chunk = f.read(chunk_size) if not len(chunk): - f.close() break yield chunk +# f.close() def write_stream_bin(self, chunk, file_object): file_object.write(chunk) diff --git a/telemeta/templates/telemeta_default/mediaitem_detail.html b/telemeta/templates/telemeta_default/mediaitem_detail.html index fcd7a6f7..4f798e96 100644 --- a/telemeta/templates/telemeta_default/mediaitem_detail.html +++ b/telemeta/templates/telemeta_default/mediaitem_detail.html @@ -96,7 +96,7 @@ {{v.name}} {% endfor %} - +
diff --git a/telemeta/web/base.py b/telemeta/web/base.py index 390095c3..62bdee59 100644 --- a/telemeta/web/base.py +++ b/telemeta/web/base.py @@ -286,13 +286,16 @@ class WebView(object): if not self.cache.exists(image_file): if item.file: + path = self.cache.dir + os.sep + image_file decoder = timeside.decoder.FileDecoder(item.file.path) graph = grapher(width = int(width), height = int(height)) pipe = decoder | graph pipe.run() - graph.render(self.cache.dir + os.sep + image_file) + f = open(path, 'w') + graph.render(path) + f.close() - response = HttpResponse(self.cache.read_stream_bin(image_file), mimetype = mime_type) + response = HttpResponse(self.cache.read_stream_bin(image_file), mimetype=mime_type) return response def list_export_extensions(self):