From: <sig...@us...> - 2011-07-22 00:38:09
|
Revision: 817 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=817&view=rev Author: siggipals Date: 2011-07-22 00:38:03 +0000 (Fri, 22 Jul 2011) Log Message: ----------- #130 Modified Paths: -------------- pytrainer/trunk/pytrainer/gui/windowmain.py pytrainer/trunk/pytrainer/lib/activity.py pytrainer/trunk/pytrainer/lib/ddbb.py pytrainer/trunk/pytrainer/record.py Modified: pytrainer/trunk/pytrainer/gui/windowmain.py =================================================================== --- pytrainer/trunk/pytrainer/gui/windowmain.py 2011-07-18 10:30:56 UTC (rev 816) +++ pytrainer/trunk/pytrainer/gui/windowmain.py 2011-07-22 00:38:03 UTC (rev 817) @@ -459,7 +459,7 @@ 'rest' : '#808080', } - pic = gtk.gdk.pixbuf_new_from_file(self.data_path+"glade/trigger_%s.png" % lap['trigger']) + pic = gtk.gdk.pixbuf_new_from_file(self.data_path+"glade/trigger_%s.png" % lap['laptrigger']) iter = store.append() store.set(iter, Modified: pytrainer/trunk/pytrainer/lib/activity.py =================================================================== --- pytrainer/trunk/pytrainer/lib/activity.py 2011-07-18 10:30:56 UTC (rev 816) +++ pytrainer/trunk/pytrainer/lib/activity.py 2011-07-22 00:38:03 UTC (rev 817) @@ -285,7 +285,7 @@ raise Exception( "Error - multiple results from DB for id: %s" % self.id ) #Get lap information laps = self.pytrainer_main.ddbb.select_dict("laps", - ("id_lap", "record", "elapsed_time", "distance", "start_lat", "start_lon", "end_lat", "end_lon", "calories", "lap_number", "intensity", "avg_hr", "max_hr", "max_speed", "trigger", "comments"), + ("id_lap", "record", "elapsed_time", "distance", "start_lat", "start_lon", "end_lat", "end_lon", "calories", "lap_number", "intensity", "avg_hr", "max_hr", "max_speed", "laptrigger", "comments"), "record=\"%s\"" % self.id) if laps is None or laps == [] or len(laps) < 1: #No laps found logging.debug("No laps in DB for record %d" % self.id) @@ -674,3 +674,4 @@ except ValueError: _value = str(value) return _value.replace('.',':') + Modified: pytrainer/trunk/pytrainer/lib/ddbb.py =================================================================== --- pytrainer/trunk/pytrainer/lib/ddbb.py 2011-07-18 10:30:56 UTC (rev 816) +++ pytrainer/trunk/pytrainer/lib/ddbb.py 2011-07-22 00:38:03 UTC (rev 817) @@ -76,7 +76,7 @@ "end_lon": "float", "calories": "int", "intensity": "varchar(7)", - "trigger": "varchar(9)", + "laptrigger": "varchar(9)", "max_speed": "float", "avg_hr": "int", "max_hr": "int", @@ -457,12 +457,12 @@ record_ids = set([r[0] for r in self.select("laps","record")]) for record in record_ids: try: - laps = self.select("laps","id_lap, intensity, avg_hr, max_hr, max_speed, `trigger`", "record = %s" % record) + laps = self.select("laps","id_lap, intensity, avg_hr, max_hr, max_speed, laptrigger", "record = %s" % record) gpxfile = self.configuration.gpxdir+"/%s.gpx"%(record) if not laps[0][1] and os.path.isfile(gpxfile) : #GPX file exists for this record - probably not a manual record gpxrecord = gpx.Gpx(filename=gpxfile) for lap, gpxlap in zip(laps, gpxrecord.getLaps()): - self.ddbbObject.update("laps", "intensity, avg_hr, max_hr, max_speed, `trigger`", (gpxlap[7], gpxlap[8], gpxlap[9], gpxlap[10], "%s" % gpxlap[11]), "id_lap = %d" % lap[0]) + self.ddbbObject.update("laps", "intensity, avg_hr, max_hr, max_speed, laptrigger", (gpxlap[7], gpxlap[8], gpxlap[9], gpxlap[10], "%s" % gpxlap[11]), "id_lap = %d" % lap[0]) except Exception as e: print "Error updating record: " + str(record) print e Modified: pytrainer/trunk/pytrainer/record.py =================================================================== --- pytrainer/trunk/pytrainer/record.py 2011-07-18 10:30:56 UTC (rev 816) +++ pytrainer/trunk/pytrainer/record.py 2011-07-22 00:38:03 UTC (rev 817) @@ -352,7 +352,7 @@ def getLaps(self, id_record): logging.debug('--') laps = self.pytrainer_main.ddbb.select("laps", - "id_lap, record, elapsed_time, distance, start_lat, start_lon, end_lat, end_lon, calories, lap_number, intensity, max_speed, avg_hr, max_hr, `trigger`, comments", + "id_lap, record, elapsed_time, distance, start_lat, start_lon, end_lat, end_lon, calories, lap_number, intensity, max_speed, avg_hr, max_hr, laptrigger, comments", "record=\"%s\"" % id_record) if laps is None or laps == []: #No laps stored - update DB logging.debug("No laps in DB for record %d" % id_record) @@ -369,7 +369,7 @@ self.insertLaps(lap_keys,lap.values()) #Try to get lap info again #TODO? refactor laps = self.pytrainer_main.ddbb.select("laps", - "id_lap, record, elapsed_time, distance, start_lat, start_lon, end_lat, end_lon, calories, lap_number, intensity, max_speed, avg_hr, max_hr, `trigger`, comments", + "id_lap, record, elapsed_time, distance, start_lat, start_lon, end_lat, end_lon, calories, lap_number, intensity, max_speed, avg_hr, max_hr, laptrigger, comments", "record=\"%s\"" % id_record) return laps This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |