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 'charts.py') diff --git a/charts.py b/charts.py index 25f21a4..014dc51 100644 --- a/charts.py +++ b/charts.py @@ -30,8 +30,6 @@ import gobject from sugar.activity import activity -CHART_IMAGE = os.path.join(activity.get_activity_root(), "tmp", "chart.png") - class Chart(gobject.GObject): def __init__(self, type="vertical", width=600, height=460): @@ -127,7 +125,6 @@ class Chart(gobject.GObject): chart.addDataset(self.dataSet) chart.render() - def as_png(self): + def as_png(self, file): '''Save the chart as png image''' - self.surface.write_to_png(CHART_IMAGE) - return CHART_IMAGE + self.surface.write_to_png(file) -- cgit v0.9.1