Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/activity.py
diff options
context:
space:
mode:
authorAgustin Zubiaga <aguz@sugarlabs.org>2012-02-24 22:12:02 (GMT)
committer Agustin Zubiaga <aguz@sugarlabs.org>2012-02-24 22:12:02 (GMT)
commitc0322a6a4003d3f5ff65411168271c13dfc22836 (patch)
tree3515f21ab33d2cfd3916375427e8d4ffb483be21 /activity.py
parentddc6d289afe2d8be8123a7adb392f3e344bd01e8 (diff)
Don't use a temp file for png image
Diffstat (limited to 'activity.py')
-rw-r--r--activity.py11
1 files changed, 1 insertions, 10 deletions
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)