Subtract operation for PedoValues
authorandrei1089 <andrei.mirestean@gmail.com>
Thu, 11 Feb 2010 22:14:44 +0000 (00:14 +0200)
committerandrei1089 <andrei.mirestean@gmail.com>
Thu, 11 Feb 2010 22:14:44 +0000 (00:14 +0200)
src/usr/lib/hildon-desktop/pedometer_widget_home.py

index 725e1c5..5e1b735 100644 (file)
@@ -153,6 +153,12 @@ class PedoValues():
                           self.dist + other.dist,
                           self.calories + other.calories)
 
                           self.dist + other.dist,
                           self.calories + other.calories)
 
+    def __sub__(self, other):
+        return PedoValues(self.time - other.time,
+                          self.steps - other.steps,
+                          self.dist - other.dist,
+                          self.calories - other.calories)
+
     def get_print_time(self):
         tdelta = self.time
         hours = int(tdelta / 3600)
     def get_print_time(self):
         tdelta = self.time
         hours = int(tdelta / 3600)