From c0322a6a4003d3f5ff65411168271c13dfc22836 Mon Sep 17 00:00:00 2001 From: Agustin Zubiaga Date: Fri, 24 Feb 2012 22:12:02 +0000 Subject: Don't use a temp file for png image --- (limited to 'activity.py') diff --git a/activity.py b/activity.py index 9212263..bb6f776 100644 --- a/activity.py +++ b/activity.py @@ -660,16 +660,7 @@ params=%r state=%d' % (id, initiator, type, service, params, state)) jobject.metadata['title'] = self.metadata["title"] jobject.metadata['mime_type'] = "image/png" - temp_path = self.current_chart.as_png() - - image = open(temp_path, "r") - jfile = open(CHART_FILE, "w") - - jfile.write(image.read()) - - jfile.close() - image.close() - + self.current_chart.as_png(CHART_FILE) jobject.set_file_path(CHART_FILE) datastore.write(jobject) -- cgit v0.9.1