Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAgustin Zubiaga <aguzubiaga97@gmail.com>2012-02-08 23:20:33 (GMT)
committer Agustin Zubiaga <aguzubiaga97@gmail.com>2012-02-08 23:20:33 (GMT)
commit7e94c2a1d171c979941d0974553fd5b8969d08bc (patch)
treed4a7398e20fddbbad89cb4dd949a9b124f3a6d0d
parent37584f755f5a2350e0fd6c98a368bffd02270ded (diff)
pep8 fixes
-rw-r--r--activity.py11
-rw-r--r--readers.py31
2 files changed, 23 insertions, 19 deletions
diff --git a/activity.py b/activity.py
index 656903a..9f54f11 100644
--- a/activity.py
+++ b/activity.py
@@ -91,7 +91,7 @@ logger = logging.getLogger("SimpleGraph")
class ChartArea(gtk.DrawingArea):
-
+
def __init__(self, parent):
super(ChartArea, self).__init__()
self._parent = parent
@@ -100,9 +100,9 @@ class ChartArea(gtk.DrawingArea):
def _expose_cb(self, widget, event):
context = self.window.cairo_create()
-
+
x, y, w, h = self.get_allocation()
-
+
# White Background:
context.rectangle(0, 0, w, h)
context.set_source_rgb(255, 255, 255)
@@ -373,7 +373,7 @@ class SimpleGraph(activity.Activity):
self.current_chart.render(self)
else:
self.current_chart.render()
- self.charts_area.queue_draw()
+ self.charts_area.queue_draw()
return False
@@ -437,7 +437,7 @@ class SimpleGraph(activity.Activity):
jobject.metadata['title'] = self.metadata["title"]
jobject.metadata['mime_type'] = "image/png"
- temp_path = self.current_chart.as_png()
+ temp_path = self.current_chart.as_png()
image = open(temp_path, "r")
jfile = open(CHART_FILE, "w")
@@ -516,6 +516,7 @@ class SimpleGraph(activity.Activity):
self.update_chart()
+
class ChartData(gtk.TreeView):
__gsignals__ = {
diff --git a/readers.py b/readers.py
index bb4224e..6858c60 100644
--- a/readers.py
+++ b/readers.py
@@ -22,27 +22,30 @@
import cPickle
+
class StopWatch():
-
+
def set_data(self, data):
self.data = cPickle.load(data)
-
- def get_stopwatchs_with_marks_count(self):
+
+ def get_stopwatchs_with_marks(self):
count = 0
+ list = []
for i in self.data[-1]:
- if i: count += 1
-
- return count
-
- def marks_to_chart_data(self, num=0):
- chart_data = []
+ if i:
+ count += 1
+ list.append([count, self.data[1][count - 1]])
+
+ return list, count
+
+ def get_stopwatch_name(self, num=0):
+ return self.data[1][num]
+
+ def marks_to_chart_data(self, num=0, chart_data=[]):
marks_count = 0
-
+
for i in self.data[-1][num]:
marks_count += 1
chart_data.append((str(marks_count), i))
-
- return chart_data
-
-
+ return chart_data