示例#1
0
 def show_treeviewEntries_row(self, row):
     '''
     Show details of treeview entry
     TODO need to maintain any changes and display those....
     '''
     logging.debug(">>")
     self.active_row = row
     #Get details from stored data
     #set sport
     sport = self.activity_data[row]["rcd_sport"]
     sportPosition = self.getSportPositionByName(sport)
     if sportPosition is not None:
         self.rcd_sport.set_active(sportPosition)
     #Set gpx file name
     gpx_file = self.activity_data[row]["rcd_gpxfile"]
     self.setValue("rcd_gpxfile", gpx_file, "%s")
     #set duration
     time = time2second(self.activity_data[row]["rcd_time"])      #TODO Fix to use timeinseconds!!
     self.setTime(time)                                                  #TODO Fix to use timeinseconds!!
     #Set distance
     self.setValue("rcd_distance",self.activity_data[row]["rcd_distance"], "%s")
     #Set comments
     buffer = self.rcd_comments.get_buffer()
     start,end = buffer.get_bounds()
     if "rcd_comments" not in self.activity_data[row]:
         self.activity_data[row]["rcd_comments"] = ""
     buffer.set_text(self.activity_data[row]["rcd_comments"])
     while Gtk.events_pending(): # This allows the GUI to update
         Gtk.main_iteration()    # before completion of this entire action
     if self.activity_data[row]["complete"] is False:
         #Haven't processed GPX file yet
         #Blank values not yet known
         self.setValue("rcd_date", "", "%s")
         self.setValue("rcd_starttime", "", "%s")
         self.setValue("rcd_average", "", "%s")
         self.setValue("rcd_calories","", "%s")
         self.setValue("rcd_beats", "", "%s")
         self.setValue("rcd_upositive", "", "%s")
         self.setValue("rcd_unegative", "", "%s")
         self.setValue("rcd_maxvel", "", "%s")
         self.rcd_maxpace.set_text("")
         self.rcd_pace.set_text("")
         self.setValue("rcd_maxbeats", "", "%s")
         while Gtk.events_pending(): # This allows the GUI to update
             Gtk.main_iteration()    # before completion of this entire action
         #Get some info from gpx file
         self.update_activity_data(row, gpx_file, sport)
     self.setValue("rcd_distance",self.activity_data[row]["rcd_distance"], "%s") 
     time = time2second(self.activity_data[row]["rcd_time"])
     self.setTime(time)  
     self.setValue("rcd_date", self.activity_data[row]["rcd_date"], "%s")
     self.setValue("rcd_starttime", self.activity_data[row]["rcd_starttime"], "%s")
     self.setValue("rcd_average",self.activity_data[row]["rcd_average"])
     self.setValue("rcd_calories",self.activity_data[row]["rcd_calories"], "%s")
     self.setValue("rcd_beats",self.activity_data[row]["rcd_beats"], "%s")
     self.setValue("rcd_upositive",self.activity_data[row]["rcd_upositive"], "%s")
     self.setValue("rcd_unegative",self.activity_data[row]["rcd_unegative"], "%s")
     self.setValue("rcd_maxvel",self.activity_data[row]["rcd_maxvel"])
     self.rcd_maxpace.set_text(self.activity_data[row]["rcd_maxpace"])
     self.rcd_pace.set_text(self.activity_data[row]["rcd_pace"])
     self.setValue("rcd_maxbeats",self.activity_data[row]["rcd_maxbeats"], "%s")
     self.rcd_title.set_text(self.activity_data[row]["rcd_title"])
     logging.debug("<<")
示例#2
0
 def show_treeviewEntries_row(self, row):
     '''
     Show details of treeview entry
     TODO need to maintain any changes and display those....
     '''
     logging.debug(">>")
     self.active_row = row
     #Get details from stored data
     #set sport
     sport = self.activity_data[row]["rcd_sport"]
     sportPosition = self.getSportPositionByName(sport)
     if sportPosition is not None:
         self.rcd_sport.set_active(sportPosition)
     #Set gpx file name
     gpx_file = self.activity_data[row]["rcd_gpxfile"]
     self.setValue("rcd_gpxfile", gpx_file, "%s")
     #set duration
     time = time2second(self.activity_data[row]["rcd_time"])      #TODO Fix to use timeinseconds!!
     self.setTime(time)                                                  #TODO Fix to use timeinseconds!!
     #Set distance
     self.setValue("rcd_distance",self.activity_data[row]["rcd_distance"], "%s")
     #Set comments
     buffer = self.rcd_comments.get_buffer()
     start,end = buffer.get_bounds()
     if "rcd_comments" not in self.activity_data[row]:
         self.activity_data[row]["rcd_comments"] = ""
     buffer.set_text(self.activity_data[row]["rcd_comments"])
     while Gtk.events_pending(): # This allows the GUI to update
         Gtk.main_iteration()    # before completion of this entire action
     if self.activity_data[row]["complete"] is False:
         #Haven't processed GPX file yet
         #Blank values not yet known
         self.setValue("rcd_date", "", "%s")
         self.setValue("rcd_starttime", "", "%s")
         self.setValue("rcd_average", "", "%s")
         self.setValue("rcd_calories","", "%s")
         self.setValue("rcd_beats", "", "%s")
         self.setValue("rcd_upositive", "", "%s")
         self.setValue("rcd_unegative", "", "%s")
         self.setValue("rcd_maxvel", "", "%s")
         self.rcd_maxpace.set_text("")
         self.rcd_pace.set_text("")
         self.setValue("rcd_maxbeats", "", "%s")
         while Gtk.events_pending(): # This allows the GUI to update
             Gtk.main_iteration()    # before completion of this entire action
         #Get some info from gpx file
         self.update_activity_data(row, gpx_file, sport)
     self.setValue("rcd_distance",self.activity_data[row]["rcd_distance"], "%s") 
     time = time2second(self.activity_data[row]["rcd_time"])
     self.setTime(time)  
     self.setValue("rcd_date", self.activity_data[row]["rcd_date"], "%s")
     self.setValue("rcd_starttime", self.activity_data[row]["rcd_starttime"], "%s")
     self.setValue("rcd_average",self.activity_data[row]["rcd_average"])
     self.setValue("rcd_calories",self.activity_data[row]["rcd_calories"], "%s")
     self.setValue("rcd_beats",self.activity_data[row]["rcd_beats"], "%s")
     self.setValue("rcd_upositive",self.activity_data[row]["rcd_upositive"], "%s")
     self.setValue("rcd_unegative",self.activity_data[row]["rcd_unegative"], "%s")
     self.setValue("rcd_maxvel",self.activity_data[row]["rcd_maxvel"])
     self.rcd_maxpace.set_text(self.activity_data[row]["rcd_maxpace"])
     self.rcd_pace.set_text(self.activity_data[row]["rcd_pace"])
     self.setValue("rcd_maxbeats",self.activity_data[row]["rcd_maxbeats"], "%s")
     self.rcd_title.set_text(self.activity_data[row]["rcd_title"])
     logging.debug("<<")
示例#3
0
 def test_time2second(self):
     tmp = time2second((1, 5, 12))
     self.assertEqual(3912, tmp)
示例#4
0
 def test_time2second(self):
     tmp = time2second((1, 5, 12))
     self.assertEqual(3912, tmp)