You can subscribe to this list here.
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2009 |
Jan
|
Feb
(1) |
Mar
(15) |
Apr
(20) |
May
(2) |
Jun
(9) |
Jul
(3) |
Aug
(2) |
Sep
(17) |
Oct
(16) |
Nov
(38) |
Dec
(40) |
2010 |
Jan
(51) |
Feb
(11) |
Mar
(24) |
Apr
(31) |
May
(24) |
Jun
(3) |
Jul
(9) |
Aug
(1) |
Sep
(29) |
Oct
(33) |
Nov
(81) |
Dec
(6) |
2011 |
Jan
(2) |
Feb
(4) |
Mar
(13) |
Apr
(4) |
May
(24) |
Jun
(4) |
Jul
(19) |
Aug
(46) |
Sep
(10) |
Oct
(28) |
Nov
(31) |
Dec
|
From: <jb...@us...> - 2010-04-04 10:30:53
|
Revision: 543 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=543&view=rev Author: jblance Date: 2010-04-04 10:30:47 +0000 (Sun, 04 Apr 2010) Log Message: ----------- Fixes to waypoint code - no longer duplicates type, selects last added and correctly deals with drag and drop of waypoints Modified Paths: -------------- pytrainer/trunk/pytrainer/extensions/waypointeditor.py pytrainer/trunk/pytrainer/gui/windowmain.py pytrainer/trunk/pytrainer/main.py pytrainer/trunk/pytrainer/waypoint.py Modified: pytrainer/trunk/pytrainer/extensions/waypointeditor.py =================================================================== --- pytrainer/trunk/pytrainer/extensions/waypointeditor.py 2010-04-03 06:21:07 UTC (rev 542) +++ pytrainer/trunk/pytrainer/extensions/waypointeditor.py 2010-04-04 10:30:47 UTC (rev 543) @@ -30,7 +30,7 @@ import logging class WaypointEditor: - def __init__(self, data_path = None, vbox = None, waypoint=None): + def __init__(self, data_path = None, vbox = None, waypoint=None, parent=None): logging.debug(">>") self.data_path = data_path self.conf = checkConf() @@ -41,11 +41,12 @@ vbox.show_all() self.htmlfile = "" self.waypoint=waypoint + self.pytrainer_main=parent logging.debug("<<") def handle_title_changed(self, *args): title = self.moz.get_title() - print "Received title", title + logging.debug("Received title: "+ title) m = re.match("call:([a-zA-Z]*)[(](.*)[)]", title) if m: fname = m.group(1) @@ -55,21 +56,26 @@ if am: lon, lat = am.group(1), am.group(2) lon, lat = float(lon), float(lat) - self.waypoint.addWaypoint(lon, lat, "NEW WAYPOINT") + id_waypoint = self.waypoint.addWaypoint(lon, lat, "NEW WAYPOINT") + self.pytrainer_main.refreshWaypointView(default_waypoint=id_waypoint) else: raise ValueError("Error parsing addWaypoint parameters: %s" % args) elif fname == "updateWaypoint": am = re.match("([+-]?[0-9]+[.][0-9]+),([+-]?[0-9]+[.][0-9]+),([0-9]*)", args) if am: lon, lat, id_waypoint = am.group(1), am.group(2), am.group(3) - lon, lat, id_waypoint = float(lon), float(lat), int(id_waypoint) + try: + lon, lat, id_waypoint = float(lon), float(lat), int(id_waypoint) + except ValueError as e: + print "Error parsing addWaypoint parameters: " % args + print e retorno = self.waypoint.getwaypointInfo(id_waypoint) if retorno: name, comment, sym = retorno[0][5], retorno[0][3], retorno[0][6] self.waypoint.updateWaypoint(id_waypoint, lat, lon, name, comment, sym) + self.pytrainer_main.refreshWaypointView(default_waypoint=id_waypoint) else: raise KeyError("Unknown waypoint id %d", id_waypoint) - self.waypoint.addWaypoint(lon, lat, "NEW WAYPOINT") else: raise ValueError("Error parsing addWaypoint parameters: %s" % args) else: Modified: pytrainer/trunk/pytrainer/gui/windowmain.py =================================================================== --- pytrainer/trunk/pytrainer/gui/windowmain.py 2010-04-03 06:21:07 UTC (rev 542) +++ pytrainer/trunk/pytrainer/gui/windowmain.py 2010-04-04 10:30:47 UTC (rev 543) @@ -695,13 +695,28 @@ self.waypoint_longitude.set_text(str(record_list[default_id][2])) self.waypoint_name.set_text(str(record_list[default_id][6])) self.waypoint_description.set_text(str(record_list[default_id][4])) - self.waypoint_type.insert_text(0,str(record_list[default_id][7])) - self.waypoint_type.set_active(0) + self.set_waypoint_type(str(record_list[default_id][7])) if redrawmap == 1: self.waypointeditor.createHtml(default_waypoint) self.waypointeditor.drawMap() logging.debug("<<") + def set_waypoint_type(self, type): + x = 0 + tree_model = self.waypoint_type.get_model() + if tree_model is not None: + #iter = tree_model.get_iter_root() + for item in tree_model: + #if isinstance(item, gtk.TreeModelRow): + if item[0] == type: + self.waypoint_type.set_active(x) + return + x += 1 + self.waypoint_type.insert_text(0, type) + self.waypoint_type.set_active(0) + return + + def on_waypointTreeView_button_press(self, treeview, event): x = int(event.x) y = int(event.y) @@ -791,8 +806,8 @@ menuItems[numcolumn-1].set_active(visible) self.menublocking = 1 - def createWaypointEditor(self,WaypointEditor,waypoint): - self.waypointeditor = WaypointEditor(self.data_path, self.waypointvbox,waypoint) + def createWaypointEditor(self,WaypointEditor,waypoint, parent=None): + self.waypointeditor = WaypointEditor(self.data_path, self.waypointvbox,waypoint,parent) ###################### ## Lista de eventos ## Modified: pytrainer/trunk/pytrainer/main.py =================================================================== --- pytrainer/trunk/pytrainer/main.py 2010-04-03 06:21:07 UTC (rev 542) +++ pytrainer/trunk/pytrainer/main.py 2010-04-04 10:30:47 UTC (rev 543) @@ -157,7 +157,7 @@ self.loadExtensions() self.windowmain.createGraphs(RecordGraph,DayGraph,WeekGraph, MonthGraph,YearGraph,HeartRateGraph) self.windowmain.createMap(Googlemaps,self.waypoint, self.gm3) - self.windowmain.createWaypointEditor(WaypointEditor,self.waypoint) + self.windowmain.createWaypointEditor(WaypointEditor,self.waypoint, parent=self) self.windowmain.on_calendar_selected(None) self.refreshMainSportList() self.windowmain.run() Modified: pytrainer/trunk/pytrainer/waypoint.py =================================================================== --- pytrainer/trunk/pytrainer/waypoint.py 2010-04-03 06:21:07 UTC (rev 542) +++ pytrainer/trunk/pytrainer/waypoint.py 2010-04-04 10:30:47 UTC (rev 543) @@ -36,6 +36,7 @@ def removeWaypoint(self,id_waypoint): logging.debug(">>") self.ddbb.connect() + logging.debug("Deleting id_waypoint=%s" %id_waypoint) self.ddbb.delete("waypoints", "id_waypoint=\"%s\"" %id_waypoint) self.ddbb.disconnect() logging.debug("<<") @@ -43,6 +44,7 @@ def updateWaypoint(self,id_waypoint,lat,lon,name,desc,sym): logging.debug(">>") self.ddbb.connect() + logging.debug("Updating waypoint id: %d with lat %s,lon %s,comment %s,name %s,sym %s" %(id_waypoint,lat,lon,desc,name,sym) ) self.ddbb.update("waypoints","lat,lon,comment,name,sym",[lat,lon,desc,name,sym]," id_waypoint=%d" %id_waypoint) self.ddbb.disconnect() logging.debug("<<") @@ -52,10 +54,12 @@ self.ddbb.connect() cells = "lat,lon,comment,name,sym" values = (lat,lon,comment,name,sym) + logging.debug("Adding waypoint with details lat %s,lon %s,comment %s,name %s,sym %s" % (lat,lon,comment,name,sym) ) self.ddbb.insert("waypoints",cells,values) id_waypoint = self.ddbb.lastRecord("waypoints") self.ddbb.disconnect() logging.debug("<<") + return id_waypoint def getwaypointInfo(self,id_waypoint): logging.debug(">>") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jb...@us...> - 2010-04-03 06:21:13
|
Revision: 542 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=542&view=rev Author: jblance Date: 2010-04-03 06:21:07 +0000 (Sat, 03 Apr 2010) Log Message: ----------- Remove bugs that cause errors if no GPX data is present for an entry Modified Paths: -------------- pytrainer/trunk/pytrainer/gui/windowmain.py pytrainer/trunk/pytrainer/lib/gpx.py pytrainer/trunk/pytrainer/main.py Modified: pytrainer/trunk/pytrainer/gui/windowmain.py =================================================================== --- pytrainer/trunk/pytrainer/gui/windowmain.py 2010-03-25 19:37:07 UTC (rev 541) +++ pytrainer/trunk/pytrainer/gui/windowmain.py 2010-04-03 06:21:07 UTC (rev 542) @@ -264,6 +264,7 @@ logging.debug(">>") if len(record_list)>0: self.record_vbox.set_sensitive(1) + self.drawarearecord.drawgraph(record_list,laps) else: #Remove graph vboxChildren = self.record_vbox.get_children() @@ -275,8 +276,6 @@ logging.debug('Removing child: '+str(child)) self.record_vbox.remove(child) self.record_vbox.set_sensitive(0) - #logging.debug("Going to draw "+str(record_list)) - self.drawarearecord.drawgraph(record_list,laps) logging.debug("<<") def actualize_heartrategraph(self,record_list): Modified: pytrainer/trunk/pytrainer/lib/gpx.py =================================================================== --- pytrainer/trunk/pytrainer/lib/gpx.py 2010-03-25 19:37:07 UTC (rev 541) +++ pytrainer/trunk/pytrainer/lib/gpx.py 2010-04-03 06:21:07 UTC (rev 542) @@ -69,6 +69,7 @@ self.date = "" #self.Date = Date() self.calories= 0 + self.tree = None if filename != None: if not os.path.isfile(self.filename): return None @@ -145,6 +146,8 @@ def getLaps(self): logging.debug(">>") lapInfo = [] + if self.tree is None: + return lapInfo tree = self.tree #date = tree.findtext(timeTag) #startTime = self.getDateTime(date) Modified: pytrainer/trunk/pytrainer/main.py =================================================================== --- pytrainer/trunk/pytrainer/main.py 2010-03-25 19:37:07 UTC (rev 541) +++ pytrainer/trunk/pytrainer/main.py 2010-04-03 06:21:07 UTC (rev 542) @@ -63,7 +63,7 @@ class pyTrainer: def __init__(self,filename = None, data_path = None): #Version constants - self.version ="1.7.1_svn#541" + self.version ="1.7.1_svn#542" self.DB_version = 3 #Setup usage and permitted options @@ -292,16 +292,17 @@ self.windowmain.actualize_recordview(record_list) if view=="graphs": - selected,iter = self.windowmain.recordTreeView.get_selection().get_selected() - gpx_tracklist = [] - if iter: + selected,iter = self.windowmain.recordTreeView.get_selection().get_selected() + gpx_tracklist = [] + gpx_laps = None + if iter: id_record = selected.get_value(iter,0) gpxfile = self.conf.getValue("gpxdir")+"/%s.gpx" %id_record if os.path.isfile(gpxfile): gpx = Gpx(self.data_path,gpxfile) gpx_tracklist = gpx.getTrackList() gpx_laps = self.record.getLaps(id_record) - self.windowmain.actualize_recordgraph(gpx_tracklist, gpx_laps) + self.windowmain.actualize_recordgraph(gpx_tracklist, gpx_laps) if view=="map": self.refreshMapView() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dg...@us...> - 2010-03-25 19:37:13
|
Revision: 541 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=541&view=rev Author: dgranda Date: 2010-03-25 19:37:07 +0000 (Thu, 25 Mar 2010) Log Message: ----------- Patch to support 'with' statement in python < 2.6 Modified Paths: -------------- pytrainer/trunk/import/file_garmintools.py pytrainer/trunk/plugins/garmintools/garmintools.py pytrainer/trunk/plugins/garmintools_full/garmintools_full.py pytrainer/trunk/pytrainer/main.py Modified: pytrainer/trunk/import/file_garmintools.py =================================================================== --- pytrainer/trunk/import/file_garmintools.py 2010-03-21 09:59:37 UTC (rev 540) +++ pytrainer/trunk/import/file_garmintools.py 2010-03-25 19:37:07 UTC (rev 541) @@ -17,6 +17,9 @@ #along with this program; if not, write to the Free Software #Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Added to support python installations older than 2.6 +from __future__ import with_statement + import logging import os import StringIO Modified: pytrainer/trunk/plugins/garmintools/garmintools.py =================================================================== --- pytrainer/trunk/plugins/garmintools/garmintools.py 2010-03-21 09:59:37 UTC (rev 540) +++ pytrainer/trunk/plugins/garmintools/garmintools.py 2010-03-25 19:37:07 UTC (rev 541) @@ -17,6 +17,9 @@ #along with this program; if not, write to the Free Software #Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Added to support python installations older than 2.6 +from __future__ import with_statement + import logging import os import StringIO Modified: pytrainer/trunk/plugins/garmintools_full/garmintools_full.py =================================================================== --- pytrainer/trunk/plugins/garmintools_full/garmintools_full.py 2010-03-21 09:59:37 UTC (rev 540) +++ pytrainer/trunk/plugins/garmintools_full/garmintools_full.py 2010-03-25 19:37:07 UTC (rev 541) @@ -17,18 +17,22 @@ #along with this program; if not, write to the Free Software #Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Added to support python installations older than 2.6 +from __future__ import with_statement + import os import sys import logging import fnmatch import commands import StringIO +import traceback +import dateutil.parser + from lxml import etree from pytrainer.lib.xmlUtils import XMLParser -import dateutil.parser from datetime import date, timedelta, datetime from dateutil.tz import * # for tzutc() -import traceback class garmintools_full(): """ Plugin to import from a Garmin device using garmintools Modified: pytrainer/trunk/pytrainer/main.py =================================================================== --- pytrainer/trunk/pytrainer/main.py 2010-03-21 09:59:37 UTC (rev 540) +++ pytrainer/trunk/pytrainer/main.py 2010-03-25 19:37:07 UTC (rev 541) @@ -63,7 +63,7 @@ class pyTrainer: def __init__(self,filename = None, data_path = None): #Version constants - self.version ="1.7.1_svn#540" + self.version ="1.7.1_svn#541" self.DB_version = 3 #Setup usage and permitted options This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jb...@us...> - 2010-03-21 09:59:43
|
Revision: 540 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=540&view=rev Author: jblance Date: 2010-03-21 09:59:37 +0000 (Sun, 21 Mar 2010) Log Message: ----------- Openstreetmap upload extension code complete Modified Paths: -------------- pytrainer/trunk/extensions/openstreetmap/openstreetmap.py pytrainer/trunk/pytrainer/main.py Modified: pytrainer/trunk/extensions/openstreetmap/openstreetmap.py =================================================================== --- pytrainer/trunk/extensions/openstreetmap/openstreetmap.py 2010-03-20 16:36:53 UTC (rev 539) +++ pytrainer/trunk/extensions/openstreetmap/openstreetmap.py 2010-03-21 09:59:37 UTC (rev 540) @@ -1,18 +1,167 @@ #!/usr/bin/env python from optparse import OptionParser -import os +import os, stat import sys +import logging +import gtk +import httplib, httplib2 +import urllib2 +import mimetools, mimetypes + class openstreetmap: def __init__(self, parent = None, pytrainer_main = None, conf_dir = None, options = None): - #TODO could use some logging self.parent = parent self.pytrainer_main = pytrainer_main self.options = options self.conf_dir = conf_dir + self.description = " " + self.tags = "" + self.visibility = "private" def run(self, id): - options = self.options - print options - print "Record id: %s" % str(id) - print "THIS DOESNT WORK YET!!!!" + logging.debug(">>") + uri = "http://api.openstreetmap.org/api/0.6/gpx/create" #URI for uploading traces to OSM + if 'username' not in self.options or self.options['username'] == "" or 'password' not in self.options or self.options['password'] == "": + logging.error("Must have username and password configured") + msg = _("Must have username and password configured") + md = gtk.MessageDialog(self.pytrainer_main.windowmain.window1, gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_ERROR, gtk.BUTTONS_CLOSE, msg) + md.set_title(_("Openstreetmap Extension Error")) + md.run() + md.destroy() + return + username = self.options['username'] + password = self.options['password'] + gpx_file = "%s/gpx/%s.gpx" % (self.conf_dir, id) + if os.path.isfile(gpx_file): + #GPX file is ok and found, so open it + logging.debug("GPX file: %s found, size: %d" % (gpx_file, os.path.getsize(gpx_file))) + f = open(gpx_file, 'r') + file_contents = f.read() + if file_contents.find("<?xml version='1.0' encoding='ASCII'?>") != -1: + logging.debug("GPX file: %s has ASCII encoding - updating to UTF-8 for OSM support" % gpx_file) + f.close() #Close readonly file + f = open(gpx_file, 'w') #and open file for writing + file_contents = file_contents.replace("<?xml version='1.0' encoding='ASCII'?>","<?xml version='1.0' encoding='UTF-8'?>", 1) + f.write(file_contents) #Write new content + f.close() #Close + f = open(gpx_file, 'r') #Reopen in readonly mode + #Get extra info from user + self.display_options_window() + fields = (("description",self.description), ("tags",self.tags), ("visibility",self.visibility)) + logging.debug("Added fields: %s" % str(fields)) + #Multipart encode the request + boundary, body = self.multipart_encode(fields=fields, files=(("file", f),)) + content_type = 'multipart/form-data; boundary=%s' % boundary + #Finished with the file so close it + f.close() + #Add the http headers to the request + h = httplib2.Http() + headers = { + 'Content-Type': content_type + } + #Add basic authentication credentials to the request + h.add_credentials(username, password) + #Show user something is happening + msg = _("Posting GPX trace to Openstreetmap\n\nPlease wait this could take several minutes") + md = gtk.MessageDialog(self.pytrainer_main.windowmain.window1, gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_INFO, gtk.BUTTONS_NONE, msg) + md.set_title(_("Openstreetmap Extension Processing")) + md.set_modal(True) + md.show() + while gtk.events_pending(): # This allows the GUI to update + gtk.main_iteration() # before completion of this entire action + logging.debug("before request posting") + #POST request to OSM + res, content = h.request(uri, 'POST', body=body, headers=headers) + logging.debug("after request posting") + logging.debug("Got response status: %s, reason: %s, content: %s" % (res.status, res.reason, content)) + if res.reason == 'OK': + res_msg = "Successfully posted to OSM.\nYou should get an email with the outcome of the upload soon\n\nTrace id is %s" % content + else: + res_msg = "Some error occured\nGot a status %s, reason %s\nContent was: %s" % (res.status, res.reason, content) + #Close 'Please wait' dialog + md.destroy() + #Show the user the result + md = gtk.MessageDialog(self.pytrainer_main.windowmain.window1, gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_INFO, gtk.BUTTONS_OK, res_msg) + md.set_title(_("Openstreetmap Extension Upload Complete")) + md.set_modal(False) + md.run() + md.destroy() + + else: + logging.error("GPX file: %s NOT found!!!" % (gpx_file)) + logging.debug("<<") + + def display_options_window(self): + self.prefwindow = gtk.Dialog(title=_("Please add any additional information for this upload"), parent=None, flags=gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT, buttons=(gtk.STOCK_OK, gtk.RESPONSE_ACCEPT)) + self.prefwindow.set_modal(False) + table = gtk.Table(1,2) + self.entryList = [] + #Add description + label = gtk.Label("<b>Description</b>") + label.set_use_markup(True) + entry = gtk.Entry() + self.entryList.append(entry) + table.attach(label,0,1,0,1) + table.attach(entry,1,2,0,1) + #Add tags + label = gtk.Label("<b>Tags</b>") + label.set_use_markup(True) + entry = gtk.Entry() + self.entryList.append(entry) + table.attach(label,0,1,1,2) + table.attach(entry,1,2,1,2) + #Add visibility + label = gtk.Label("<b>Visibility</b>") + label.set_use_markup(True) + combobox = gtk.combo_box_new_text() + combobox.append_text("private") + combobox.append_text("public") + combobox.append_text("trackable") + combobox.append_text("identifiable") + combobox.set_active(0) + table.attach(combobox,1,2,2,3) + self.entryList.append(combobox) + table.attach(label,0,1,2,3) + #Buld dialog and show + self.prefwindow.vbox.pack_start(table) + self.prefwindow.show_all() + self.prefwindow.connect("response", self.on_options_ok_clicked) + self.prefwindow.run() + + def on_options_ok_clicked(self, widget, response_id): + widget.destroy() + self.description = self.entryList[0].get_text() + if self.description == "": + logging.debug("A description is required - setting to default") + self.description = "Uploaded from pytrainer" + self.tags = self.entryList[1].get_text() + self.visibility = self.entryList[2].get_active_text() + logging.debug("Description: %s, tags: %s, visibility: %s" % ( self.description, self.tags, self.visibility) ) + + def multipart_encode(self, fields, files, boundary = None, buffer = None): + ''' + Multipart encode data for posting + from examples at from http://odin.himinbi.org/MultipartPostHandler.py & http://bitworking.org/projects/httplib2/doc/html/libhttplib2.html + ''' + if boundary is None: + boundary = mimetools.choose_boundary() + if buffer is None: + buffer = '' + for (key, value) in fields: + buffer += '--%s\r\n' % boundary + buffer += 'Content-Disposition: form-data; name="%s"' % key + buffer += '\r\n\r\n' + value + '\r\n' + print files + for (key, fd) in files: + file_size = os.fstat(fd.fileno())[stat.ST_SIZE] + filename = os.path.basename(fd.name) + contenttype = mimetypes.guess_type(filename)[0] or 'application/octet-stream' + buffer += '--%s\r\n' % boundary + buffer += 'Content-Disposition: form-data; name="%s"; filename="%s"\r\n' % (key, filename) + buffer += 'Content-Type: %s\r\n' % contenttype + # buffer += 'Content-Length: %s\r\n' % file_size + fd.seek(0) + buffer += '\r\n' + fd.read() + '\r\n' + buffer += '--%s--\r\n\r\n' % boundary + return boundary, buffer Modified: pytrainer/trunk/pytrainer/main.py =================================================================== --- pytrainer/trunk/pytrainer/main.py 2010-03-20 16:36:53 UTC (rev 539) +++ pytrainer/trunk/pytrainer/main.py 2010-03-21 09:59:37 UTC (rev 540) @@ -63,7 +63,7 @@ class pyTrainer: def __init__(self,filename = None, data_path = None): #Version constants - self.version ="1.7.1_svn#538" + self.version ="1.7.1_svn#540" self.DB_version = 3 #Setup usage and permitted options This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dg...@us...> - 2010-03-20 16:37:00
|
Revision: 539 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=539&view=rev Author: dgranda Date: 2010-03-20 16:36:53 +0000 (Sat, 20 Mar 2010) Log Message: ----------- Updating ES localization for unified import Modified Paths: -------------- pytrainer/trunk/locale/es/LC_MESSAGES/pytrainer.mo pytrainer/trunk/locale/es/LC_MESSAGES/pytrainer_es.po Modified: pytrainer/trunk/locale/es/LC_MESSAGES/pytrainer.mo =================================================================== (Binary files differ) Modified: pytrainer/trunk/locale/es/LC_MESSAGES/pytrainer_es.po =================================================================== --- pytrainer/trunk/locale/es/LC_MESSAGES/pytrainer_es.po 2010-03-19 06:52:10 UTC (rev 538) +++ pytrainer/trunk/locale/es/LC_MESSAGES/pytrainer_es.po 2010-03-20 16:36:53 UTC (rev 539) @@ -7,8 +7,8 @@ msgstr "" "Project-Id-Version: pytrainer 1.7.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-01-25 21:14+0100\n" -"PO-Revision-Date: 2010-01-25 21:09+0100\n" +"POT-Creation-Date: 2010-03-20 17:33+0100\n" +"PO-Revision-Date: 2010-03-20 17:33+0100\n" "Last-Translator: David García Granda <dg...@gm...>\n" "Language-Team: Spanish <es...@li...>\n" "MIME-Version: 1.0\n" @@ -20,9 +20,49 @@ msgid "Calendar" msgstr "Calendario" -#: glade/importdata.glade:7 glade/importdata.glade:279 +#: glade/extensions.glade:9 +#: glade/pytrainer.glade:201 +msgid "Extensions" +msgstr "Extensiones" + +#: glade/extensions.glade:54 +msgid "<b>Extension Details</b>" +msgstr "<b>Detalles de la extensión</b>" + +#: glade/extensions.glade:67 +msgid "name-entry" +msgstr "Nombre" + +#: glade/extensions.glade:82 +#: glade/plugins.glade:144 +#: glade/profile.glade:1279 +msgid "Name:" +msgstr "Nombre:" + +#: glade/extensions.glade:96 +#: glade/plugins.glade:115 +msgid "Status:" +msgstr "Estado:" + +#: glade/extensions.glade:110 +#: glade/plugins.glade:86 +#: glade/pytrainer.glade:8163 +msgid "Description:" +msgstr "<b>Descripción:</b>" + +#: glade/extensions.glade:124 +#: glade/plugins.glade:100 +msgid "status-entry" +msgstr "Estado" + +#: glade/extensions.glade:139 +msgid "description-entry" +msgstr "Descripción" + +#: glade/importdata.glade:7 +#: glade/importdata.glade:329 msgid "Import" -msgstr "_Importar" +msgstr "Importar" #: glade/importdata.glade:37 msgid "" @@ -36,212 +76,262 @@ msgid "<b>Select your GPS device</b>" msgstr "<b>Seleccione su dispositivo GPS</b>" -#: glade/importdata.glade:83 +#: glade/importdata.glade:65 +msgid "Import from GPS Device is not yet implemented" +msgstr "Importar desde dispositivo GPS todavía no disponible" + +#: glade/importdata.glade:94 msgid "<b>Tools</b>" msgstr "<b>Herramientas</b>" -#: glade/importdata.glade:102 +#: glade/importdata.glade:113 msgid "Rescan" msgstr "Examinar de nuevo" -#: glade/importdata.glade:106 +#: glade/importdata.glade:117 msgid "Rescan system for available tools" msgstr "Buscando de nuevo herramientas disponibles en el sistema" -#: glade/importdata.glade:159 +#: glade/importdata.glade:170 msgid "<b>Import from GPS Device</b>" -msgstr "<b>Importar desde el dispositivo GPS</b>" +msgstr "<b>Importar desde dispositivo GPS</b>" -#: glade/importdata.glade:197 -msgid "Clear" -msgstr "Limpiar" +#: glade/importdata.glade:225 +msgid "Remove selected files and the associated activities" +msgstr "Borrar ficheros seleccionados y actividades asociadas" -#: glade/importdata.glade:218 -msgid "<b>Select a file to import</b>" -msgstr "<b>Seleccionar fichero a importar</b>" +#: glade/importdata.glade:243 +msgid "Add files to import activities from" +msgstr "Añadir ficheros desde los importar actividades" -#: glade/importdata.glade:261 -msgid "<b>Select Activities to Import</b>" +#: glade/importdata.glade:268 +msgid "<b>Add file(s) to import activities from</b>" +msgstr "<b>Añadir fichero(s) desde el/los que importar actividades</b>" + +#: glade/importdata.glade:311 +msgid "<b>Select activities to import</b>" msgstr "<b>Seleccionar actividades para importar</b>" -#: glade/importdata.glade:339 +#: glade/importdata.glade:334 +msgid "Import selected activities" +msgstr "Importadas %d actividades" + +#: glade/importdata.glade:351 +msgid "Close Import dialog" +msgstr "Cerrar proceso de importación" + +#: glade/importdata.glade:391 msgid "<b>Import from File</b>" msgstr "<b>Importar desde fichero</b>" -#: glade/importdata.glade:364 +#: glade/importdata.glade:470 msgid "<b>Plugins</b>" msgstr "<b>Plugins</b>" -#: glade/importdata.glade:392 +#: glade/importdata.glade:499 msgid "Import from GPS Device" -msgstr "Importar desde el dispositivo GPS" +msgstr "Importar desde dispositivo GPS" -#: glade/importdata.glade:408 +#: glade/importdata.glade:518 msgid "Import from File" msgstr "Importar desde fichero" -#: glade/importdata.glade:430 +#: glade/importdata.glade:533 +msgid "Launch 'File Select' on start" +msgstr "Arrancar 'Selección de fichero' en el comienzo" + +#: glade/importdata.glade:538 +msgid "Automatically start the file selection dialog" +msgstr "Lanzar proceso de selección de fichero automáticamente" + +#: glade/importdata.glade:554 +#: glade/plugins.glade:9 +msgid "Plugins" +msgstr "Plugins" + +#: glade/importdata.glade:580 msgid "<b>Default to Tab</b>" msgstr "<b>Pestaña por defecto</b>" -#: glade/importdata.glade:453 +#: glade/importdata.glade:603 msgid "Reset" msgstr "Resetear" -#: glade/importdata.glade:469 +#: glade/importdata.glade:619 msgid "Save" msgstr "Guardar" -#: glade/importdata.glade:528 +#: glade/importdata.glade:678 msgid "<b>Options</b>" -msgstr "<b>Opciones:</b>" +msgstr "<b>Opciones</b>" #: glade/newrecord.glade:7 msgid "New Entry" msgstr "Nueva entrada" -#: glade/newrecord.glade:46 +#: glade/newrecord.glade:63 msgid "Title:" msgstr "Título:" -#: glade/newrecord.glade:69 +#: glade/newrecord.glade:87 msgid "GPX File:" msgstr "Archivo GPX:" -#: glade/newrecord.glade:113 +#: glade/newrecord.glade:131 msgid "Calculate Values" msgstr "Calcular valores" -#: glade/newrecord.glade:133 +#: glade/newrecord.glade:151 msgid "Sport:" msgstr "Deporte:" -#: glade/newrecord.glade:167 +#: glade/newrecord.glade:186 msgid "<b>Main</b>" msgstr "<b>Principal</b>" -#: glade/newrecord.glade:204 +#: glade/newrecord.glade:223 msgid "Distance (Km):" msgstr "Distancia (Km):" -#: glade/newrecord.glade:213 glade/newrecord.glade:334 -#: glade/newrecord.glade:535 glade/newrecord.glade:673 -#: glade/newrecord.glade:934 glade/profile.glade:2417 +#: glade/newrecord.glade:232 +#: glade/newrecord.glade:357 +#: glade/newrecord.glade:560 +#: glade/newrecord.glade:698 +#: glade/newrecord.glade:959 +#: glade/profile.glade:2417 msgid "Calculate" msgstr "Calcular" -#: glade/newrecord.glade:231 +#: glade/newrecord.glade:250 msgid "Duration:" msgstr "Duración:" -#: glade/newrecord.glade:261 glade/newrecord.glade:287 -#: glade/pytrainer.glade:1475 glade/pytrainer.glade:1525 -#: glade/pytrainer.glade:3271 glade/pytrainer.glade:3321 -#: glade/pytrainer.glade:4399 glade/pytrainer.glade:4449 -#: glade/pytrainer.glade:5541 glade/pytrainer.glade:5591 -#: glade/pytrainer.glade:6836 glade/pytrainer.glade:6886 +#: glade/newrecord.glade:281 +#: glade/newrecord.glade:308 +#: glade/pytrainer.glade:1475 +#: glade/pytrainer.glade:1525 +#: glade/pytrainer.glade:3271 +#: glade/pytrainer.glade:3321 +#: glade/pytrainer.glade:4399 +#: glade/pytrainer.glade:4449 +#: glade/pytrainer.glade:5541 +#: glade/pytrainer.glade:5591 +#: glade/pytrainer.glade:6836 +#: glade/pytrainer.glade:6886 msgid ":" msgstr ":" -#: glade/newrecord.glade:355 +#: glade/newrecord.glade:378 msgid "Date:" msgstr "Fecha:" -#: glade/newrecord.glade:382 glade/pytrainer.glade:4763 +#: glade/newrecord.glade:406 +#: glade/pytrainer.glade:4763 #: glade/pytrainer.glade:5905 msgid " " msgstr " " -#: glade/newrecord.glade:423 +#: glade/newrecord.glade:447 msgid "Start Time:" msgstr "Hora de comienzo:" -#: glade/newrecord.glade:439 +#: glade/newrecord.glade:463 msgid "12:00:00" msgstr "12:00:00" -#: glade/newrecord.glade:463 glade/profile.glade:2467 +#: glade/newrecord.glade:488 +#: glade/profile.glade:2467 msgid "<b>General</b>" msgstr "<b>General:</b>" -#: glade/newrecord.glade:499 +#: glade/newrecord.glade:524 msgid "Max (km/h):" msgstr "Punta (Km/h)" -#: glade/newrecord.glade:524 -msgid "Velocity (km/h)" -msgstr "Velocidad (km/h)" +#: glade/newrecord.glade:549 +msgid "Average (km/h)" +msgstr "Media (km/h)" -#: glade/newrecord.glade:570 -msgid "<b>Velocity</b>" +#: glade/newrecord.glade:595 +msgid "<b>Speed</b>" msgstr "<b>Velocidad</b>" -#: glade/newrecord.glade:589 +#: glade/newrecord.glade:614 msgid "Quick Entry" msgstr "Entrada" -#: glade/newrecord.glade:622 +#: glade/newrecord.glade:647 msgid "Max (min/km):" msgstr "Max (min/km)" -#: glade/newrecord.glade:648 +#: glade/newrecord.glade:673 msgid "Pace (min/km):" msgstr "Ritmo (min/km)" -#: glade/newrecord.glade:694 +#: glade/newrecord.glade:719 msgid "<b>Pace</b>" msgstr "<b>Ritmo</b>" -#: glade/newrecord.glade:730 +#: glade/newrecord.glade:755 msgid "Ascent:" msgstr "Ascenso:" -#: glade/newrecord.glade:756 +#: glade/newrecord.glade:781 msgid "Descent:" msgstr "Descenso:" -#: glade/newrecord.glade:789 +#: glade/newrecord.glade:814 msgid "<b>Accumulated Altitude Change</b>" msgstr "<b>Desnivel acumulado:</b>" -#: glade/newrecord.glade:826 +#: glade/newrecord.glade:851 msgid "Max (bpm):" msgstr "Pulsaciones máximas" -#: glade/newrecord.glade:838 +#: glade/newrecord.glade:863 msgid "Heart rate:" msgstr "Pulsaciones" -#: glade/newrecord.glade:878 pytrainer/gui/windowmain.py:720 -#: pytrainer/monthgraph.py:77 pytrainer/yeargraph.py:78 +#: glade/newrecord.glade:903 +#: pytrainer/gui/windowmain.py:730 +#: pytrainer/monthgraph.py:77 +#: pytrainer/yeargraph.py:78 #: pytrainer/weekgraph.py:123 msgid "Calories" msgstr "Calorías" -#: glade/newrecord.glade:907 -msgid "" -"<small><b>Note:</b> In order to calculate the calories you must set the " -"sport MET (in Preferences->Sport) </small>" -msgstr "" -"<small><b>Nota:</b> para el cálculo de calorías es necesario introducir el " -"valor de MET del deporte (en Preferencias -> Deporte)</small>" +#: glade/newrecord.glade:932 +msgid "<small><b>Note:</b> In order to calculate the calories you must set the sport MET (in Preferences->Sport) </small>" +msgstr "<small><b>Nota:</b> para el cálculo de calorías es necesario introducir el valor de MET del deporte (en Preferencias -> Deporte)</small>" -#: glade/newrecord.glade:981 +#: glade/newrecord.glade:1006 msgid "<b>Heart Rate</b>" msgstr "<b>Pulsaciones</b>" -#: glade/newrecord.glade:1003 +#: glade/newrecord.glade:1028 msgid "Advanced" msgstr "Avanzado" -#: glade/newrecord.glade:1055 +#: glade/newrecord.glade:1080 msgid "<b>Comments</b>" msgstr "<b>Comentarios</b>" -#: glade/newrecord.glade:1070 +#: glade/newrecord.glade:1095 msgid "Comments" msgstr "Comentarios" +#: glade/plugins.glade:53 +msgid "<b>Plugin Details</b>" +msgstr "<b>Detalles del plugin</b>" + +#: glade/plugins.glade:68 +msgid "description-entry " +msgstr "Descripción" + +#: glade/plugins.glade:129 +msgid "nameEntry" +msgstr "Nombre entrada" + #: glade/profile.glade:8 msgid "Preferences" msgstr "Preferencias" @@ -287,8 +377,7 @@ msgstr "Use este puerto para conexiones internas" #: glade/profile.glade:548 -msgid "" -"<small><b>Note:</b> Change this only if you know what you are doing</small>" +msgid "<small><b>Note:</b> Change this only if you know what you are doing</small>" msgstr "<small><b>Nota:</b> cambie esto solamente si sabe lo que hace</small>" #: glade/profile.glade:580 @@ -329,17 +418,12 @@ #: glade/profile.glade:1170 msgid "<b>Sport List</b>" -msgstr "<b>Lista de deportes:</b>" +msgstr "<b>Lista de deportes</b>" #: glade/profile.glade:1199 msgid "llist" msgstr "lista" -#: glade/profile.glade:1279 glade/pytrainer.glade:8850 -#: glade/pytrainer.glade:9341 -msgid "Name:" -msgstr "Nombre:" - #: glade/profile.glade:1307 msgid "M.E.T.:" msgstr "M.E.T.:" @@ -348,9 +432,9 @@ msgid "Extra Weight:" msgstr "Peso extra:" -#: glade/profile.glade:1430 glade/profile.glade:2028 -msgid "" -"More information on determining yor M.E.T sport coefficient on Wikipedia" +#: glade/profile.glade:1430 +#: glade/profile.glade:2028 +msgid "More information on determining yor M.E.T sport coefficient on Wikipedia" msgstr "Más información sobre el coeficiente M.E.T. en Wikipedia" #: glade/profile.glade:1534 @@ -373,7 +457,8 @@ msgid "<b>Delete Sport</b>" msgstr "<b>Borrar deporte</b>" -#: glade/profile.glade:1787 glade/pytrainer.glade:2975 +#: glade/profile.glade:1787 +#: glade/pytrainer.glade:2975 #: glade/pytrainer.glade:8368 msgid "label-2147483648" msgstr " " @@ -390,7 +475,8 @@ msgid "M.E.T." msgstr "M.E.T." -#: glade/profile.glade:1980 pytrainer/gui/windowprofile.py:69 +#: glade/profile.glade:1980 +#: pytrainer/gui/windowprofile.py:69 msgid "Extra Weight" msgstr "Peso extra" @@ -419,26 +505,19 @@ msgstr "Pulsaciones en reposo:" #: glade/profile.glade:2388 -msgid "" -"<small><b>Note:</b> Maximum heart rate is calculated by subtracting the " -"number 220 minus your age. </small>" -msgstr "" -"<small><b>Nota:</b> el número máximo de pulsaciones se calcula con la " -"siguiente fórmula: 220 menos su edad. </small>" +msgid "<small><b>Note:</b> Maximum heart rate is calculated by subtracting the number 220 minus your age. </small>" +msgstr "<small><b>Nota:</b> el número máximo de pulsaciones se calcula con la siguiente fórmula: 220 menos su edad. </small>" #: glade/profile.glade:2527 -msgid "" -"<small><b>NOTE:</b> in order to use the Karvonen method you must cover the " -"Resting hr field.</small>" -msgstr "" -"<small><b>Nota:</b> rellene todos los campos relativos a pulsaciones si usa " -"el método Karvonen</small>" +msgid "<small><b>NOTE:</b> in order to use the Karvonen method you must cover the Resting hr field.</small>" +msgstr "<small><b>Nota:</b> rellene todos los campos relativos a pulsaciones si usa el método Karvonen</small>" #: glade/profile.glade:2556 msgid "Percentages based method" msgstr "Basado en porcentajes" -#: glade/profile.glade:2578 pytrainer/gui/windowmain.py:291 +#: glade/profile.glade:2578 +#: pytrainer/gui/windowmain.py:301 msgid "Karvonen method" msgstr "Karvonen" @@ -450,8 +529,10 @@ msgid "<b>Heart Rate Zones</b>" msgstr "<b>Zonas de frecuencia cardiaca</b>" -#: glade/profile.glade:2668 pytrainer/recordgraph.py:99 -#: pytrainer/heartrategraph.py:38 pytrainer/daygraph.py:56 +#: glade/profile.glade:2668 +#: pytrainer/recordgraph.py:99 +#: pytrainer/heartrategraph.py:38 +#: pytrainer/daygraph.py:56 msgid "Heart Rate" msgstr "Pulsaciones" @@ -495,10 +576,6 @@ msgid "Tools" msgstr "Herramientas" -#: glade/pytrainer.glade:201 glade/pytrainer.glade:8718 -msgid "Extensions" -msgstr "Extensiones" - #: glade/pytrainer.glade:211 msgid "GPS Device Plugins" msgstr "Plugins de dispositivos GPS" @@ -507,9 +584,13 @@ msgid "_Help" msgstr "_Ayuda" -#: glade/pytrainer.glade:345 pytrainer/gui/windowmain.py:63 -#: pytrainer/gui/windowmain.py:66 pytrainer/gui/windowmain.py:716 -#: pytrainer/gui/windowimportdata.py:255 pytrainer/gui/windowprofile.py:69 +#: glade/pytrainer.glade:345 +#: pytrainer/gui/windowmain.py:63 +#: pytrainer/gui/windowmain.py:66 +#: pytrainer/gui/windowmain.py:726 +#: pytrainer/gui/windowimportdata.py:333 +#: pytrainer/gui/windowrecord.py:147 +#: pytrainer/gui/windowprofile.py:69 msgid "Sport" msgstr "Deporte" @@ -521,20 +602,26 @@ msgid "<b>Sport:</b>" msgstr "<b>Deporte:</b>" -#: glade/pytrainer.glade:592 glade/pytrainer.glade:3212 -#: glade/pytrainer.glade:4340 glade/pytrainer.glade:5482 +#: glade/pytrainer.glade:592 +#: glade/pytrainer.glade:3212 +#: glade/pytrainer.glade:4340 +#: glade/pytrainer.glade:5482 #: glade/pytrainer.glade:6777 msgid "<b>Duration:</b>" msgstr "<b>Duración:</b>" -#: glade/pytrainer.glade:621 glade/pytrainer.glade:3409 -#: glade/pytrainer.glade:4510 glade/pytrainer.glade:5652 +#: glade/pytrainer.glade:621 +#: glade/pytrainer.glade:3409 +#: glade/pytrainer.glade:4510 +#: glade/pytrainer.glade:5652 #: glade/pytrainer.glade:7001 msgid "<b>Speed:</b>" msgstr "<b>Velocidad:</b>" -#: glade/pytrainer.glade:649 glade/pytrainer.glade:3718 -#: glade/pytrainer.glade:4874 glade/pytrainer.glade:6016 +#: glade/pytrainer.glade:649 +#: glade/pytrainer.glade:3718 +#: glade/pytrainer.glade:4874 +#: glade/pytrainer.glade:6016 #: glade/pytrainer.glade:7171 msgid "<b>Pace:</b>" msgstr "<b>Ritmo:</b>" @@ -551,33 +638,54 @@ msgid "<b>Comments:</b>" msgstr "<b>Comentarios:</b>" -#: glade/pytrainer.glade:760 glade/pytrainer.glade:1585 -#: glade/pytrainer.glade:3465 glade/pytrainer.glade:3522 -#: glade/pytrainer.glade:4566 glade/pytrainer.glade:4735 -#: glade/pytrainer.glade:5708 glade/pytrainer.glade:5877 -#: glade/pytrainer.glade:7057 glade/pytrainer.glade:7085 -#: pytrainer/gui/windowmain.py:177 pytrainer/gui/windowmain.py:178 -#: pytrainer/gui/windowmain.py:311 pytrainer/gui/windowmain.py:312 -#: pytrainer/gui/windowmain.py:412 pytrainer/gui/windowmain.py:413 -#: pytrainer/gui/windowmain.py:490 pytrainer/gui/windowmain.py:491 +#: glade/pytrainer.glade:760 +#: glade/pytrainer.glade:1585 +#: glade/pytrainer.glade:3465 +#: glade/pytrainer.glade:3522 +#: glade/pytrainer.glade:4566 +#: glade/pytrainer.glade:4735 +#: glade/pytrainer.glade:5708 +#: glade/pytrainer.glade:5877 +#: glade/pytrainer.glade:7057 +#: glade/pytrainer.glade:7085 +#: pytrainer/gui/windowmain.py:186 +#: pytrainer/gui/windowmain.py:187 +#: pytrainer/gui/windowmain.py:321 +#: pytrainer/gui/windowmain.py:322 +#: pytrainer/gui/windowmain.py:422 +#: pytrainer/gui/windowmain.py:423 +#: pytrainer/gui/windowmain.py:500 +#: pytrainer/gui/windowmain.py:501 msgid "km/h" msgstr "Km/h" -#: glade/pytrainer.glade:788 glade/pytrainer.glade:1267 -#: glade/pytrainer.glade:3746 glade/pytrainer.glade:3802 -#: glade/pytrainer.glade:4930 glade/pytrainer.glade:4958 -#: glade/pytrainer.glade:6072 glade/pytrainer.glade:6100 -#: glade/pytrainer.glade:7228 glade/pytrainer.glade:7256 -#: pytrainer/gui/windowmain.py:179 pytrainer/gui/windowmain.py:180 -#: pytrainer/gui/windowmain.py:313 pytrainer/gui/windowmain.py:314 -#: pytrainer/gui/windowmain.py:414 pytrainer/gui/windowmain.py:415 -#: pytrainer/gui/windowmain.py:492 pytrainer/gui/windowmain.py:493 +#: glade/pytrainer.glade:788 +#: glade/pytrainer.glade:1267 +#: glade/pytrainer.glade:3746 +#: glade/pytrainer.glade:3802 +#: glade/pytrainer.glade:4930 +#: glade/pytrainer.glade:4958 +#: glade/pytrainer.glade:6072 +#: glade/pytrainer.glade:6100 +#: glade/pytrainer.glade:7228 +#: glade/pytrainer.glade:7256 +#: pytrainer/gui/windowmain.py:188 +#: pytrainer/gui/windowmain.py:189 +#: pytrainer/gui/windowmain.py:323 +#: pytrainer/gui/windowmain.py:324 +#: pytrainer/gui/windowmain.py:424 +#: pytrainer/gui/windowmain.py:425 +#: pytrainer/gui/windowmain.py:502 +#: pytrainer/gui/windowmain.py:503 msgid "min/km" msgstr "min/km" -#: glade/pytrainer.glade:816 glade/pytrainer.glade:1323 -#: pytrainer/gui/windowmain.py:181 pytrainer/gui/windowmain.py:182 -#: pytrainer/gui/windowmain.py:1025 pytrainer/gui/windowmain.py:1027 +#: glade/pytrainer.glade:816 +#: glade/pytrainer.glade:1323 +#: pytrainer/gui/windowmain.py:190 +#: pytrainer/gui/windowmain.py:191 +#: pytrainer/gui/windowmain.py:1002 +#: pytrainer/gui/windowmain.py:1004 msgid "m" msgstr "m" @@ -585,8 +693,10 @@ msgid "<b>Date:</b>" msgstr "<b>Fecha:</b>" -#: glade/pytrainer.glade:1013 glade/pytrainer.glade:3184 -#: glade/pytrainer.glade:4312 glade/pytrainer.glade:5454 +#: glade/pytrainer.glade:1013 +#: glade/pytrainer.glade:3184 +#: glade/pytrainer.glade:4312 +#: glade/pytrainer.glade:5454 #: glade/pytrainer.glade:6749 msgid "<b>Distance:</b>" msgstr "<b>Distancia:</b>" @@ -595,8 +705,10 @@ msgid "<b>Max Speed</b>" msgstr "<b>Pico velocidad:</b>" -#: glade/pytrainer.glade:1070 glade/pytrainer.glade:3774 -#: glade/pytrainer.glade:4902 glade/pytrainer.glade:6044 +#: glade/pytrainer.glade:1070 +#: glade/pytrainer.glade:3774 +#: glade/pytrainer.glade:4902 +#: glade/pytrainer.glade:6044 #: glade/pytrainer.glade:7200 msgid "<b>Max Pace:</b>" msgstr "<b>Pico ritmo:</b>" @@ -605,24 +717,34 @@ msgid "<b>Descent:</b>" msgstr "<b>Descenso:</b>" -#: glade/pytrainer.glade:1351 glade/pytrainer.glade:3606 -#: glade/pytrainer.glade:4650 glade/pytrainer.glade:5792 +#: glade/pytrainer.glade:1351 +#: glade/pytrainer.glade:3606 +#: glade/pytrainer.glade:4650 +#: glade/pytrainer.glade:5792 #: glade/pytrainer.glade:6608 msgid "Cal" msgstr "Cal" -#: glade/pytrainer.glade:1417 glade/pytrainer.glade:3128 -#: glade/pytrainer.glade:4256 glade/pytrainer.glade:5398 +#: glade/pytrainer.glade:1417 +#: glade/pytrainer.glade:3128 +#: glade/pytrainer.glade:4256 +#: glade/pytrainer.glade:5398 #: glade/pytrainer.glade:6973 msgid "Km" msgstr "km" -#: glade/pytrainer.glade:1450 glade/pytrainer.glade:1500 -#: glade/pytrainer.glade:1550 glade/pytrainer.glade:3246 -#: glade/pytrainer.glade:3296 glade/pytrainer.glade:3346 -#: glade/pytrainer.glade:4424 glade/pytrainer.glade:4474 -#: glade/pytrainer.glade:5566 glade/pytrainer.glade:5616 -#: glade/pytrainer.glade:6861 glade/pytrainer.glade:6911 +#: glade/pytrainer.glade:1450 +#: glade/pytrainer.glade:1500 +#: glade/pytrainer.glade:1550 +#: glade/pytrainer.glade:3246 +#: glade/pytrainer.glade:3296 +#: glade/pytrainer.glade:3346 +#: glade/pytrainer.glade:4424 +#: glade/pytrainer.glade:4474 +#: glade/pytrainer.glade:5566 +#: glade/pytrainer.glade:5616 +#: glade/pytrainer.glade:6861 +#: glade/pytrainer.glade:6911 msgid "00" msgstr "00" @@ -643,8 +765,10 @@ "Ritmo\n" "Pulsaciones" -#: glade/pytrainer.glade:1860 glade/pytrainer.glade:5256 -#: glade/pytrainer.glade:6398 glade/pytrainer.glade:7554 +#: glade/pytrainer.glade:1860 +#: glade/pytrainer.glade:5256 +#: glade/pytrainer.glade:6398 +#: glade/pytrainer.glade:7554 msgid "Versus" msgstr "contra" @@ -671,14 +795,18 @@ msgid "<b>Beats:</b>" msgstr "<b>Pulsaciones:</b>" -#: glade/pytrainer.glade:2089 glade/pytrainer.glade:3550 -#: glade/pytrainer.glade:4594 glade/pytrainer.glade:5736 +#: glade/pytrainer.glade:2089 +#: glade/pytrainer.glade:3550 +#: glade/pytrainer.glade:4594 +#: glade/pytrainer.glade:5736 #: glade/pytrainer.glade:6552 msgid "<b>Calories: </b>" msgstr "<b>Calorías: </b>" -#: glade/pytrainer.glade:2117 glade/pytrainer.glade:3830 -#: glade/pytrainer.glade:5014 glade/pytrainer.glade:6156 +#: glade/pytrainer.glade:2117 +#: glade/pytrainer.glade:3830 +#: glade/pytrainer.glade:5014 +#: glade/pytrainer.glade:6156 #: glade/pytrainer.glade:7284 msgid "<b>Max Beats:</b>" msgstr "<b>Pico pulsaciones:</b>" @@ -691,7 +819,8 @@ msgid "<b>HR Zone5:</b>" msgstr "<b>Máximo esfuerzo:</b>" -#: glade/pytrainer.glade:2202 glade/pytrainer.glade:2566 +#: glade/pytrainer.glade:2202 +#: glade/pytrainer.glade:2566 msgid " bpm" msgstr "ppm" @@ -715,12 +844,18 @@ msgid "<b>HR Zone1:</b>" msgstr "<b>Recuperación:</b>" -#: glade/pytrainer.glade:2621 glade/pytrainer.glade:2648 -#: glade/pytrainer.glade:2676 glade/pytrainer.glade:2704 -#: glade/pytrainer.glade:2732 glade/pytrainer.glade:3690 -#: glade/pytrainer.glade:3858 glade/pytrainer.glade:4846 -#: glade/pytrainer.glade:4986 glade/pytrainer.glade:5988 -#: glade/pytrainer.glade:6128 glade/pytrainer.glade:6692 +#: glade/pytrainer.glade:2621 +#: glade/pytrainer.glade:2648 +#: glade/pytrainer.glade:2676 +#: glade/pytrainer.glade:2704 +#: glade/pytrainer.glade:2732 +#: glade/pytrainer.glade:3690 +#: glade/pytrainer.glade:3858 +#: glade/pytrainer.glade:4846 +#: glade/pytrainer.glade:4986 +#: glade/pytrainer.glade:5988 +#: glade/pytrainer.glade:6128 +#: glade/pytrainer.glade:6692 #: glade/pytrainer.glade:7113 msgid "bpm" msgstr "ppm" @@ -737,13 +872,17 @@ msgid "Record" msgstr "Registro" -#: glade/pytrainer.glade:3494 glade/pytrainer.glade:4679 -#: glade/pytrainer.glade:5821 glade/pytrainer.glade:7142 +#: glade/pytrainer.glade:3494 +#: glade/pytrainer.glade:4679 +#: glade/pytrainer.glade:5821 +#: glade/pytrainer.glade:7142 msgid "<b>Max Speed:</b>" msgstr "<b>Velocidad máxima:</b>" -#: glade/pytrainer.glade:3634 glade/pytrainer.glade:4790 -#: glade/pytrainer.glade:5932 glade/pytrainer.glade:6636 +#: glade/pytrainer.glade:3634 +#: glade/pytrainer.glade:4790 +#: glade/pytrainer.glade:5932 +#: glade/pytrainer.glade:6636 msgid "<b>Beats avg:</b>" msgstr "<b>Media pulsaciones:</b>" @@ -769,7 +908,8 @@ msgid "Day" msgstr "Día" -#: glade/pytrainer.glade:4374 glade/pytrainer.glade:5516 +#: glade/pytrainer.glade:4374 +#: glade/pytrainer.glade:5516 #: glade/pytrainer.glade:6811 msgid "000" msgstr "000" @@ -778,7 +918,8 @@ msgid " <b>Week:</b>" msgstr "<b>Semana:</b>" -#: glade/pytrainer.glade:5236 glade/pytrainer.glade:6378 +#: glade/pytrainer.glade:5236 +#: glade/pytrainer.glade:6378 #: glade/pytrainer.glade:7534 msgid "" "Distance\n" @@ -793,7 +934,8 @@ "Velocidad media\n" "Calorías" -#: glade/pytrainer.glade:5281 glade/pytrainer.glade:6423 +#: glade/pytrainer.glade:5281 +#: glade/pytrainer.glade:6423 #: glade/pytrainer.glade:7579 msgid "" "None\n" @@ -878,11 +1020,6 @@ msgid "Longitude:" msgstr "<b>Longitud:</b>" -#: glade/pytrainer.glade:8163 glade/pytrainer.glade:8906 -#: glade/pytrainer.glade:9229 -msgid "Description:" -msgstr "<b>Descripción:</b>" - #: glade/pytrainer.glade:8283 msgid "<b> Waypoint: </b>" msgstr "<b> Waypoint: </b>" @@ -903,51 +1040,17 @@ msgid "Show graph in classic view" msgstr "Mostrar en vista clásica" -#: glade/pytrainer.glade:8794 -msgid "<b>Extension Details</b>" -msgstr "<b>Detalles de la extensión</b>" - -#: glade/pytrainer.glade:8822 -msgid "name-entry" -msgstr "Nombre" - -#: glade/pytrainer.glade:8878 glade/pytrainer.glade:9285 -msgid "Status:" -msgstr "Estado:" - -#: glade/pytrainer.glade:8934 glade/pytrainer.glade:9257 -msgid "status-entry" -msgstr "Estado" - -#: glade/pytrainer.glade:8962 -msgid "description-entry" -msgstr "Descripción" - -#: glade/pytrainer.glade:9097 -msgid "Plugins" -msgstr "Plugins" - -#: glade/pytrainer.glade:9172 -msgid "<b>Plugin Details</b>" -msgstr "<b>Detalles del plugin</b>" - -#: glade/pytrainer.glade:9201 -msgid "description-entry " -msgstr "Descripción" - -#: glade/pytrainer.glade:9313 -msgid "nameEntry" -msgstr "Nombre entrada" - -#: glade/pytrainer.glade:9484 +#: glade/pytrainer.glade:8718 msgid "Select track record" msgstr "Seleccione uno de los tracks" -#: glade/warning.glade:7 glade/warning.glade:38 +#: glade/warning.glade:7 +#: glade/warning.glade:38 msgid "Warning" msgstr "Advertencia" -#: pytrainer/gui/windowmain.py:63 pytrainer/gui/windowmain.py:66 +#: pytrainer/gui/windowmain.py:63 +#: pytrainer/gui/windowmain.py:66 #: pytrainer/gui/windowmain.py:70 msgid "id" msgstr "id" @@ -960,30 +1063,38 @@ msgid "Kilometer" msgstr "Kilómetros" -#: pytrainer/gui/windowmain.py:66 pytrainer/gui/windowmain.py:713 +#: pytrainer/gui/windowmain.py:66 +#: pytrainer/gui/windowmain.py:723 msgid "Title" msgstr "Título" -#: pytrainer/gui/windowmain.py:66 pytrainer/gui/windowmain.py:714 +#: pytrainer/gui/windowmain.py:66 +#: pytrainer/gui/windowmain.py:724 #: pytrainer/gui/dialogselecttrack.py:40 msgid "Date" msgstr "Fecha" -#: pytrainer/gui/windowmain.py:66 pytrainer/gui/windowmain.py:715 -#: pytrainer/gui/windowimportdata.py:255 pytrainer/extensions/googlemaps.py:91 +#: pytrainer/gui/windowmain.py:66 +#: pytrainer/gui/windowmain.py:725 +#: pytrainer/gui/windowimportdata.py:333 +#: pytrainer/gui/windowrecord.py:147 +#: pytrainer/extensions/googlemaps.py:93 msgid "Distance" msgstr "Distancia" -#: pytrainer/gui/windowmain.py:66 pytrainer/gui/windowmain.py:717 -#: pytrainer/extensions/googlemaps.py:91 +#: pytrainer/gui/windowmain.py:66 +#: pytrainer/gui/windowmain.py:727 +#: pytrainer/extensions/googlemaps.py:93 msgid "Time" msgstr "Tiempo" -#: pytrainer/gui/windowmain.py:66 pytrainer/gui/windowmain.py:718 +#: pytrainer/gui/windowmain.py:66 +#: pytrainer/gui/windowmain.py:728 msgid "Beats" msgstr "Pulsaciones" -#: pytrainer/gui/windowmain.py:66 pytrainer/gui/windowmain.py:719 +#: pytrainer/gui/windowmain.py:66 +#: pytrainer/gui/windowmain.py:729 msgid "Average" msgstr "Media" @@ -991,127 +1102,214 @@ msgid "Waypoint" msgstr "Waypoint" -#: pytrainer/gui/windowmain.py:168 pytrainer/gui/windowmain.py:304 -#: pytrainer/gui/windowmain.py:405 pytrainer/gui/windowmain.py:483 +#: pytrainer/gui/windowmain.py:177 +#: pytrainer/gui/windowmain.py:314 +#: pytrainer/gui/windowmain.py:415 +#: pytrainer/gui/windowmain.py:493 msgid "miles" msgstr "millas" -#: pytrainer/gui/windowmain.py:169 pytrainer/gui/windowmain.py:170 -#: pytrainer/gui/windowmain.py:305 pytrainer/gui/windowmain.py:306 -#: pytrainer/gui/windowmain.py:406 pytrainer/gui/windowmain.py:407 -#: pytrainer/gui/windowmain.py:484 pytrainer/gui/windowmain.py:485 +#: pytrainer/gui/windowmain.py:178 +#: pytrainer/gui/windowmain.py:179 +#: pytrainer/gui/windowmain.py:315 +#: pytrainer/gui/windowmain.py:316 +#: pytrainer/gui/windowmain.py:416 +#: pytrainer/gui/windowmain.py:417 +#: pytrainer/gui/windowmain.py:494 +#: pytrainer/gui/windowmain.py:495 msgid "miles/h" msgstr "millas/h" -#: pytrainer/gui/windowmain.py:171 pytrainer/gui/windowmain.py:172 -#: pytrainer/gui/windowmain.py:307 pytrainer/gui/windowmain.py:308 -#: pytrainer/gui/windowmain.py:408 pytrainer/gui/windowmain.py:409 -#: pytrainer/gui/windowmain.py:486 pytrainer/gui/windowmain.py:487 +#: pytrainer/gui/windowmain.py:180 +#: pytrainer/gui/windowmain.py:181 +#: pytrainer/gui/windowmain.py:317 +#: pytrainer/gui/windowmain.py:318 +#: pytrainer/gui/windowmain.py:418 +#: pytrainer/gui/windowmain.py:419 +#: pytrainer/gui/windowmain.py:496 +#: pytrainer/gui/windowmain.py:497 msgid "min/mile" msgstr "min/milla" -#: pytrainer/gui/windowmain.py:173 pytrainer/gui/windowmain.py:174 +#: pytrainer/gui/windowmain.py:182 +#: pytrainer/gui/windowmain.py:183 msgid "feet" msgstr "pies" -#: pytrainer/gui/windowmain.py:176 pytrainer/gui/windowmain.py:310 -#: pytrainer/gui/windowmain.py:411 pytrainer/gui/windowmain.py:489 -#: pytrainer/extensions/googlemaps.py:91 +#: pytrainer/gui/windowmain.py:185 +#: pytrainer/gui/windowmain.py:320 +#: pytrainer/gui/windowmain.py:421 +#: pytrainer/gui/windowmain.py:499 +#: pytrainer/extensions/googlemaps.py:93 msgid "km" msgstr "Km" -#: pytrainer/gui/windowmain.py:293 +#: pytrainer/gui/windowmain.py:303 msgid "Percentages method" msgstr "basado en porcentajes" -#: pytrainer/gui/windowmain.py:1019 +#: pytrainer/gui/windowmain.py:996 msgid "lap" msgstr "vuelta" -#: pytrainer/gui/windowmain.py:1025 pytrainer/gui/drawArea.py:143 -#: pytrainer/extensions/googlemaps.py:89 +#: pytrainer/gui/windowmain.py:1002 +#: pytrainer/gui/drawArea.py:143 +#: pytrainer/extensions/googlemaps.py:91 msgid "h" msgstr "h" -#: pytrainer/gui/windowmain.py:1025 pytrainer/gui/windowmain.py:1027 +#: pytrainer/gui/windowmain.py:1002 +#: pytrainer/gui/windowmain.py:1004 msgid "s" msgstr "s" -#: pytrainer/gui/windowimportdata.py:82 +#: pytrainer/gui/windowimportdata.py:110 msgid "No file selected" msgstr "Ningún fichero seleccionado" -#: pytrainer/gui/windowimportdata.py:189 +#: pytrainer/gui/windowimportdata.py:155 +msgid "Configure" +msgstr "Configurar" + +#: pytrainer/gui/windowimportdata.py:156 +msgid "Run" +msgstr "Ejecutar" + +#: pytrainer/gui/windowimportdata.py:164 +msgid "Disabled" +msgstr "Desactivo" + +#: pytrainer/gui/windowimportdata.py:166 +msgid "Enabled" +msgstr "Activo" + +#: pytrainer/gui/windowimportdata.py:233 msgid "GPS device found" msgstr "Dispositivos GPS encontrado" -#: pytrainer/gui/windowimportdata.py:192 +#: pytrainer/gui/windowimportdata.py:236 msgid "GPS device <b>not</b> found" msgstr "Dispositivo GPS <b>no</b> encontrado" -#: pytrainer/gui/windowimportdata.py:199 +#: pytrainer/gui/windowimportdata.py:243 msgid "This tool was not found on the system" msgstr "No se ha encontrado esta herramienta en el sistema" -#: pytrainer/gui/windowimportdata.py:201 +#: pytrainer/gui/windowimportdata.py:245 msgid " Homepage" msgstr "Página de inicio" -#: pytrainer/gui/windowimportdata.py:255 +#: pytrainer/gui/windowimportdata.py:298 +msgid "File" +msgstr "Archivo" + +#: pytrainer/gui/windowimportdata.py:298 +msgid "Type" +msgstr "Tipo" + +#: pytrainer/gui/windowimportdata.py:298 +msgid "Activities" +msgstr "Actividades" + +#: pytrainer/gui/windowimportdata.py:333 +#: pytrainer/gui/windowrecord.py:147 msgid "Start Time" msgstr "Hora de comienzo" -#: pytrainer/gui/windowimportdata.py:255 +#: pytrainer/gui/windowimportdata.py:333 +#: pytrainer/gui/windowrecord.py:147 msgid "Duration" -msgstr "<b>Duración:</b>" +msgstr "Duración" -#: pytrainer/gui/windowimportdata.py:255 +#: pytrainer/gui/windowimportdata.py:333 msgid "Notes" msgstr "Notas" -#: pytrainer/gui/windowimportdata.py:404 +#: pytrainer/gui/windowimportdata.py:482 +msgid "Imported into database" +msgstr "Importado a base de datos" + +#: pytrainer/gui/windowimportdata.py:526 +#: pytrainer/gui/windowextensions.py:81 +#: pytrainer/gui/windowplugins.py:80 #, python-format -msgid "Found file of type: %s" -msgstr "Tipo de fichero encontrado: %s" +msgid "%s settings" +msgstr "%s opciones" -#: pytrainer/gui/windowimportdata.py:413 -msgid "Found in database" -msgstr "Encontrado en base de datos" +#: pytrainer/gui/windowimportdata.py:541 +#: pytrainer/gui/windowextensions.py:70 +#: pytrainer/gui/windowplugins.py:71 +#: pytrainer/gui/windowplugins.py:95 +msgid "Disable" +msgstr "Desactivo" -#: pytrainer/gui/windowimportdata.py:428 -msgid "Unknown file type" -msgstr "Tipo de fichero desconocido" +#: pytrainer/gui/windowimportdata.py:542 +#: pytrainer/gui/windowextensions.py:72 +#: pytrainer/gui/windowplugins.py:69 +#: pytrainer/gui/windowplugins.py:96 +msgid "Enable" +msgstr "Activo" -#: pytrainer/gui/windowimportdata.py:430 -msgid "File selected is of unknown or unsupported file type" -msgstr "Fichero seleccionado desconocido o no soportado" +#: pytrainer/gui/windowimportdata.py:549 +#: pytrainer/gui/windowplugins.py:103 +msgid "Ok" +msgstr "Ok" -#: pytrainer/gui/windowimportdata.py:457 +#: pytrainer/gui/windowimportdata.py:609 +msgid "Saving options" +msgstr "Guardar configuración" + +#: pytrainer/gui/windowimportdata.py:611 +msgid "Options saved" +msgstr "Configuración guardada" + +#: pytrainer/gui/windowimportdata.py:636 msgid "Importing one activity" msgstr "Importando una actividad" -#: pytrainer/gui/windowimportdata.py:458 +#: pytrainer/gui/windowimportdata.py:637 msgid "Imported one activity" msgstr "Una actividad importada" -#: pytrainer/gui/windowimportdata.py:460 +#: pytrainer/gui/windowimportdata.py:639 #, python-format msgid "Importing %d activities" msgstr "Importando %d actividades" -#: pytrainer/gui/windowimportdata.py:461 +#: pytrainer/gui/windowimportdata.py:640 #, python-format msgid "Imported %d activities" msgstr "Importadas %d actividades" -#: pytrainer/gui/windowimportdata.py:469 -msgid "Import Success" -msgstr "Importación satisfactoria" +#: pytrainer/gui/windowimportdata.py:659 +msgid "Choose a file (or files) to import activities from" +msgstr "Seleccione fichero/s desde el/los que importar actividades" -#: pytrainer/gui/drawArea.py:144 pytrainer/extensions/googlemaps.py:89 +#: pytrainer/gui/windowimportdata.py:674 +#: pytrainer/gui/windowimportdata.py:675 +#, python-format +msgid "Found file of type: %s" +msgstr "Tipo de fichero encontrado: %s" + +#: pytrainer/gui/windowimportdata.py:699 +msgid "Found in database" +msgstr "Encontrado en base de datos" + +#: pytrainer/gui/windowimportdata.py:714 +#: pytrainer/gui/windowimportdata.py:715 +#, python-format +msgid "File %s is of unknown or unsupported file type" +msgstr "Fichero %s seleccionado desconocido o no soportado" + +#: pytrainer/gui/drawArea.py:144 +#: pytrainer/extensions/googlemaps.py:91 msgid "min" msgstr "min" +#: pytrainer/gui/windowrecord.py:147 +msgid "GPX File" +msgstr "Archivo GPX" + #: pytrainer/gui/windowprofile.py:51 msgid "Male" msgstr "Varón" @@ -1128,43 +1326,33 @@ msgid "Track Name" msgstr "Nombre de la ruta" -#: pytrainer/gui/windowextensions.py:70 pytrainer/gui/windowplugins.py:70 -#: pytrainer/gui/windowplugins.py:97 -msgid "Enable" -msgstr "Activo" - -#: pytrainer/gui/windowextensions.py:72 pytrainer/gui/windowplugins.py:72 -#: pytrainer/gui/windowplugins.py:96 -msgid "Disable" -msgstr "Desactivo" - -#: pytrainer/gui/windowextensions.py:81 pytrainer/gui/windowplugins.py:81 -#, python-format -msgid "%s settings" -msgstr "%s opciones" - -#: pytrainer/gui/windowextensions.py:104 pytrainer/gui/windowextensions.py:117 +#: pytrainer/gui/windowextensions.py:112 +#: pytrainer/gui/windowextensions.py:125 msgid "OK" msgstr "Ok" -#: pytrainer/gui/windowplugins.py:104 -msgid "Ok" -msgstr "Ok" - -#: pytrainer/recordgraph.py:93 pytrainer/recordgraph.py:95 -#: pytrainer/recordgraph.py:97 pytrainer/recordgraph.py:99 -#: pytrainer/recordgraph.py:101 pytrainer/monthgraph.py:69 -#: pytrainer/heartrategraph.py:38 pytrainer/yeargraph.py:70 -#: pytrainer/daygraph.py:52 pytrainer/daygraph.py:54 pytrainer/daygraph.py:56 +#: pytrainer/recordgraph.py:93 +#: pytrainer/recordgraph.py:95 +#: pytrainer/recordgraph.py:97 +#: pytrainer/recordgraph.py:99 +#: pytrainer/recordgraph.py:101 +#: pytrainer/monthgraph.py:69 +#: pytrainer/heartrategraph.py:38 +#: pytrainer/yeargraph.py:70 +#: pytrainer/daygraph.py:52 +#: pytrainer/daygraph.py:54 +#: pytrainer/daygraph.py:56 #: pytrainer/weekgraph.py:115 msgid "Distance (km)" msgstr "Distancia (Km)" -#: pytrainer/recordgraph.py:93 pytrainer/daygraph.py:52 +#: pytrainer/recordgraph.py:93 +#: pytrainer/daygraph.py:52 msgid "Height (m)" msgstr "Altura (m)" -#: pytrainer/recordgraph.py:93 pytrainer/daygraph.py:52 +#: pytrainer/recordgraph.py:93 +#: pytrainer/daygraph.py:52 msgid "Stage Profile" msgstr "Perfil de Etapa" @@ -1184,7 +1372,8 @@ msgid "Pace" msgstr "Ritmo" -#: pytrainer/recordgraph.py:99 pytrainer/heartrategraph.py:38 +#: pytrainer/recordgraph.py:99 +#: pytrainer/heartrategraph.py:38 #: pytrainer/daygraph.py:56 msgid "Beats (bpm)" msgstr "Media pulsaciones (ppm)" @@ -1197,11 +1386,11 @@ msgid "Cadence" msgstr "Cadence" -#: pytrainer/lib/gpx.py:93 +#: pytrainer/lib/gpx.py:118 msgid "No Name" msgstr "Sin nombre" -#: pytrainer/lib/gpx.py:100 +#: pytrainer/lib/gpx.py:125 msgid "No Data" msgstr "Sin datos" @@ -1225,57 +1414,69 @@ msgid "VO2 MAX" msgstr "VO2 máximo" -#: pytrainer/monthgraph.py:69 pytrainer/monthgraph.py:71 -#: pytrainer/monthgraph.py:73 pytrainer/monthgraph.py:75 +#: pytrainer/monthgraph.py:69 +#: pytrainer/monthgraph.py:71 +#: pytrainer/monthgraph.py:73 +#: pytrainer/monthgraph.py:75 #: pytrainer/monthgraph.py:77 msgid "day" msgstr "día" -#: pytrainer/monthgraph.py:69 pytrainer/weekgraph.py:115 +#: pytrainer/monthgraph.py:69 +#: pytrainer/weekgraph.py:115 msgid "Daily Distance" msgstr "Distancia" -#: pytrainer/monthgraph.py:71 pytrainer/yeargraph.py:72 +#: pytrainer/monthgraph.py:71 +#: pytrainer/yeargraph.py:72 #: pytrainer/weekgraph.py:117 msgid "Time (hours)" msgstr "Tiempo en horas" -#: pytrainer/monthgraph.py:71 pytrainer/weekgraph.py:117 +#: pytrainer/monthgraph.py:71 +#: pytrainer/weekgraph.py:117 msgid "Daily Time" msgstr "Tiempo diario" -#: pytrainer/monthgraph.py:73 pytrainer/yeargraph.py:74 +#: pytrainer/monthgraph.py:73 +#: pytrainer/yeargraph.py:74 #: pytrainer/weekgraph.py:119 msgid "Average Heart Rate (bpm)" msgstr "Pulsaciones medias (ppm)" -#: pytrainer/monthgraph.py:73 pytrainer/weekgraph.py:119 +#: pytrainer/monthgraph.py:73 +#: pytrainer/weekgraph.py:119 msgid "Daily Average Heart Rate" msgstr "Pulsaciones diarias" -#: pytrainer/monthgraph.py:75 pytrainer/yeargraph.py:76 +#: pytrainer/monthgraph.py:75 +#: pytrainer/yeargraph.py:76 #: pytrainer/weekgraph.py:121 msgid "Average Speed (km/h)" msgstr "Velocidad media (km/h)" -#: pytrainer/monthgraph.py:75 pytrainer/weekgraph.py:121 +#: pytrainer/monthgraph.py:75 +#: pytrainer/weekgraph.py:121 msgid "Daily Average Speed" msgstr "medias diarias" -#: pytrainer/monthgraph.py:77 pytrainer/weekgraph.py:123 +#: pytrainer/monthgraph.py:77 +#: pytrainer/weekgraph.py:123 msgid "Daily Calories" msgstr "Calorías diarias" -#: pytrainer/record.py:61 +#: pytrainer/record.py:71 msgid "Edit Entry" msgstr "Editar entrada" -#: pytrainer/record.py:379 -msgid "pyTrainer cant import data from your gpx file" +#: pytrainer/record.py:452 +msgid "pyTrainer can't import data from your gpx file" msgstr "pyTrainer no puede importar datos de tu fichero gpx" -#: pytrainer/yeargraph.py:70 pytrainer/yeargraph.py:72 -#: pytrainer/yeargraph.py:74 pytrainer/yeargraph.py:76 +#: pytrainer/yeargraph.py:70 +#: pytrainer/yeargraph.py:72 +#: pytrainer/yeargraph.py:74 +#: pytrainer/yeargraph.py:76 #: pytrainer/yeargraph.py:78 msgid "month" msgstr "mes" @@ -1294,19 +1495,15 @@ #: pytrainer/yeargraph.py:76 msgid "Monthly Average Speed" -msgstr "medias mensuales" +msgstr "Medias mensuales" #: pytrainer/yeargraph.py:78 msgid "Monthly Calories" msgstr "Calorías mensuales" -#: pytrainer/waypoint.py:80 -msgid "" -"The gpx file seems to be a several days records. Perhaps you will need to " -"edit your gpx file" -msgstr "" -"Parece que el archivo gpx contiene salidas de varios dias. " -"Probablementenecesitarás editar tu archivo gpx" +#: pytrainer/waypoint.py:90 +msgid "The gpx file seems to be a several days records. Perhaps you will need to edit your gpx file" +msgstr "Parece que el archivo gpx contiene actividades de varios días. Probablemente necesites editarlo" #: pytrainer/daygraph.py:54 msgid "Velocity (Km/h)" @@ -1316,11 +1513,11 @@ msgid "Velocity" msgstr "Velocidad" -#: pytrainer/main.py:416 +#: pytrainer/main.py:447 msgid "Delete this database entry?" msgstr "¿Borrar esta entrada de la base de datos?" -#: pytrainer/main.py:430 +#: pytrainer/main.py:461 msgid "Delete this waypoint?" msgstr "¿Borrar este waypoint?" @@ -1328,6 +1525,10 @@ msgid "GPS eXchange file" msgstr "Fichero de intercambio GPS" +#: import/file_kml20.py:50 +msgid "Geodistance kml version 2.0 file" +msgstr "Fichero kml v2.0" + #: import/file_garmintcxv1.py:46 msgid "Garmin training center database file version 1" msgstr "Versión 1 del fichero Garmin training center database" @@ -1352,6 +1553,24 @@ msgid "Garmin training center database file version 2" msgstr "Versión 2 del fichero Garmin training center database" +#~ msgid "Clear" +#~ msgstr "Limpiar" + +#~ msgid "<b>Select a file to import</b>" +#~ msgstr "<b>Seleccionar fichero a importar</b>" + +#~ msgid "Velocity (km/h)" +#~ msgstr "Velocidad (km/h)" + +#~ msgid "<b>Velocity</b>" +#~ msgstr "<b>Velocidad</b>" + +#~ msgid "Unknown file type" +#~ msgstr "Tipo de fichero desconocido" + +#~ msgid "Import Success" +#~ msgstr "Importación satisfactoria" + #~ msgid "<b>Date Time:</b>" #~ msgstr "<b>Fecha:</b>" @@ -1434,9 +1653,6 @@ #~ msgid "monthly beats" #~ msgstr "pulsaciones mensuales" -#~ msgid "average (hm/h)" -#~ msgstr "media (km/h)" - #~ msgid "calories" #~ msgstr "calorias" @@ -1528,9 +1744,6 @@ #~ "Estás a punto de borrar una entrada en la base de datos. Estás seguro de " #~ "que quieres hacer eso?" -#~ msgid "Active" -#~ msgstr "Activo" - #~ msgid "unActive" #~ msgstr "inActivo" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jb...@us...> - 2010-03-19 06:52:17
|
Revision: 538 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=538&view=rev Author: jblance Date: 2010-03-19 06:52:10 +0000 (Fri, 19 Mar 2010) Log Message: ----------- Unified import - fix to preserve information across tab changes Modified Paths: -------------- pytrainer/trunk/pytrainer/gui/windowimportdata.py pytrainer/trunk/pytrainer/gui/windowrecord.py pytrainer/trunk/pytrainer/main.py Modified: pytrainer/trunk/pytrainer/gui/windowimportdata.py =================================================================== --- pytrainer/trunk/pytrainer/gui/windowimportdata.py 2010-03-16 08:32:00 UTC (rev 537) +++ pytrainer/trunk/pytrainer/gui/windowimportdata.py 2010-03-19 06:52:10 UTC (rev 538) @@ -60,9 +60,16 @@ else: self.auto_launch = False logging.debug("Default tab: %s, Auto launch: %s" % (str(self.defaulttab), str(self.auto_launch))) + self.init_all_tabs() self.notebookMainTabs.set_current_page(self.defaulttab) - self.init_tab(self.defaulttab, first=True) + self.init_tab(self.defaulttab, first=True) #TODO fix so dont need to re-call init_tab logging.debug("<<") + + def init_all_tabs(self): + logging.debug(">>") + tabs = (0,1,2,3) + for tab in tabs: + self.init_tab(tab) def init_tab(self, page, first=False): ''' Initialise tab ''' @@ -83,7 +90,6 @@ else: #unknown tab logging.error("Unknown page %d passed to init_tab" % page) - pass def updateStatusbar(self, statusbar, text, context_id = None): ''' Help function to set the text of the statusbar ''' @@ -596,7 +602,7 @@ def on_notebookMainTabs_switch_page(self, notebook, page, new_page): logging.debug('--') - self.init_tab(new_page) + #self.init_tab(new_page) def on_buttonOptionsSave_clicked(self, widget): logging.debug('>>') Modified: pytrainer/trunk/pytrainer/gui/windowrecord.py =================================================================== --- pytrainer/trunk/pytrainer/gui/windowrecord.py 2010-03-16 08:32:00 UTC (rev 537) +++ pytrainer/trunk/pytrainer/gui/windowrecord.py 2010-03-19 06:52:10 UTC (rev 538) @@ -149,8 +149,8 @@ #Add columns column = gtk.TreeViewColumn(column_name, gtk.CellRendererText(), text=column_index) column.set_sort_column_id(column_index) - #if column_name == "id": - # column.set_visible(False) + if column_name == "id": + column.set_visible(False) column.set_resizable(True) self.treeviewEntries.append_column(column) self.treeviewEntries.set_headers_clickable(True) Modified: pytrainer/trunk/pytrainer/main.py =================================================================== --- pytrainer/trunk/pytrainer/main.py 2010-03-16 08:32:00 UTC (rev 537) +++ pytrainer/trunk/pytrainer/main.py 2010-03-19 06:52:10 UTC (rev 538) @@ -63,7 +63,7 @@ class pyTrainer: def __init__(self,filename = None, data_path = None): #Version constants - self.version ="1.7.1_svn#537" + self.version ="1.7.1_svn#538" self.DB_version = 3 #Setup usage and permitted options This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jb...@us...> - 2010-03-16 08:32:08
|
Revision: 537 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=537&view=rev Author: jblance Date: 2010-03-16 08:32:00 +0000 (Tue, 16 Mar 2010) Log Message: ----------- Unified import - bug fix for edited comments Modified Paths: -------------- pytrainer/trunk/pytrainer/gui/windowmain.py pytrainer/trunk/pytrainer/gui/windowrecord.py pytrainer/trunk/pytrainer/main.py Modified: pytrainer/trunk/pytrainer/gui/windowmain.py =================================================================== --- pytrainer/trunk/pytrainer/gui/windowmain.py 2010-03-15 09:18:47 UTC (rev 536) +++ pytrainer/trunk/pytrainer/gui/windowmain.py 2010-03-16 08:32:00 UTC (rev 537) @@ -122,7 +122,7 @@ self.recordbuttons_hbox.show_all() def runExtension(self,widget,widget2,extension): - print extension + #print extension txtbutton,extensioncode,extensiontype = extension id = None if extensiontype=="record": Modified: pytrainer/trunk/pytrainer/gui/windowrecord.py =================================================================== --- pytrainer/trunk/pytrainer/gui/windowrecord.py 2010-03-15 09:18:47 UTC (rev 536) +++ pytrainer/trunk/pytrainer/gui/windowrecord.py 2010-03-16 08:32:00 UTC (rev 537) @@ -364,14 +364,14 @@ #set duration time = Date().time2second(self.activity_data[row]["rcd_time"]) #TODO Fix to use timeinseconds!! self.setTime(time) #TODO Fix to use timeinseconds!! - #self.rcd_hour.set_value(self.activity_data[row]["rcd_hour"]) - #self.rcd_min.set_value(self.activity_data[row]["rcd_min"]) - #self.rcd_second.set_value(self.activity_data[row]["rcd_second"]) #Set distance self.setValue("rcd_distance",self.activity_data[row]["rcd_distance"], "%s") - #set start date - #start_date = start - #self.setValue("rcd_date", start, "%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: @@ -396,16 +396,17 @@ 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"], "%0.0f") - self.setValue("rcd_beats",self.activity_data[row]["rcd_beats"], "%0.0f") - self.setValue("rcd_upositive",self.activity_data[row]["rcd_upositive"]) - self.setValue("rcd_unegative",self.activity_data[row]["rcd_unegative"]) + 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"], "%0.0f") + self.setValue("rcd_maxbeats",self.activity_data[row]["rcd_maxbeats"], "%s") self.rcd_title.set_text(self.activity_data[row]["rcd_title"]) + def on_rcd_title_changed(self, widget): if self.mode == "multiple_activities" and self.active_row is not None: self.activity_data[self.active_row]["rcd_title"] = self.rcd_title.get_text() Modified: pytrainer/trunk/pytrainer/main.py =================================================================== --- pytrainer/trunk/pytrainer/main.py 2010-03-15 09:18:47 UTC (rev 536) +++ pytrainer/trunk/pytrainer/main.py 2010-03-16 08:32:00 UTC (rev 537) @@ -63,7 +63,7 @@ class pyTrainer: def __init__(self,filename = None, data_path = None): #Version constants - self.version ="1.7.1_svn#536" + self.version ="1.7.1_svn#537" self.DB_version = 3 #Setup usage and permitted options This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jb...@us...> - 2010-03-15 09:18:54
|
Revision: 536 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=536&view=rev Author: jblance Date: 2010-03-15 09:18:47 +0000 (Mon, 15 Mar 2010) Log Message: ----------- Some minor fixes to extension code. Start of Openstreetmap extension - INCOMPLETE Modified Paths: -------------- pytrainer/trunk/glade/pytrainer.glade pytrainer/trunk/pytrainer/extension.py pytrainer/trunk/pytrainer/gui/windowextensions.py pytrainer/trunk/pytrainer/gui/windowmain.py pytrainer/trunk/pytrainer/main.py pytrainer/trunk/setup.py Added Paths: ----------- pytrainer/trunk/extensions/openstreetmap/ pytrainer/trunk/extensions/openstreetmap/README.txt pytrainer/trunk/extensions/openstreetmap/conf.xml pytrainer/trunk/extensions/openstreetmap/openstreetmap.py pytrainer/trunk/glade/extensions.glade Added: pytrainer/trunk/extensions/openstreetmap/README.txt =================================================================== --- pytrainer/trunk/extensions/openstreetmap/README.txt (rev 0) +++ pytrainer/trunk/extensions/openstreetmap/README.txt 2010-03-15 09:18:47 UTC (rev 536) @@ -0,0 +1,18 @@ + Openstreetmap pytrainer extension + =============================== + This extension allows you to post your sport record directly + into Openstreetmap. + + CONFIG OPTIONS + ============== + You MUST fill in all the fields + + username: A valid Openstreetmap username + + password: The password for the Openstreetmap username. + + + USAGE + ===== + Simply submit the openstreetmap extension preferences form and then go + to the record tab and press "Post to Openstreetmap". Added: pytrainer/trunk/extensions/openstreetmap/conf.xml =================================================================== --- pytrainer/trunk/extensions/openstreetmap/conf.xml (rev 0) +++ pytrainer/trunk/extensions/openstreetmap/conf.xml 2010-03-15 09:18:47 UTC (rev 536) @@ -0,0 +1,13 @@ +<?xml version="1.0" ?> +<pytrainer-extension + name="Openstreetmap Export" + description="Publish your record to Openstreetmap" + extensionbutton="Post to Openstreetmap" + extensioncode="openstreetmap" + type="record" + helpfile="README.txt" + executable="openstreetmap" +> +<conf-values variable="username" value=""/> +<conf-values variable="password" value=""/> +</pytrainer-extension> Added: pytrainer/trunk/extensions/openstreetmap/openstreetmap.py =================================================================== --- pytrainer/trunk/extensions/openstreetmap/openstreetmap.py (rev 0) +++ pytrainer/trunk/extensions/openstreetmap/openstreetmap.py 2010-03-15 09:18:47 UTC (rev 536) @@ -0,0 +1,18 @@ +#!/usr/bin/env python +from optparse import OptionParser +import os +import sys + +class openstreetmap: + def __init__(self, parent = None, pytrainer_main = None, conf_dir = None, options = None): + #TODO could use some logging + self.parent = parent + self.pytrainer_main = pytrainer_main + self.options = options + self.conf_dir = conf_dir + + def run(self, id): + options = self.options + print options + print "Record id: %s" % str(id) + print "THIS DOESNT WORK YET!!!!" Added: pytrainer/trunk/glade/extensions.glade =================================================================== --- pytrainer/trunk/glade/extensions.glade (rev 0) +++ pytrainer/trunk/glade/extensions.glade 2010-03-15 09:18:47 UTC (rev 536) @@ -0,0 +1,227 @@ +<?xml version="1.0"?> +<glade-interface> + <!-- interface-requires gtk+ 2.16 --> + <!-- interface-naming-policy toplevel-contextual --> + <widget class="GtkWindow" id="extensions"> + <property name="width_request">606</property> + <property name="height_request">249</property> + <property name="visible">True</property> + <property name="title" translatable="yes">Extensions</property> + <property name="icon">logo_mini.png</property> + <signal name="destroy" handler="gtk_main_quit"/> + <child> + <widget class="GtkHBox" id="hbox32"> + <property name="width_request">32</property> + <property name="height_request">16</property> + <property name="visible">True</property> + <property name="border_width">9</property> + <child> + <widget class="GtkScrolledWindow" id="scrolledwindow4"> + <property name="width_request">230</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="shadow_type">in</property> + <child> + <widget class="GtkTreeView" id="extensionsTree"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="rules_hint">True</property> + <signal name="button_release_event" handler="on_extensionsTree_clicked"/> + </widget> + </child> + </widget> + <packing> + <property name="expand">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <widget class="GtkVBox" id="vbox20"> + <property name="visible">True</property> + <property name="orientation">vertical</property> + <child> + <widget class="GtkTable" id="table11"> + <property name="visible">True</property> + <property name="border_width">5</property> + <property name="n_rows">4</property> + <property name="n_columns">2</property> + <property name="column_spacing">5</property> + <property name="row_spacing">5</property> + <child> + <widget class="GtkLabel" id="label-2147483648"> + <property name="visible">True</property> + <property name="xalign">0</property> + <property name="label" translatable="yes"><b>Extension Details</b></property> + <property name="use_markup">True</property> + </widget> + <packing> + <property name="right_attach">2</property> + <property name="x_options">GTK_FILL</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="nameEntry"> + <property name="visible">True</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">name-entry</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options">GTK_FILL</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="label166"> + <property name="visible">True</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Name:</property> + <property name="use_markup">True</property> + </widget> + <packing> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options">GTK_FILL</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="label168"> + <property name="visible">True</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Status:</property> + <property name="use_markup">True</property> + </widget> + <packing> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> + <property name="x_options">GTK_FILL</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="label167"> + <property name="visible">True</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Description:</property> + <property name="use_markup">True</property> + </widget> + <packing> + <property name="top_attach">3</property> + <property name="bottom_attach">4</property> + <property name="x_options">GTK_FILL</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="statusEntry"> + <property name="visible">True</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">status-entry</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> + <property name="x_options">GTK_FILL</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="descriptionEntry"> + <property name="visible">True</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">description-entry</property> + <property name="wrap">True</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">3</property> + <property name="bottom_attach">4</property> + <property name="x_options">GTK_FILL</property> + <property name="y_options"></property> + </packing> + </child> + </widget> + <packing> + <property name="position">0</property> + </packing> + </child> + <child> + <widget class="GtkHBox" id="hbox33"> + <property name="visible">True</property> + <child> + <widget class="GtkLabel" id="label11111"> + <property name="visible">True</property> + </widget> + <packing> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <widget class="GtkButton" id="button30"> + <property name="label">gtk-help</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_stock">True</property> + <signal name="clicked" handler="on_help_clicked"/> + </widget> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">1</property> + </packing> + </child> + <child> + <widget class="GtkButton" id="button29"> + <property name="label">gtk-preferences</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_stock">True</property> + <signal name="clicked" handler="on_preferences_clicked"/> + </widget> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">2</property> + </packing> + </child> + <child> + <widget class="GtkButton" id="button28"> + <property name="label">gtk-ok</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_stock">True</property> + <signal name="clicked" handler="on_accept_clicked"/> + </widget> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">3</property> + </packing> + </child> + </widget> + <packing> + <property name="expand">False</property> + <property name="position">1</property> + </packing> + </child> + </widget> + <packing> + <property name="position">1</property> + </packing> + </child> + </widget> + </child> + </widget> +</glade-interface> Modified: pytrainer/trunk/glade/pytrainer.glade =================================================================== --- pytrainer/trunk/glade/pytrainer.glade 2010-03-15 08:06:45 UTC (rev 535) +++ pytrainer/trunk/glade/pytrainer.glade 2010-03-15 09:18:47 UTC (rev 536) @@ -8711,385 +8711,6 @@ </child> </widget> -<widget class="GtkWindow" id="extensions"> - <property name="width_request">606</property> - <property name="height_request">249</property> - <property name="visible">True</property> - <property name="title" translatable="yes">Extensions</property> - <property name="type">GTK_WINDOW_TOPLEVEL</property> - <property name="window_position">GTK_WIN_POS_NONE</property> - <property name="modal">False</property> - <property name="resizable">True</property> - <property name="destroy_with_parent">False</property> - <property name="icon">logo_mini.png</property> - <property name="decorated">True</property> - <property name="skip_taskbar_hint">False</property> - <property name="skip_pager_hint">False</property> - <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property> - <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> - <property name="focus_on_map">True</property> - <property name="urgency_hint">False</property> - <signal name="destroy" handler="gtk_main_quit" last_modification_time="Mon, 30 Oct 2006 13:17:50 GMT"/> - - <child> - <widget class="GtkHBox" id="hbox32"> - <property name="border_width">9</property> - <property name="width_request">32</property> - <property name="height_request">16</property> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkScrolledWindow" id="scrolledwindow4"> - <property name="width_request">230</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="hscrollbar_policy">GTK_POLICY_ALWAYS</property> - <property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property> - <property name="shadow_type">GTK_SHADOW_IN</property> - <property name="window_placement">GTK_CORNER_TOP_LEFT</property> - - <child> - <widget class="GtkTreeView" id="extensionsTree"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="headers_visible">True</property> - <property name="rules_hint">True</property> - <property name="reorderable">False</property> - <property name="enable_search">True</property> - <property name="fixed_height_mode">False</property> - <property name="hover_selection">False</property> - <property name="hover_expand">False</property> - <signal name="button_release_event" handler="on_extensionsTree_clicked" last_modification_time="Tue, 31 Oct 2006 09:45:28 GMT"/> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkVBox" id="vbox20"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkTable" id="table11"> - <property name="border_width">5</property> - <property name="visible">True</property> - <property name="n_rows">4</property> - <property name="n_columns">2</property> - <property name="homogeneous">False</property> - <property name="row_spacing">5</property> - <property name="column_spacing">5</property> - - <child> - <widget class="GtkLabel" id="label-2147483648"> - <property name="visible">True</property> - <property name="label" translatable="yes"><b>Extension Details</b></property> - <property name="use_underline">False</property> - <property name="use_markup">True</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">2</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="nameEntry"> - <property name="visible">True</property> - <property name="label" translatable="yes">name-entry</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label166"> - <property name="visible">True</property> - <property name="label" translatable="yes">Name:</property> - <property name="use_underline">False</property> - <property name="use_markup">True</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label168"> - <property name="visible">True</property> - <property name="label" translatable="yes">Status:</property> - <property name="use_underline">False</property> - <property name="use_markup">True</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label167"> - <property name="visible">True</property> - <property name="label" translatable="yes">Description:</property> - <property name="use_underline">False</property> - <property name="use_markup">True</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="statusEntry"> - <property name="visible">True</property> - <property name="label" translatable="yes">status-entry</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="descriptionEntry"> - <property name="visible">True</property> - <property name="label" translatable="yes">description-entry</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">True</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkHBox" id="hbox33"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkLabel" id="label11111"> - <property name="visible">True</property> - <property name="label" translatable="yes"></property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkButton" id="button30"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label">gtk-help</property> - <property name="use_stock">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <signal name="clicked" handler="on_help_clicked" last_modification_time="Fri, 10 Nov 2006 16:26:02 GMT"/> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkButton" id="button29"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label">gtk-preferences</property> - <property name="use_stock">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <signal name="clicked" handler="on_preferences_clicked" last_modification_time="Tue, 31 Oct 2006 10:35:46 GMT"/> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkButton" id="button28"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label">gtk-ok</property> - <property name="use_stock">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <signal name="clicked" handler="on_accept_clicked" last_modification_time="Tue, 31 Oct 2006 11:54:10 GMT"/> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - </child> -</widget> - <widget class="GtkWindow" id="selecttrackdialog"> <property name="width_request">350</property> <property name="height_request">235</property> Modified: pytrainer/trunk/pytrainer/extension.py =================================================================== --- pytrainer/trunk/pytrainer/extension.py 2010-03-15 08:06:45 UTC (rev 535) +++ pytrainer/trunk/pytrainer/extension.py 2010-03-15 09:18:47 UTC (rev 536) @@ -64,25 +64,29 @@ extensiondir = self.conf.getValue("extensiondir") helpfile = pathExtension+"/"+info.getValue("pytrainer-extension","helpfile") type = info.getValue("pytrainer-extension","type") + if not os.path.isfile(extensiondir+"/"+code+"/conf.xml"): status = 0 else: info = XMLParser(extensiondir+"/"+code+"/conf.xml") status = info.getValue("pytrainer-extension","status") + #print name,description,status,helpfile,type return name,description,status,helpfile,type def getExtensionConfParams(self,pathExtension): info = XMLParser(pathExtension+"/conf.xml") code = info.getValue("pytrainer-extension","extensioncode") extensiondir = self.conf.getValue("extensiondir") + params = {} if not os.path.isfile(extensiondir+"/"+code+"/conf.xml"): - params = info.getAllValues("conf-values") - params.append(("status","0")) + prefs = info.getAllValues("conf-values") + prefs.append(("status","0")) + for pref in prefs: + params[pref[0]] = info.getValue("pytrainer-extension",pref[0]) else: prefs = info.getAllValues("conf-values") prefs.append(("status","0")) info = XMLParser(extensiondir+"/"+code+"/conf.xml") - params = {} for pref in prefs: params[pref[0]] = info.getValue("pytrainer-extension",pref[0]) #params.append((pref[0],info.getValue("pytrainer-extension",pref[0]))) @@ -104,7 +108,7 @@ txtbutton = info.getValue("pytrainer-extension","extensionbutton") name = info.getValue("pytrainer-extension","name") type = info.getValue("pytrainer-extension","type") - print "Loading Extension %s" %name + #print "Loading Extension %s" %name return txtbutton,pathExtension,type Modified: pytrainer/trunk/pytrainer/gui/windowextensions.py =================================================================== --- pytrainer/trunk/pytrainer/gui/windowextensions.py 2010-03-15 08:06:45 UTC (rev 535) +++ pytrainer/trunk/pytrainer/gui/windowextensions.py 2010-03-15 09:18:47 UTC (rev 536) @@ -23,7 +23,7 @@ class WindowExtensions(SimpleGladeApp): def __init__(self, data_path = None, parent=None): - glade_path="glade/pytrainer.glade" + glade_path="glade/extensions.glade" root = "extensions" domain = None self.parent = parent @@ -66,10 +66,10 @@ name,description,status,helpfile,type = self.parent.getExtensionInfo(selected.get_value(iter,0)) self.nameEntry.set_text(name) self.descriptionEntry.set_text(description) - if int(status) > 0: + if status is None or int(status) == 0: + self.statusEntry.set_text(_("Disable")) + else: self.statusEntry.set_text(_("Enable")) - else: - self.statusEntry.set_text(_("Disable")) def on_preferences_clicked(self,widget): selected,iter = self.extensionsTree.get_selection().get_selected() @@ -83,19 +83,27 @@ table = gtk.Table(1,2) i=0 self.entryList = [] - for pref in prefs: - label = gtk.Label("<b>%s</b>"%pref[0]) + #print prefs + for key in prefs.keys(): + #print key, prefs[key] + label = gtk.Label("<b>%s</b>"%key) label.set_use_markup(True) - if pref[0] != "status": + if key != "status": entry = gtk.Entry() - entry.set_text(pref[1]) + if prefs[key] is None: + entry.set_text("") + else: + entry.set_text(prefs[key]) self.entryList.append(entry) table.attach(entry,1,2,i,i+1) else: combobox = gtk.combo_box_new_text() combobox.append_text("Disable") combobox.append_text("Enable") - combobox.set_active(int(pref[1])) + if prefs[key] is None: + combobox.set_active(0) + else: + combobox.set_active(int(prefs[key])) table.attach(combobox,1,2,i,i+1) self.entryList.append(combobox) table.attach(label,0,1,i,i+1) @@ -138,13 +146,13 @@ prefs = self.parent.getExtensionConfParams(selected.get_value(iter,0)) savedOptions = [] i = 0 - for pref in prefs: + for key in prefs.keys(): try: - savedOptions.append((pref[0],self.entryList[i].get_text())) + savedOptions.append((key,self.entryList[i].get_text())) except: combobox = self.entryList[i] index = combobox.get_active() - savedOptions.append((pref[0],"%s" %index)) + savedOptions.append((key,"%s" %index)) i+=1 self.prefwindow.hide() self.prefwindow = None Modified: pytrainer/trunk/pytrainer/gui/windowmain.py =================================================================== --- pytrainer/trunk/pytrainer/gui/windowmain.py 2010-03-15 08:06:45 UTC (rev 535) +++ pytrainer/trunk/pytrainer/gui/windowmain.py 2010-03-15 09:18:47 UTC (rev 536) @@ -99,6 +99,12 @@ for widget in self.menuitem1_menu: if widget.get_name() == plugin[1]: self.menuitem1_menu.remove(widget) + + def removeExtension(self, extension): + for widget in self.recordbuttons_hbox: + if widget.get_name() == extension[1]: + logging.debug("Removing extension: %s " % extension[0]) + self.recordbuttons_hbox.remove(widget) def addImportPlugin(self,plugin): button = gtk.MenuItem(plugin[0]) @@ -108,13 +114,15 @@ self.menuitem1_menu.show_all() def addExtension(self,extension): - txtbutton,extensioncode,extensiontype = extension - button = gtk.Button(txtbutton) + #txtbutton,extensioncode,extensiontype = extension + button = gtk.Button(extension[0]) + button.set_name(extension[1]) button.connect("button_press_event", self.runExtension, extension) self.recordbuttons_hbox.pack_start(button,False,False,0) self.recordbuttons_hbox.show_all() def runExtension(self,widget,widget2,extension): + print extension txtbutton,extensioncode,extensiontype = extension id = None if extensiontype=="record": Modified: pytrainer/trunk/pytrainer/main.py =================================================================== --- pytrainer/trunk/pytrainer/main.py 2010-03-15 08:06:45 UTC (rev 535) +++ pytrainer/trunk/pytrainer/main.py 2010-03-15 09:18:47 UTC (rev 536) @@ -63,7 +63,7 @@ class pyTrainer: def __init__(self,filename = None, data_path = None): #Version constants - self.version ="1.7.1_svn#535" + self.version ="1.7.1_svn#536" self.DB_version = 3 #Setup usage and permitted options @@ -362,7 +362,10 @@ def editExtensions(self): logging.debug('>>') + before = self.extension.getActiveExtensions() self.extension.manageExtensions() + after = self.extension.getActiveExtensions() + self.setExtensions(before, after) logging.debug('<<') def importData(self): @@ -400,6 +403,24 @@ txtbutton = self.plugins.loadPlugin(plugin) self.windowmain.addImportPlugin(txtbutton) logging.debug('<<') + + def setExtensions(self, before, after): + logging.debug('>>') + #Need to check for extensions that have been disabled (were active and now are not) + for extension in before: + if extension not in after: + #disabled extension -> need to unload extension + print "Need to disable extension %s " % extension + txtbutton = self.extension.loadExtension(extension) + self.windowmain.removeExtension(txtbutton) + #Need to check for plugins that have been enabled (were not active and now are) + for extension in after: + if extension not in before: + #new active extension -> need to load extension + logging.debug("Enabling extension %s " % extension) + txtbutton = self.extension.loadExtension(extension) + self.windowmain.addExtension(txtbutton) + logging.debug('<<') def newRecord(self,title=None,distance=None,time=None,upositive=None,unegative=None,bpm=None,calories=None,date=None,comment=None): logging.debug('>>') Modified: pytrainer/trunk/setup.py =================================================================== --- pytrainer/trunk/setup.py 2010-03-15 08:06:45 UTC (rev 535) +++ pytrainer/trunk/setup.py 2010-03-15 09:18:47 UTC (rev 536) @@ -42,6 +42,7 @@ install_plugin("garmintools"), install_plugin("garmintools_full"), install_extension("wordpress"), + install_extension("openstreetmap"), (install_locale("ca")), (install_locale("cs")), (install_locale("da")), This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jb...@us...> - 2010-03-15 08:06:54
|
Revision: 535 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=535&view=rev Author: jblance Date: 2010-03-15 08:06:45 +0000 (Mon, 15 Mar 2010) Log Message: ----------- Changes suggested by DF to gpx for his unique case (they dont appear to negatively impact normal cases) Modified Paths: -------------- pytrainer/trunk/pytrainer/lib/gpx.py pytrainer/trunk/pytrainer/main.py Modified: pytrainer/trunk/pytrainer/lib/gpx.py =================================================================== --- pytrainer/trunk/pytrainer/lib/gpx.py 2010-03-15 07:49:50 UTC (rev 534) +++ pytrainer/trunk/pytrainer/lib/gpx.py 2010-03-15 08:06:45 UTC (rev 535) @@ -189,10 +189,11 @@ retorno = [] his_vel = [] - last_lat = "False" - last_lon = "False" - last_time = "False" + last_lat = None + last_lon = None + last_time = None total_dist = 0 + dist_elapsed = 0 # distance since the last time found total_hr = 0 tmp_alt = 0 len_validhrpoints = 0 @@ -206,6 +207,7 @@ #mk_time = self.getDateTime(date_)[0] #UTC Date mk_time = self.getDateTime(date_)[1] #Local Date self.date = mk_time.strftime("%Y-%m-%d") + waiting_points = [] for trkpoint in trkpoints: @@ -234,7 +236,7 @@ mk_time = self.getDateTime(date_)[0] time_ = time.mktime(mk_time.timetuple()) #Convert date to seconds else: - time_ = 1 + time_ = None #get the elevation eleResult = trkpoint.find(elevationTag) if eleResult is not None: @@ -256,11 +258,11 @@ #Convert lat and lon from degrees to radians tmp_lat = float(lat)*0.01745329252 #0.01745329252 = number of radians in a degree tmp_lon = float(lon)*0.01745329252 #57.29577951 = 1/0.01745329252 or degrees per radian - tmp_time = int(time_) + #tmp_time = int(time_) #Para las vueltas diferentes a la primera / For the returns different from first - if last_lat != "False": - time_ = tmp_time - last_time + if last_lat is not None: + #time_ = tmp_time - last_time #if time_>0: #Caqlculate diference betwen last and new point #tempnum=(math.sin(last_lat)*math.sin(tmp_lat))+(math.cos(last_lat)*math.cos(tmp_lat)*math.cos(tmp_lon-last_lon)) @@ -273,32 +275,67 @@ dist=math.acos((math.sin(last_lat)*math.sin(tmp_lat))+(math.cos(last_lat)*math.cos(tmp_lat)*math.cos(tmp_lon-last_lon)))*111.302*57.29577951 except: dist=0 + dist_elapsed += dist total_dist += dist total_hr += hr if hr>self.maxhr: self.maxhr = hr - if time_>0: - #dividimos kilometros por hora (no por segundo) / Calculate kilometers per hour (not including seconds) - tmp_vel = dist/((time_)/3600.0) - vel,his_vel = self._calculate_velocity(tmp_vel,his_vel, 3) - #si la velocidad es menor de 90 lo damos por bueno / if speed is greater than 90 or time greater than 100 we exclude the result - if vel<90 and time_ <100: - if vel>self.maxvel: - self.maxvel=vel - self.total_time += time_ + #if time_>0: + # #dividimos kilometros por hora (no por segundo) / Calculate kilometers per hour (not including seconds) + # tmp_vel = dist/((time_)/3600.0) + # vel,his_vel = self._calculate_velocity(tmp_vel,his_vel, 3) + # #si la velocidad es menor de 90 lo damos por bueno / if speed is greater than 90 or time greater than 100 we exclude the result + # if vel<90 and time_ <100: + # if vel>self.maxvel: + # self.maxvel=vel + # self.total_time += time_ + if time_ is not None: + tmp_time = int(time_) + time_elapsed = tmp_time - last_time if last_time is not None else 0 + if time_elapsed>0: + #Caqlculate diference betwen last and new point + #tempnum=(math.sin(last_lat)*math.sin(tmp_lat))+(math.cos(last_lat)*math.cos(tmp_lat)*math.cos(tmp_lon-last_lon)) + #try: + #Pasamos la distancia de radianes a metros.. creo / We convert the distance from radians to meters + #David no me mates que esto lo escribi hace anhos / Do not kill me this was written ages ago + #http://faculty.washington.edu/blewis/ocn499/EXER04.htm equation for the distance between 2 points on a spherical earth + #dividimos kilometros por hora (no por segundo) / Calculate kilometers per hour (not including seconds) + tmp_vel = dist_elapsed/((time_elapsed)/3600.0) + vel,his_vel = self._calculate_velocity(tmp_vel,his_vel, 3) + #si la velocidad es menor de 90 lo damos por bueno / if speed is greater than 90 we exclude the result + self.total_time += time_elapsed + if vel<90: + if vel>self.maxvel: + self.maxvel=vel + for ((w_total_dist, w_dist, w_alt, w_total_time, w_lat, w_lon, w_hr, w_cadence)) in waiting_points: + w_time = (w_dist/dist_elapsed) * time_elapsed + w_vel = w_dist/((w_time)/3600.0) + w_total_time += w_time + retorno.append((w_total_dist, w_alt, w_total_time, w_vel, w_lat, w_lon, w_hr, w_cadence)) + waiting_points = [] + retorno.append((total_dist,tmp_alt, self.total_time,vel,lat,lon,hr,cadence)) + rel_alt = tmp_alt - last_alt #Could allow for some 'jitter' in height here + if rel_alt > 0: + self.upositive += rel_alt + elif rel_alt < 0: + self.unegative -= rel_alt + dist_elapsed = 0 else: - vel = 0 - rel_alt = tmp_alt - last_alt #Could allow for some 'jitter' in height here - if rel_alt > 0: - self.upositive += rel_alt - elif rel_alt < 0: - self.unegative -= rel_alt - retorno.append((total_dist,tmp_alt, self.total_time,vel,lat,lon,hr,cadence)) + waiting_points.append((total_dist, dist_elapsed, tmp_alt, self.total_time, lat, lon, hr, cadence)) + # vel = 0 + #rel_alt = tmp_alt - last_alt #Could allow for some 'jitter' in height here + #if rel_alt > 0: + # self.upositive += rel_alt + #elif rel_alt < 0: + # self.unegative -= rel_alt + #retorno.append((total_dist,tmp_alt, self.total_time,vel,lat,lon,hr,cadence)) last_lat = tmp_lat last_lon = tmp_lon last_alt = tmp_alt - last_time = tmp_time + #last_time = tmp_time + if time_ is not None: + last_time = int(time_) self.hr_average = 0 if len_validhrpoints > 0: Modified: pytrainer/trunk/pytrainer/main.py =================================================================== --- pytrainer/trunk/pytrainer/main.py 2010-03-15 07:49:50 UTC (rev 534) +++ pytrainer/trunk/pytrainer/main.py 2010-03-15 08:06:45 UTC (rev 535) @@ -63,7 +63,7 @@ class pyTrainer: def __init__(self,filename = None, data_path = None): #Version constants - self.version ="1.7.1_svn#534" + self.version ="1.7.1_svn#535" self.DB_version = 3 #Setup usage and permitted options This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jb...@us...> - 2010-03-15 07:49:57
|
Revision: 534 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=534&view=rev Author: jblance Date: 2010-03-15 07:49:50 +0000 (Mon, 15 Mar 2010) Log Message: ----------- Fixes to unified import, comments and advanced tab enabled for editing, main screen refreshes correctly Modified Paths: -------------- pytrainer/trunk/pytrainer/gui/windowimportdata.py pytrainer/trunk/pytrainer/gui/windowmain.py pytrainer/trunk/pytrainer/gui/windowrecord.py pytrainer/trunk/pytrainer/lib/gpx.py pytrainer/trunk/pytrainer/main.py pytrainer/trunk/pytrainer/record.py Modified: pytrainer/trunk/pytrainer/gui/windowimportdata.py =================================================================== --- pytrainer/trunk/pytrainer/gui/windowimportdata.py 2010-03-14 04:19:01 UTC (rev 533) +++ pytrainer/trunk/pytrainer/gui/windowimportdata.py 2010-03-15 07:49:50 UTC (rev 534) @@ -22,6 +22,7 @@ import os, glob, sys import StringIO import logging +import types from lxml import etree from pytrainer.plugins import Plugins @@ -453,7 +454,7 @@ duration = item[4] sport = item[5] gpx_file = self.processClasses[file_id].getGPXFile(activity_id, file_id)[1] - selectedActivities.append((activity_id, start_time, distance, duration, sport, gpx_file)) + selectedActivities.append((activity_id, start_time, distance, duration, sport, gpx_file, file_id)) logging.debug( "Found %d selected activities to import" % len(selectedActivities) ) return selectedActivities @@ -465,24 +466,20 @@ #selectedActivities.append((activity_id, start_time, distance, duration, sport, gpx_file)) logging.debug( "Importing %d activities" % len(activities)) list_sport = self.pytrainer_main.profile.getSportList() - self.pytrainer_main.record.newMultiRecord(activities, list_sport) - #sport, gpxFile = self.processClasses[file_id].getGPXFile(activity_id) - #process returned GPX files - '''if os.path.isfile(gpxFile): - logging.info('File exists. Size: %d. Sport: %s' % (os.path.getsize(gpxFile), sport)) - #TODO trigger newentry screen to allow user to edit data - #list_sport = self.pytrainer_main.profile.getSportList() - #logging.debug('id_record: '+str(id_record)+' | list_sport: '+str(list_sport)) - #def newRecord(self, list_sport, date, title=None, distance=None, time=None, upositive=None, unegative=None, bpm=None, calories=None, comment=None): - #self.pytrainer_main.record.newMultiRecord(list_sport, date=start_time, distance=distance, time=duration, comment=sport) - #self.pytrainer_main.record.importFromGPX(gpxFile, sport) - #Deselect imported activity and change note - self.updateActivity(activity_id, file_id, status=False, notes="Imported into database") - else: - logging.error('File %s not valid' % gpxFile) - ''' + result = self.pytrainer_main.record.newMultiRecord(activities, list_sport) + for activity in result: + if "db_id" in activity.keys() and type(activity["db_id"]) is types.IntType: + #Activity imported correctly + duration = "%0.0f:%0.0f:%02.0f" % (float(activity["rcd_time"][0]), float(activity["rcd_time"][1]), float(activity["rcd_time"][2])) + self.updateActivity(activity["activity_id"], activity["file_id"], + status = False, + notes = _("Imported into database"), + sport = activity["rcd_sport"], + distance = activity["rcd_distance"], + duration = duration) + #print "updating activity %s " % (str(activity)) - def updateActivity(self, activityID, file_id, status = None, notes = None): + def updateActivity(self, activityID, file_id, status = None, notes = None, sport = None, distance = None, duration = None): path = 0 for item in self.activities_store: if item[0] == activityID and item[7] == str(file_id): @@ -490,6 +487,12 @@ self.activities_store[path][1] = status if notes is not None: self.activities_store[path][6] = notes + if sport is not None: + self.activities_store[path][5] = sport + if distance is not None: + self.activities_store[path][3] = distance + if duration is not None: + self.activities_store[path][4] = duration path +=1 def close_window(self): @@ -672,11 +675,13 @@ self.files_store.set( iter, 0, class_index, - 1, False, + 1, True, 2, filename, 3, self.processClasses[class_index].getFileType(), 4, activity_count ) + #File valid, so enable remove button + self.buttonRemoveSelectedFiles.set_sensitive(1) #Get activities in file for activity in activitiesSummary: #Add activity details to TreeView store to display Modified: pytrainer/trunk/pytrainer/gui/windowmain.py =================================================================== --- pytrainer/trunk/pytrainer/gui/windowmain.py 2010-03-14 04:19:01 UTC (rev 533) +++ pytrainer/trunk/pytrainer/gui/windowmain.py 2010-03-15 07:49:50 UTC (rev 534) @@ -248,6 +248,7 @@ buffer.set_text(comments) else: + self.recordview.set_current_page(0) self.recordview.set_sensitive(0) logging.debug(">>") @@ -879,11 +880,11 @@ if self.block: self.block = False else: - self.parent.refreshListRecords() - self.parent.refreshGraphView(self.selected_view) if self.selected_view == "record": self.recordview.set_current_page(0) self.parent.refreshRecordGraphView("info") + self.parent.refreshListRecords() + self.parent.refreshGraphView(self.selected_view) def on_calendar_changemonth(self,widget): logging.debug("--") Modified: pytrainer/trunk/pytrainer/gui/windowrecord.py =================================================================== --- pytrainer/trunk/pytrainer/gui/windowrecord.py 2010-03-14 04:19:01 UTC (rev 533) +++ pytrainer/trunk/pytrainer/gui/windowrecord.py 2010-03-15 07:49:50 UTC (rev 534) @@ -37,6 +37,7 @@ self.id_record = "" self.store = None self.active_row = None + self.activity_data = [] SimpleGladeApp.__init__(self, data_path+glade_path, root, domain) self.conf_options = [ "rcd_date", @@ -81,10 +82,13 @@ if calories != None: self.rcd_calories.set_text(calories) + def getActivityData(self): + return self.activity_data + def populateMultiWindow(self, activities): self.mode = "multiple_activities" - #activities (activity_id, start_time, distance, duration, sport, gpx_file) - self.activity_data = [] + #activities (activity_id, start_time, distance, duration, sport, gpx_file, file_id) + self.activity_data = [] #Make treeview self.store = self.build_tree_view() #Add data @@ -111,9 +115,11 @@ #details["rcd_min"] = float(mins) #details["rcd_second"] = float(secs) #details["rcd_time"] = (((float(hours) * 60) + float(mins)) * 60) + float(secs) + details["activity_id"] = activity[0] details["rcd_time"] = (float(hours), float(mins), float(secs)) details["rcd_sport"] = activity[4] details["rcd_gpxfile"] = activity[5] + details["file_id"] = activity[6] self.activity_data.append(details) self.scrolledwindowEntries.show_all() #Hide some of the buttons @@ -124,16 +130,7 @@ #self.button12.hide() #Velocity "Calculate" button self.button43.hide() #Pace "Calculate" button #Make GPX file 'unsensitive' - self.rcd_gpxfile.set_sensitive(0) - #Make General settings unsensitive - #self.frameGeneral.set_sensitive(0) #TODO fix update to allow edits here - #Make Velocity settings unsensitive - #self.frameVelocity.set_sensitive(0) #TODO fix update to allow edits here - #Make advanced tab settings unsensitive - self.vbox26.set_sensitive(0) #TODO fix update to allow edits here - #Make comments unsensitive - self.frame23.set_sensitive(0) #TODO fix update to allow edits here - + self.rcd_gpxfile.set_sensitive(0) while gtk.events_pending(): # This allows the GUI to update gtk.main_iteration() # before completion of this entire action #Select first row and display details @@ -162,8 +159,23 @@ def on_accept_clicked(self,widget): if self.mode == "multiple_activities": + #Check for edited data in comments + if self.active_row is not None: + buffer = self.rcd_comments.get_buffer() + start,end = buffer.get_bounds() + comments = buffer.get_text(start,end, True).replace("\"","'") + self.activity_data[self.active_row]["rcd_comments"] = comments + #Advanced tab items + self.activity_data[self.active_row]["rcd_maxpace"] = self.rcd_maxpace.get_text() + self.activity_data[self.active_row]["rcd_pace"] = self.rcd_pace.get_text() + self.activity_data[self.active_row]["rcd_upositive"] = self.rcd_upositive.get_text() + self.activity_data[self.active_row]["rcd_unegative"] = self.rcd_unegative.get_text() + self.activity_data[self.active_row]["rcd_maxbeats"] = self.rcd_maxbeats.get_text() + self.activity_data[self.active_row]["rcd_beats"] = self.rcd_beats.get_text() + self.activity_data[self.active_row]["rcd_calories"] = self.rcd_calories.get_text() row = 0 for activity in self.activity_data: + index = self.activity_data.index(activity) if activity["complete"] is False: #Did not view or modify this record - need to get all the details print "Activity incomplete.. " + activity["rcd_gpxfile"] @@ -171,9 +183,9 @@ activity["rcd_title"] = activity["rcd_title"].replace("\"","'") #Add activity to DB etc laps = activity.pop("laps", ()) - self.parent.insertRecord(activity, laps) + self.activity_data[index]["db_id"] = self.parent.insertRecord(activity, laps) row += 1 - + logging.debug("Processed %d rows of activity data" % row) else: list_options = {} trackSummary = {} @@ -439,6 +451,21 @@ ''' Callback to display details of different activity ''' + #Check for edited data in previous row + if self.active_row is not None: + #Check for edited data in comments + buffer = self.rcd_comments.get_buffer() + start,end = buffer.get_bounds() + comments = buffer.get_text(start,end, True).replace("\"","'") + self.activity_data[self.active_row]["rcd_comments"] = comments + #Advanced tab items + self.activity_data[self.active_row]["rcd_maxpace"] = self.rcd_maxpace.get_text() + self.activity_data[self.active_row]["rcd_pace"] = self.rcd_pace.get_text() + self.activity_data[self.active_row]["rcd_upositive"] = self.rcd_upositive.get_text() + self.activity_data[self.active_row]["rcd_unegative"] = self.rcd_unegative.get_text() + self.activity_data[self.active_row]["rcd_maxbeats"] = self.rcd_maxbeats.get_text() + self.activity_data[self.active_row]["rcd_beats"] = self.rcd_beats.get_text() + self.activity_data[self.active_row]["rcd_calories"] = self.rcd_calories.get_text() #Get row that was selected x = int(event.x) y = int(event.y) Modified: pytrainer/trunk/pytrainer/lib/gpx.py =================================================================== --- pytrainer/trunk/pytrainer/lib/gpx.py 2010-03-14 04:19:01 UTC (rev 533) +++ pytrainer/trunk/pytrainer/lib/gpx.py 2010-03-15 07:49:50 UTC (rev 534) @@ -338,7 +338,7 @@ dateTime = self.getDateTime(date_time.text) zuluDateTime = dateTime[0].strftime("%Y-%m-%dT%H:%M:%SZ") localDateTime = dateTime[1] - logging.debug(gpxFile+" | "+ date_time.text +" | " + zuluDateTime) + logging.debug(gpxFile+" | "+ date_time.text +" | " + zuluDateTime + " | " + str(localDateTime)) #print localDateTime #return date_time.text logging.debug("<<") Modified: pytrainer/trunk/pytrainer/main.py =================================================================== --- pytrainer/trunk/pytrainer/main.py 2010-03-14 04:19:01 UTC (rev 533) +++ pytrainer/trunk/pytrainer/main.py 2010-03-15 07:49:50 UTC (rev 534) @@ -63,7 +63,7 @@ class pyTrainer: def __init__(self,filename = None, data_path = None): #Version constants - self.version ="1.7.1_svn#532" + self.version ="1.7.1_svn#534" self.DB_version = 3 #Setup usage and permitted options @@ -372,6 +372,8 @@ activeplugins_after = self.plugins.getActivePlugins() #Need to check for plugins that have been disabled (were active and now are not) self.setMenuPlugins(activeplugins_before, activeplugins_after) + self.refreshListRecords() + self.refreshGraphView(self.windowmain.selected_view) logging.debug('<<') def editGpsPlugins(self): Modified: pytrainer/trunk/pytrainer/record.py =================================================================== --- pytrainer/trunk/pytrainer/record.py 2010-03-14 04:19:01 UTC (rev 533) +++ pytrainer/trunk/pytrainer/record.py 2010-03-15 07:49:50 UTC (rev 534) @@ -59,6 +59,7 @@ self.recordwindow = WindowRecord(self.data_path, list_sport, parent=self, windowTitle="Modify details before importing") self.recordwindow.populateMultiWindow(activities) self.recordwindow.run() + return self.recordwindow.getActivityData() logging.debug('<<') def editRecord(self,id_record,list_sport): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jb...@us...> - 2010-03-14 04:19:07
|
Revision: 533 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=533&view=rev Author: jblance Date: 2010-03-14 04:19:01 +0000 (Sun, 14 Mar 2010) Log Message: ----------- Bug fix to allow pytrainer install to any location Modified Paths: -------------- pytrainer/trunk/bin/pytrainer Modified: pytrainer/trunk/bin/pytrainer =================================================================== --- pytrainer/trunk/bin/pytrainer 2010-03-14 02:49:38 UTC (rev 532) +++ pytrainer/trunk/bin/pytrainer 2010-03-14 04:19:01 UTC (rev 533) @@ -32,10 +32,12 @@ base_path = os.path.dirname(bin_path) data_path = base_path + "/share/pytrainer/" +site_path = base_path + "/lib/python2.6/site-packages" DIR = base_path + "/share/locale" print "data_path: " + data_path print "DIR: " + DIR +print "site_path: " + site_path gettext.bindtextdomain("pytrainer", DIR) gtk.glade.bindtextdomain("pytrainer", DIR) @@ -43,6 +45,9 @@ gettext.textdomain("pytrainer") gettext.install("pytrainer",DIR,unicode=1) +#ensure pytrainer directory is included in import path +sys.path.insert(0, site_path) + from pytrainer.main import pyTrainer os.environ['MOZILLA_FIVE_HOME']=commands.getstatusoutput("find /usr/li* -name xulrunner -exec dirname {} \; 2>/dev/null")[1] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jb...@us...> - 2010-03-14 02:49:45
|
Revision: 532 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=532&view=rev Author: jblance Date: 2010-03-14 02:49:38 +0000 (Sun, 14 Mar 2010) Log Message: ----------- Changed startup script to work with different paths Modified Paths: -------------- pytrainer/trunk/bin/pytrainer pytrainer/trunk/pytrainer/main.py Modified: pytrainer/trunk/bin/pytrainer =================================================================== --- pytrainer/trunk/bin/pytrainer 2010-03-11 08:24:47 UTC (rev 531) +++ pytrainer/trunk/bin/pytrainer 2010-03-14 02:49:38 UTC (rev 532) @@ -27,9 +27,16 @@ import os import commands -data_path = "/usr/share/pytrainer/" -DIR = "/usr/share/locale" +bin_path = os.path.realpath(os.path.dirname(__file__)) # directory that the pytrainer script executes from e.g. /usr/bin or /usr/local/bin +base_path = os.path.dirname(bin_path) + +data_path = base_path + "/share/pytrainer/" +DIR = base_path + "/share/locale" + +print "data_path: " + data_path +print "DIR: " + DIR + gettext.bindtextdomain("pytrainer", DIR) gtk.glade.bindtextdomain("pytrainer", DIR) gtk.glade.textdomain("pytrainer") Modified: pytrainer/trunk/pytrainer/main.py =================================================================== --- pytrainer/trunk/pytrainer/main.py 2010-03-11 08:24:47 UTC (rev 531) +++ pytrainer/trunk/pytrainer/main.py 2010-03-14 02:49:38 UTC (rev 532) @@ -54,7 +54,7 @@ from gui.warning import Warning from lib.date import Date from lib.gpx import Gpx -from lib.soapUtils import webService +#from lib.soapUtils import webService from lib.ddbb import DDBB from lib.xmlUtils import XMLParser from lib.system import checkConf @@ -63,7 +63,7 @@ class pyTrainer: def __init__(self,filename = None, data_path = None): #Version constants - self.version ="1.7.1_svn#530" + self.version ="1.7.1_svn#532" self.DB_version = 3 #Setup usage and permitted options This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jb...@us...> - 2010-03-11 08:24:54
|
Revision: 531 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=531&view=rev Author: jblance Date: 2010-03-11 08:24:47 +0000 (Thu, 11 Mar 2010) Log Message: ----------- Remove webservice stop on exit Modified Paths: -------------- pytrainer/trunk/pytrainer/main.py Modified: pytrainer/trunk/pytrainer/main.py =================================================================== --- pytrainer/trunk/pytrainer/main.py 2010-03-11 07:51:27 UTC (rev 530) +++ pytrainer/trunk/pytrainer/main.py 2010-03-11 08:24:47 UTC (rev 531) @@ -166,7 +166,7 @@ def quit(self): logging.debug('--') logging.info("Exit!") - self.webservice.stop() + #self.webservice.stop() self.windowmain.gtk_main_quit() logging.shutdown() sys.exit() # Any nonzero value is considered “abnormal termination” by shells and the like This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jb...@us...> - 2010-03-11 07:51:33
|
Revision: 530 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=530&view=rev Author: jblance Date: 2010-03-11 07:51:27 +0000 (Thu, 11 Mar 2010) Log Message: ----------- Minor patches from David Fraser Modified Paths: -------------- pytrainer/trunk/pytrainer/gui/windowrecord.py pytrainer/trunk/pytrainer/main.py pytrainer/trunk/pytrainer/record.py Modified: pytrainer/trunk/pytrainer/gui/windowrecord.py =================================================================== --- pytrainer/trunk/pytrainer/gui/windowrecord.py 2010-03-11 07:42:37 UTC (rev 529) +++ pytrainer/trunk/pytrainer/gui/windowrecord.py 2010-03-11 07:51:27 UTC (rev 530) @@ -471,11 +471,11 @@ sec = self.rcd_second.get_value_as_int() time = sec + (min*60) + (hour*3600) if time<1: - return false + return False time_in_min = time/60.0 distance = float(self.rcd_distance.get_text()) if distance<1: - return false + return False average = time_in_min/distance self.rcd_pace.set_text("%0.2f" %average) Modified: pytrainer/trunk/pytrainer/main.py =================================================================== --- pytrainer/trunk/pytrainer/main.py 2010-03-11 07:42:37 UTC (rev 529) +++ pytrainer/trunk/pytrainer/main.py 2010-03-11 07:51:27 UTC (rev 530) @@ -63,7 +63,7 @@ class pyTrainer: def __init__(self,filename = None, data_path = None): #Version constants - self.version ="1.7.1_svn#527" + self.version ="1.7.1_svn#530" self.DB_version = 3 #Setup usage and permitted options Modified: pytrainer/trunk/pytrainer/record.py =================================================================== --- pytrainer/trunk/pytrainer/record.py 2010-03-11 07:42:37 UTC (rev 529) +++ pytrainer/trunk/pytrainer/record.py 2010-03-11 07:51:27 UTC (rev 530) @@ -448,7 +448,7 @@ logging.debug('Found '+str(len(tracks))+' tracks') self._select_trkfromgpx(gpxfile,tracks) else: - msg = _("pyTrainer cant import data from your gpx file") + msg = _("pyTrainer can't import data from your gpx file") from gui.warning import Warning warning = Warning(self.data_path) warning.set_text(msg) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jb...@us...> - 2010-03-11 07:42:43
|
Revision: 529 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=529&view=rev Author: jblance Date: 2010-03-11 07:42:37 +0000 (Thu, 11 Mar 2010) Log Message: ----------- Some todo notes in wordpress extension Modified Paths: -------------- pytrainer/trunk/extensions/wordpress/wordpress.py Modified: pytrainer/trunk/extensions/wordpress/wordpress.py =================================================================== --- pytrainer/trunk/extensions/wordpress/wordpress.py 2010-03-11 07:38:06 UTC (rev 528) +++ pytrainer/trunk/extensions/wordpress/wordpress.py 2010-03-11 07:42:37 UTC (rev 529) @@ -10,6 +10,7 @@ class wordpress: def __init__(self, parent = None, pytrainer_main = None, conf_dir = None, options = None): + #TODO could use some logging self.parent = parent self.pytrainer_main = pytrainer_main self.options = options @@ -50,20 +51,20 @@ post.description = blog_body+blog_table+blog_route+blog_figureHR+blog_figureStage+blog_foot post.categories = blog_category idNewPost = self.wp.newPost(post, True) - print "The post has been submited" + print "The post has been submited" #TODO Notification to user else: print self.log def createRoute(self): - htmlpath = "/tmp/index.html" - kmlpath = "/tmp/gps.kml" + htmlpath = "/tmp/index.html" #TODO fix to use correct tmp dir + kmlpath = "/tmp/gps.kml" #TODO fix to use correct tmp dir description_route = '' if os.path.isfile(self.gpxfile): #create the html file - googlemaps.drawMap(self.gpxfile,self.googlekey,htmlpath) + googlemaps.drawMap(self.gpxfile,self.googlekey,htmlpath) #TODO fix to use main googlemaps and remove extensions copy #create the kml file - os.system("gpsbabel -t -i gpx -f %s -o kml,points=0,line_color=ff0000ff -F %s" %(self.gpxfile,kmlpath)) + os.system("gpsbabel -t -i gpx -f %s -o kml,points=0,line_color=ff0000ff -F %s" %(self.gpxfile,kmlpath)) #TODO fix to remove gpsbabel gfile = self.wp.newMediaObject(self.gpxfile) hfile = self.wp.newMediaObject(htmlpath) @@ -142,7 +143,7 @@ return description_table def createFigureHR(self): - hr_fig_path = "/tmp/hr.png" + hr_fig_path = "/tmp/hr.png" #TODO fix, correct tmp dir and ensure png exists blog_figures = '' # If there are no graphs, return empty string. if os.path.isfile(hr_fig_path): @@ -152,7 +153,7 @@ return blog_figures def createFigureStage(self): - stage_fig_path = "/tmp/stage.png" + stage_fig_path = "/tmp/stage.png" #TODO fix, correct tmp dir and ensure png exists blog_figures = '' # If there are no graphs, return empty string. if os.path.isfile(stage_fig_path): @@ -167,7 +168,7 @@ def createTitle(self): if self.title==None: self.error = True - self.log = "A Title must be defined. Please, configure the record propierly" + self.log = "A Title must be defined. Please, configure the record properly" return self.title def createCategory(self): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jb...@us...> - 2010-03-11 07:38:12
|
Revision: 528 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=528&view=rev Author: jblance Date: 2010-03-11 07:38:06 +0000 (Thu, 11 Mar 2010) Log Message: ----------- Removing webpublish extension as it has no content Removed Paths: ------------- pytrainer/trunk/extensions/webpublish/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jb...@us...> - 2010-03-11 07:34:58
|
Revision: 527 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=527&view=rev Author: jblance Date: 2010-03-11 07:34:51 +0000 (Thu, 11 Mar 2010) Log Message: ----------- Refactored extensions to run as internal classes - removed use of webservice in extension and in main Modified Paths: -------------- pytrainer/trunk/extensions/wordpress/conf.xml pytrainer/trunk/pytrainer/extension.py pytrainer/trunk/pytrainer/gui/windowmain.py pytrainer/trunk/pytrainer/main.py Added Paths: ----------- pytrainer/trunk/extensions/wordpress/wordpress.py Removed Paths: ------------- pytrainer/trunk/extensions/wordpress/main.py Modified: pytrainer/trunk/extensions/wordpress/conf.xml =================================================================== --- pytrainer/trunk/extensions/wordpress/conf.xml 2010-03-11 06:09:55 UTC (rev 526) +++ pytrainer/trunk/extensions/wordpress/conf.xml 2010-03-11 07:34:51 UTC (rev 527) @@ -6,7 +6,7 @@ extensioncode="wordpress" type="record" helpfile="README.txt" - executable="main.py" + executable="wordpress" > <conf-values variable="googlekey" value=""/> <conf-values variable="wordpressuser" value=""/> Deleted: pytrainer/trunk/extensions/wordpress/main.py =================================================================== --- pytrainer/trunk/extensions/wordpress/main.py 2010-03-11 06:09:55 UTC (rev 526) +++ pytrainer/trunk/extensions/wordpress/main.py 2010-03-11 07:34:51 UTC (rev 527) @@ -1,188 +0,0 @@ -#!/usr/bin/env python -from optparse import OptionParser -import os -import sys -import SOAPpy - -import wordpresslib -import googlemaps -import pytrainer.lib.points as Points -from pytrainer.lib.date import Date - -class Main: - def __init__(self,options): - self.wordpressurl = options.wordpressurl - self.user = options.wordpressuser - self.password = options.wordpresspass - self.gpxfile = options.gpxfile - self.googlekey = options.googlekey - self.idrecord = options.idrecord - self.wordpresscategory = options.wordpresscategory - self.webserviceserver = SOAPpy.SOAPProxy("http://localhost:8081/") - try: - self.wp = wordpresslib.WordPressClient(self.wordpressurl, self.user, self.password) - self.error = False - except: - self.error = True - self.log = "Url, user or pass are incorrect. Please, check your configuration" - - def createRoute(self): - htmlpath = "/tmp/index.html" - kmlpath = "/tmp/gps.kml" - description_route = '' - if os.path.isfile(self.gpxfile): - #create the html file - googlemaps.drawMap(self.gpxfile,self.googlekey,htmlpath) - #create the kml file - os.system("gpsbabel -t -i gpx -f %s -o kml,points=0,line_color=ff0000ff -F %s" %(self.gpxfile,kmlpath)) - - gfile = self.wp.newMediaObject(self.gpxfile) - hfile = self.wp.newMediaObject(htmlpath) - kfile = self.wp.newMediaObject(kmlpath) - - description_route = '''<strong>Map: </strong> <br/> - <iframe width='480' height='480' src='%s'> Need frame support </iframe><br/> - <a href='%s'>Gpx-format</a> <a href='%s'>Kml-format (GoogleEarth)</a><br/><br/>''' %(hfile,gfile,kfile) - return description_route - - def loadRecordInfo(self): - date = Date() - record = self.webserviceserver.getRecordInfo(self.idrecord) - self.sport = record["sport"] - self.date = record["date"] - self.distance = record["distance"] - self.time = date.second2time(float(record["time"])) - self.beats = record["beats"] - self.comments = record["comments"] - self.average = record["average"] - self.calories = record["calories"] - self.title = record["title"] - self.upositive = record["upositive"] - self.unegative = record["unegative"] - self.unegative = record["unegative"] - self.maxspeed = record["maxspeed"] - self.maxpace = record["maxpace"] - self.pace = record["pace"] - self.maxbeats = record["maxbeats"] - - def createBody(self): - return '''<b> Description: </b><br/> -%s<br/>''' %self.comments - - def createTable(self): - description_table = ''' - <br/> - <table border=0> - <tr> - <td><strong>Activity:</strong></td> - <td>%s</td> - <td><strong>Date:</strong></td> - <td>%s</td> - </tr> - <tr> - <td><strong>Distance:</strong></td> - <td>%s</td> - <td><strong>Time (hh, mm, ss):</strong></td> - <td>%s</td> - </tr> - <tr> - <td><strong>Max speed:</strong></td> - <td>%s</td> - <td><strong>Avg speed (km/h):</strong></td> - <td>%s</td> - </tr> - <tr> - <td><strong>Max pace (min/km):</strong></td> - <td>%s</td> - <td><strong>Avg pace (min/km):</strong></td> - <td>%s</td> - </tr> - <tr> - <td><strong>Max pulse:</strong></td> - <td>%s</td> - <td><strong>Avg pulse:</strong></td> - <td>%s</td> - </tr> - <tr> - <td><strong>Acc elevation +:</strong></td> - <td>%s</td> - <td><strong>Acc elevation -:</strong></td> - <td>%s</td> - </tr> - </table> - ''' %(self.sport,self.date,self.distance,self.time,self.maxspeed,self.average,self.maxpace,self.pace,self.maxbeats,self.beats,self.upositive,self.unegative) - return description_table - - def createFigureHR(self): - hr_fig_path = "/tmp/hr.png" - blog_figures = '' - # If there are no graphs, return empty string. - if os.path.isfile(hr_fig_path): - #the graph files are created because the graph tabs are automatically visited (which invokes graph generation) - hrfile = self.wp.newMediaObject(hr_fig_path) - blog_figures = '''<br/> <img src='%s' /> ''' %hrfile - return blog_figures - - def createFigureStage(self): - stage_fig_path = "/tmp/stage.png" - blog_figures = '' - # If there are no graphs, return empty string. - if os.path.isfile(stage_fig_path): - #the graph files are created because the graph tabs are automatically visited (which invokes graph generation) - stagefile = self.wp.newMediaObject(stage_fig_path) - blog_figures = '''<br/> <img src='%s' /> ''' %stagefile - return blog_figures - - def createFoot(self): - return ''' <br/><center>Powered by <a href='http://sourceforge.net/projects/pytrainer/'>Pytrainer</a></center>''' - - def createTitle(self): - if self.title==None: - self.error = True - self.log = "A Title must be defined. Please, configure the record propierly" - return self.title - - def createCategory(self): - if self.wordpresscategory==None: - self.error = True - self.log = "A wordpress category must be defined. Please, configure the wordpress extension" - else: - return ([self.wordpresscategory]) - - def run(self): - self.loadRecordInfo() - blog_title = self.createTitle() - blog_category = self.createCategory() - - if self.error == False: - blog_route = self.createRoute() - blog_body = self.createBody() - blog_table = self.createTable() - blog_figureHR = self.createFigureHR() - blog_figureStage = self.createFigureStage() - blog_foot = self.createFoot() - self.wp.selectBlog(0) - - post = wordpresslib.WordPressPost() - post.title = blog_title - post.description = blog_body+blog_table+blog_route+blog_figureHR+blog_figureStage+blog_foot - post.categories = blog_category - idNewPost = self.wp.newPost(post, True) - return "The post has been submited" - - else: - return self.log - -parser = OptionParser() -parser.add_option("-d", "--device", dest="device") -parser.add_option("-k", "--googlekey", dest="googlekey") -parser.add_option("-u", "--wordpressuser", dest="wordpressuser") -parser.add_option("-p", "--wordpresspass", dest="wordpresspass") -parser.add_option("-l", "--wordpressurl", dest="wordpressurl") -parser.add_option("-c", "--wordpresscategory", dest="wordpresscategory") -parser.add_option("-g", "--gpxfile", dest="gpxfile") -parser.add_option("-i", "--idrecord", dest="idrecord") -(options,args) = parser.parse_args() - -main = Main(options) -print main.run() Added: pytrainer/trunk/extensions/wordpress/wordpress.py =================================================================== --- pytrainer/trunk/extensions/wordpress/wordpress.py (rev 0) +++ pytrainer/trunk/extensions/wordpress/wordpress.py 2010-03-11 07:34:51 UTC (rev 527) @@ -0,0 +1,178 @@ +#!/usr/bin/env python +from optparse import OptionParser +import os +import sys + +import wordpresslib +import googlemaps +import pytrainer.lib.points as Points +from pytrainer.lib.date import Date + +class wordpress: + def __init__(self, parent = None, pytrainer_main = None, conf_dir = None, options = None): + self.parent = parent + self.pytrainer_main = pytrainer_main + self.options = options + self.conf_dir = conf_dir + + def run(self, id): + options = self.options + self.wordpressurl = options["wordpressurl"] + self.user = options["wordpressuser"] + self.password = options["wordpresspass"] + self.gpxfile = "%s/gpx/%s.gpx " %(self.conf_dir,id) + self.googlekey = options["googlekey"] + self.idrecord = id #options.idrecord + self.wordpresscategory = options["wordpresscategory"] + print self.wordpressurl, self.user, self.password, self.gpxfile, self.googlekey, self.googlekey, self.idrecord, self.wordpresscategory + + try: + self.wp = wordpresslib.WordPressClient(self.wordpressurl, self.user, self.password) + self.error = False + except: + self.error = True + self.log = "Url, user or pass are incorrect. Please, check your configuration" + self.loadRecordInfo() + blog_title = self.createTitle() + blog_category = self.createCategory() + + if self.error == False: + blog_route = self.createRoute() + blog_body = self.createBody() + blog_table = self.createTable() + blog_figureHR = self.createFigureHR() + blog_figureStage = self.createFigureStage() + blog_foot = self.createFoot() + self.wp.selectBlog(0) + + post = wordpresslib.WordPressPost() + post.title = blog_title + post.description = blog_body+blog_table+blog_route+blog_figureHR+blog_figureStage+blog_foot + post.categories = blog_category + idNewPost = self.wp.newPost(post, True) + print "The post has been submited" + + else: + print self.log + + def createRoute(self): + htmlpath = "/tmp/index.html" + kmlpath = "/tmp/gps.kml" + description_route = '' + if os.path.isfile(self.gpxfile): + #create the html file + googlemaps.drawMap(self.gpxfile,self.googlekey,htmlpath) + #create the kml file + os.system("gpsbabel -t -i gpx -f %s -o kml,points=0,line_color=ff0000ff -F %s" %(self.gpxfile,kmlpath)) + + gfile = self.wp.newMediaObject(self.gpxfile) + hfile = self.wp.newMediaObject(htmlpath) + kfile = self.wp.newMediaObject(kmlpath) + + description_route = '''<strong>Map: </strong> <br/> + <iframe width='480' height='480' src='%s'> Need frame support </iframe><br/> + <a href='%s'>Gpx-format</a> <a href='%s'>Kml-format (GoogleEarth)</a><br/><br/>''' %(hfile,gfile,kfile) + return description_route + + def loadRecordInfo(self): + date = Date() + record = self.pytrainer_main.record.getrecordInfo(self.idrecord)[0] + #"sports.name,date,distance,time,beats,comments,average,calories,id_record,title,upositive,unegative,maxspeed,maxpace,pace,maxbeats,date_time_utc,date_time_local", + self.sport = record[0] + self.date = record[1] + self.distance = record[2] + self.time = date.second2time(float(record[3])) + self.beats = record[4] + self.comments = record[5] + self.average = record[6] + self.calories = record[7] + self.title = record[9] + self.upositive = record[10] + self.unegative = record[11] + self.maxspeed = record[12] + self.maxpace = record[13] + self.pace = record[14] + self.maxbeats = record[15] + + def createBody(self): + return '''<b> Description: </b><br/>%s<br/>''' %self.comments + + def createTable(self): + description_table = ''' + <br/> + <table border=0> + <tr> + <td><strong>Activity:</strong></td> + <td>%s</td> + <td><strong>Date:</strong></td> + <td>%s</td> + </tr> + <tr> + <td><strong>Distance:</strong></td> + <td>%s</td> + <td><strong>Time (hh, mm, ss):</strong></td> + <td>%s</td> + </tr> + <tr> + <td><strong>Max speed:</strong></td> + <td>%s</td> + <td><strong>Avg speed (km/h):</strong></td> + <td>%s</td> + </tr> + <tr> + <td><strong>Max pace (min/km):</strong></td> + <td>%s</td> + <td><strong>Avg pace (min/km):</strong></td> + <td>%s</td> + </tr> + <tr> + <td><strong>Max pulse:</strong></td> + <td>%s</td> + <td><strong>Avg pulse:</strong></td> + <td>%s</td> + </tr> + <tr> + <td><strong>Acc elevation +:</strong></td> + <td>%s</td> + <td><strong>Acc elevation -:</strong></td> + <td>%s</td> + </tr> + </table> + ''' %(self.sport,self.date,self.distance,self.time,self.maxspeed,self.average,self.maxpace,self.pace,self.maxbeats,self.beats,self.upositive,self.unegative) + return description_table + + def createFigureHR(self): + hr_fig_path = "/tmp/hr.png" + blog_figures = '' + # If there are no graphs, return empty string. + if os.path.isfile(hr_fig_path): + #the graph files are created because the graph tabs are automatically visited (which invokes graph generation) + hrfile = self.wp.newMediaObject(hr_fig_path) + blog_figures = '''<br/> <img src='%s' /> ''' %hrfile + return blog_figures + + def createFigureStage(self): + stage_fig_path = "/tmp/stage.png" + blog_figures = '' + # If there are no graphs, return empty string. + if os.path.isfile(stage_fig_path): + #the graph files are created because the graph tabs are automatically visited (which invokes graph generation) + stagefile = self.wp.newMediaObject(stage_fig_path) + blog_figures = '''<br/> <img src='%s' /> ''' %stagefile + return blog_figures + + def createFoot(self): + return ''' <br/><center>Powered by <a href='http://sourceforge.net/projects/pytrainer/'>Pytrainer</a></center>''' + + def createTitle(self): + if self.title==None: + self.error = True + self.log = "A Title must be defined. Please, configure the record propierly" + return self.title + + def createCategory(self): + if self.wordpresscategory==None: + self.error = True + self.log = "A wordpress category must be defined. Please, configure the wordpress extension" + else: + return ([self.wordpresscategory]) Property changes on: pytrainer/trunk/extensions/wordpress/wordpress.py ___________________________________________________________________ Added: svn:executable + * Modified: pytrainer/trunk/pytrainer/extension.py =================================================================== --- pytrainer/trunk/pytrainer/extension.py 2010-03-11 06:09:55 UTC (rev 526) +++ pytrainer/trunk/pytrainer/extension.py 2010-03-11 07:34:51 UTC (rev 527) @@ -16,7 +16,8 @@ #along with this program; if not, write to the Free Software #Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -import os +import os, sys +import logging from lib.xmlUtils import XMLParser from lib.system import checkConf @@ -24,9 +25,10 @@ from gui.windowextensions import WindowExtensions class Extension: - def __init__(self, data_path = None): + def __init__(self, data_path = None, parent = None): self.data_path=data_path self.conf = checkConf() + self.parent = parent def getActiveExtensions(self): retorno = [] @@ -80,9 +82,10 @@ prefs = info.getAllValues("conf-values") prefs.append(("status","0")) info = XMLParser(extensiondir+"/"+code+"/conf.xml") - params = [] + params = {} for pref in prefs: - params.append((pref[0],info.getValue("pytrainer-extension",pref[0]))) + params[pref[0]] = info.getValue("pytrainer-extension",pref[0]) + #params.append((pref[0],info.getValue("pytrainer-extension",pref[0]))) return params def setExtensionConfParams(self,pathExtension,savedOptions): @@ -109,25 +112,44 @@ extensiondir = self.conf.getValue("extensiondir") info = XMLParser(extensiondir+"/"+code+"/conf.xml") return info.getValue("pytrainer-extension",value) + + def importClass(self, pathExtension): + logging.debug('>>') + info = XMLParser(pathExtension+"/conf.xml") + #import extension + extension_dir = os.path.realpath(pathExtension) + extension_filename = info.getValue("pytrainer-extension","executable") + extension_classname = info.getValue("pytrainer-extension","extensioncode") + extension_type = info.getValue("pytrainer-extension","type") + options = self.getExtensionConfParams(pathExtension) + logging.debug("Extension Filename: " + extension_filename ) + logging.debug("Extension Classname: " + extension_classname) + logging.debug("Extension Type: " + extension_type) + logging.debug("Extension options: " + str(options)) + sys.path.insert(0, extension_dir) + module = __import__(extension_filename) + extensionMain = getattr(module, extension_classname) + logging.debug('<<') + return extensionMain(parent=self, pytrainer_main=self.parent, conf_dir=self.conf.getValue("confdir"), options=options) - def runExtension(self,pathExtension,id): - info = XMLParser(pathExtension+"/conf.xml") - bin = info.getValue("pytrainer-extension","executable") - extensiontype = info.getValue("pytrainer-extension","type") - binnary = pathExtension+"/"+bin - params = "" - for opt in self.getExtensionConfParams(pathExtension): - if opt[0]!="status" and opt[1]!="": - params += "--%s %s " %(opt[0],opt[1]) - if extensiontype=="record": - params += "--gpxfile %s/gpx/%s.gpx " %(self.conf.getValue("confdir"),id) - params += "--idrecord %s " %id - bin = info.getValue("pytrainer-extension","executable") - print params - alert = os.popen("%s %s" %(binnary,params)).read() + #def runExtension(self,pathExtension,id): + #info = XMLParser(pathExtension+"/conf.xml") + #bin = info.getValue("pytrainer-extension","executable") + #extensiontype = info.getValue("pytrainer-extension","type") + #binnary = pathExtension+"/"+bin + #params = "" + #for opt in self.getExtensionConfParams(pathExtension): + # if opt[0]!="status" and opt[1]!="": + # params += "--%s %s " %(opt[0],opt[1]) + #if extensiontype=="record": + # params += "--gpxfile %s/gpx/%s.gpx " %(self.conf.getValue("confdir"),id) + # params += "--idrecord %s " %id + #bin = info.getValue("pytrainer-extension","executable") + #print params + #alert = os.popen("%s %s" %(binnary,params)).read() - from gui.warning import Warning - warning = Warning(self.data_path) - warning.set_text(alert) - warning.run() + #from gui.warning import Warning + #warning = Warning(self.data_path) + # warning.set_text(alert) + # warning.run() Modified: pytrainer/trunk/pytrainer/gui/windowmain.py =================================================================== --- pytrainer/trunk/pytrainer/gui/windowmain.py 2010-03-11 06:09:55 UTC (rev 526) +++ pytrainer/trunk/pytrainer/gui/windowmain.py 2010-03-11 07:34:51 UTC (rev 527) @@ -116,6 +116,7 @@ def runExtension(self,widget,widget2,extension): txtbutton,extensioncode,extensiontype = extension + id = None if extensiontype=="record": selected,iter = self.recordTreeView.get_selection().get_selected() id = selected.get_value(iter,0) Modified: pytrainer/trunk/pytrainer/main.py =================================================================== --- pytrainer/trunk/pytrainer/main.py 2010-03-11 06:09:55 UTC (rev 526) +++ pytrainer/trunk/pytrainer/main.py 2010-03-11 07:34:51 UTC (rev 527) @@ -63,7 +63,7 @@ class pyTrainer: def __init__(self,filename = None, data_path = None): #Version constants - self.version ="1.7.1_svn#526" + self.version ="1.7.1_svn#527" self.DB_version = 3 #Setup usage and permitted options @@ -145,12 +145,12 @@ #Preparamos el webservice #TODO check reason for webservice - remove / change to optional start if not needed - gtk.gdk.threads_init() - self.webservice = webService(data_path,self.refreshWaypointView,self.newRecord) - self.webservice.start() + #gtk.gdk.threads_init() + #self.webservice = webService(data_path,self.refreshWaypointView,self.newRecord) + #self.webservice.start() self.waypoint = Waypoint(data_path,self) - self.extension = Extension(data_path) + self.extension = Extension(data_path, self) self.plugins = Plugins(data_path, self) self.importdata = Importdata(data_path, self, self.configuration) self.loadPlugins() @@ -217,9 +217,12 @@ def runExtension(self,extension,id): logging.debug('>>') txtbutton,pathExtension,type = extension - if type == "record": - #Si es record le tenemos que crear el googlemaps, el gpx y darle el id de la bbdd - alert = self.extension.runExtension(pathExtension,id) + self.extensionClass = self.extension.importClass(pathExtension) + self.extensionClass.run(id) + #if type == "record": + # #Si es record le tenemos que crear el googlemaps, el gpx y darle el id de la bbdd + # alert = self.extension.runExtension(pathExtension,id) + logging.debug('<<') def refreshMainSportList(self): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jb...@us...> - 2010-03-11 06:10:01
|
Revision: 526 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=526&view=rev Author: jblance Date: 2010-03-11 06:09:55 +0000 (Thu, 11 Mar 2010) Log Message: ----------- Unified import - improved logging and bug fix to translated versions Modified Paths: -------------- pytrainer/trunk/glade/importdata.glade pytrainer/trunk/pytrainer/gui/windowimportdata.py pytrainer/trunk/pytrainer/main.py Modified: pytrainer/trunk/glade/importdata.glade =================================================================== --- pytrainer/trunk/glade/importdata.glade 2010-03-10 09:34:21 UTC (rev 525) +++ pytrainer/trunk/glade/importdata.glade 2010-03-11 06:09:55 UTC (rev 526) @@ -60,6 +60,17 @@ </packing> </child> <child> + <widget class="GtkLabel" id="labelTemp"> + <property name="visible">True</property> + <property name="label" translatable="yes">Import from GPS Device is not yet implemented</property> + </widget> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">4</property> + </packing> + </child> + <child> <widget class="GtkFrame" id="frameImportFromDevice"> <property name="label_xalign">0</property> <child> Modified: pytrainer/trunk/pytrainer/gui/windowimportdata.py =================================================================== --- pytrainer/trunk/pytrainer/gui/windowimportdata.py 2010-03-10 09:34:21 UTC (rev 525) +++ pytrainer/trunk/pytrainer/gui/windowimportdata.py 2010-03-11 06:09:55 UTC (rev 526) @@ -46,47 +46,60 @@ # SimpleGladeApp.__init__(self, self.glade_path, self.root, self.domain) def new(self): - self.defaulttab = self.configuration.getValue("pytraining","import_default_tab") - if self.defaulttab == "": - self.defaulttab = 0 - else: + logging.debug(">>") + try: + self.defaulttab = self.configuration.getValue("pytraining","import_default_tab") self.defaulttab = int(self.defaulttab) + except Exception as e: + logging.debug("Exception: %s", str(e)) + self.defaulttab = 0 self.auto_launch = self.configuration.getValue("pytraining","auto_launch_file_selection") if self.auto_launch == "True": self.auto_launch = True else: self.auto_launch = False + logging.debug("Default tab: %s, Auto launch: %s" % (str(self.defaulttab), str(self.auto_launch))) self.notebookMainTabs.set_current_page(self.defaulttab) self.init_tab(self.defaulttab, first=True) + logging.debug("<<") def init_tab(self, page, first=False): + ''' Initialise tab ''' + logging.debug(">>") + logging.debug("page: %d first: %s" % (page, first)) if page == 0: #'Import from GPS Device' tab self.init_gpsdevice_tab() elif page == 1: #'Import from File' tab self.init_file_tab(first) - elif page ==2: + elif page == 2: #'Plugins' tab self.init_plugins_tab() - elif page ==3: + elif page == 3: #'Options' tab self.init_options_tab() else: #unknown tab + logging.error("Unknown page %d passed to init_tab" % page) pass def updateStatusbar(self, statusbar, text, context_id = None): + ''' Help function to set the text of the statusbar ''' + logging.debug("Setting statusbar %s to %s" % (statusbar.get_name(), text) ) if context_id is None: context_id = statusbar.get_context_id(text) statusbar.push(context_id, text) return context_id def init_gpsdevice_tab(self): + logging.debug(">>") + logging.error("GPS Device import not yet implemented") + logging.debug("<<") return def init_file_tab(self, first=False): - #self.filechooserbuttonSelectFile.unselect_all() + logging.debug(">>") self.updateStatusbar(self.statusbarImportFile, _("No file selected") ) self.processClasses = [] if self.activities_store is None: @@ -102,16 +115,19 @@ if first and self.auto_launch: while gtk.events_pending(): # This allows the GUI to update gtk.main_iteration() # before completion of this entire action - print "autolaunch active" + logging.debug("autolaunch active") self.buttonSelectFiles.clicked() + logging.debug(">>") return def init_plugins_tab(self): + logging.debug(">>") #Remove components in vbox - in case of re-detection for child in self.vboxPlugins.get_children(): if isinstance(child, gtk.Table): self.vboxPlugins.remove(child) pluginList = self.plugins.getPluginsList() + logging.debug(pluginList) for plugin in pluginList: #Store plugin details pluginClass = plugin[0] @@ -151,9 +167,12 @@ #Add frame to tab self.vboxPlugins.pack_start(pluginTable, expand=False, fill=False, padding=5) self.win_importdata.show_all() + logging.debug("<<") return def init_options_tab(self): + logging.debug(">>") + logging.debug("Default tab %s" % str(self.defaulttab) ) #Set correct radiobutton based on saved preference if self.defaulttab == 1: self.radiobuttonFile.set_active(1) @@ -164,6 +183,7 @@ self.radiobuttonTabGPSDevice.set_active(1) if self.auto_launch: self.checkbuttonAutoLaunch.set_active(1) + logging.debug("<<") return def detect_tools(self): @@ -182,6 +202,7 @@ self.vboxImportTools.remove(child) #Get import tool_* files fileList = glob.glob(self.data_path+"import/tool_*.py") + logging.debug("Tools filelist: %s" % fileList) for toolFile in fileList: index = fileList.index(toolFile) directory, filename = os.path.split(toolFile) @@ -221,6 +242,7 @@ #toolFrame.set_sensitive(0) self.vboxImportTools.pack_start(toolFrame, expand=False, fill=False, padding=5) self.win_importdata.show_all() + logging.debug('<<') def validateFile(self, import_filename): ''' @@ -237,9 +259,11 @@ #Get import files_* files fileList = glob.glob(self.data_path+"import/file_*.py") fileList.sort() + logging.debug("File filelist: %s" % fileList) for processingFile in fileList: directory, filename = os.path.split(processingFile) filename = filename.rstrip('.py') + logging.debug("Trying: %s" % filename) classname = filename.lstrip('file_') #Import module sys.path.insert(0, self.data_path+"import") @@ -257,12 +281,14 @@ return processClass def build_files_tree_view(self): + ''' Build tree view to hold files from which the activities are read ''' + logging.debug('>>') store = gtk.ListStore( gobject.TYPE_STRING, gobject.TYPE_BOOLEAN, gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_STRING, ) - column_names=["id", _(""), _("File"), _("Type"), _("Activities")] + column_names=["id", "", _("File"), _("Type"), _("Activities")] for column_index, column_name in enumerate(column_names): if column_index == 1: #Add button column @@ -283,9 +309,12 @@ self.treeviewImportFiles.append_column(column) self.treeviewImportFiles.set_headers_clickable(True) self.treeviewImportFiles.set_model(store) + logging.debug('<<') return store def build_activities_tree_view(self): + ''' Build tree view to hold activities that can be selected for import ''' + logging.debug('>>') store = gtk.ListStore( gobject.TYPE_STRING, gobject.TYPE_BOOLEAN, gobject.TYPE_STRING, @@ -294,7 +323,7 @@ gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_STRING ) - column_names=["id", _(""), _("Start Time"), _("Distance"),_("Duration"),_("Sport"), _("Notes"), "file_id"] + column_names=["id", "", _("Start Time"), _("Distance"),_("Duration"),_("Sport"), _("Notes"), "file_id"] for column_index, column_name in enumerate(column_names): if column_index == 1: #Add checkbox column @@ -315,6 +344,7 @@ self.treeviewImportEvents.append_column(column) self.treeviewImportEvents.set_headers_clickable(True) self.treeviewImportEvents.set_model(store) + logging.debug('<<') return store def checkTreestoreForSelection(self, store): @@ -343,9 +373,9 @@ self.buttonFileImport.set_sensitive(self.checkTreestoreForSelection(store)) def treeviewImportEvents_setCheckboxes(self, state): - """ + ''' Sets or unsets all checkboxes - """ + ''' if self.activities_store is None or len(self.activities_store) == 0: return for item in self.activities_store: @@ -356,9 +386,9 @@ self.buttonFileImport.set_sensitive(0) def saveOptions(self): - """ + ''' Save options selected in options tab - """ + ''' self.autoLaunchFileSelection = "False" #Default tab option if self.radiobuttonTabGPSDevice.get_active(): @@ -369,6 +399,7 @@ self.autoLaunchFileSelection = "True" elif self.radiobuttonPlugins.get_active(): self.defaulttab = "2" + logging.debug("Saving default tab: %s, auto launch: %s" % (str(self.defaulttab), str(self.autoLaunchFileSelection))) self.configuration.setValue("pytraining","import_default_tab",self.defaulttab) self.configuration.setValue("pytraining","auto_launch_file_selection",self.autoLaunchFileSelection) #option @@ -394,9 +425,11 @@ activity_index += 1 file_iters.append( self.files_store.get_iter(file_index)) file_index += 1 + logging.debug("Removing %d activities from activity tree view" % len(activity_iters) ) for activity_iter in activity_iters: self.activities_store.remove(activity_iter) self.buttonFileImport.set_sensitive(self.checkTreestoreForSelection(self.activities_store)) #Set correct state for import button + logging.debug("Removing %d files from file tree view" % len(file_iters) ) for file_iter in file_iters: self.files_store.remove(file_iter) @@ -408,6 +441,7 @@ """ selectedActivities = [] if self.activities_store is None: + logging.debug("activities_store is empty") return None for item in self.activities_store: if item[1] is True: #Checkbox is True @@ -459,6 +493,7 @@ path +=1 def close_window(self): + logging.debug('--') self.win_importdata.hide() #self.win_importdata.destroy() self.quit() @@ -505,16 +540,22 @@ button = gtk.Button(_("Ok")) button.connect("clicked", self.on_pluginAcceptSettings_clicked, pluginClass) table.attach(button,0,2,i,i+1) - self.prefwindow.add(table) - self.prefwindow.show_all() + self.prefwindow.add(table) + self.prefwindow.show_all() def on_pluginsButton_Run_clicked(self, button, pluginClass): ''' Handler for plugin Buttons ''' + logging.debug('>>') self.pytrainer_main.runPlugin(button,pluginClass) + logging.debug('<<') def on_pluginAcceptSettings_clicked(self, widget, pluginClass): + ''' + Duplicate of plugin settings accept handler + ''' + logging.debug('>>') prefs = self.plugins.getPluginConfParams(pluginClass) savedOptions = [] i = 0 @@ -530,11 +571,13 @@ self.prefwindow = None self.plugins.setPluginConfParams(pluginClass,savedOptions) self.init_plugins_tab() + logging.debug('<<') def treeviewImportEvents_header_checkbox(self, column, store): ''' Handler for click on checkbox column ''' + logging.debug('--') if store is None: return for item in store: @@ -545,29 +588,38 @@ def on_win_importdata_delete_event(self, widget, window): ''' Window closed ''' + logging.debug('--') self.close_window() def on_notebookMainTabs_switch_page(self, notebook, page, new_page): + logging.debug('--') self.init_tab(new_page) def on_buttonOptionsSave_clicked(self, widget): + logging.debug('>>') self.updateStatusbar(self.statusbarOptions, _("Saving options")) self.saveOptions() self.updateStatusbar(self.statusbarOptions, _("Options saved")) + logging.debug('<<') def on_buttonOptionsReset_clicked(self, widget): + logging.debug('>>') #GPS Device is default self.defaulttab = 0 #Redisplay tab self.init_options_tab() self.updateStatusbar(self.statusbarOptions, "") + logging.debug('<<') def on_buttonRemoveSelectedFiles_clicked(self, widget): - #Remove selected files and associated activities from list + ''' Remove selected files and associated activities from list ''' + logging.debug('>>') self.removeSelectedFiles() + logging.debug('<<') def on_buttonFileImport_clicked(self, widget): - #Import selected activities + ''' Import selected activities ''' + logging.debug('>>') selectedActivities = self.getSelectedActivities() selectedCount = len(selectedActivities) if selectedCount > 0: @@ -578,33 +630,43 @@ msgImporting = _("Importing %d activities" % selectedCount) msgImported = _("Imported %d activities" % selectedCount) self.updateStatusbar(self.statusbarImportFile, msgImporting) + logging.debug(msgImporting) while gtk.events_pending(): # This allows the GUI to update gtk.main_iteration() # before completion of this entire action #for activity in selectedActivities: self.importSelectedActivities(selectedActivities) self.updateStatusbar(self.statusbarImportFile, msgImported) + logging.debug(msgImported) #Display informational dialog box #md = gtk.MessageDialog(self.win_importdata, gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_INFO, gtk.BUTTONS_CLOSE, msgImported) #md.set_title(_("Import Success")) #md.run() #md.destroy() self.buttonFileImport.set_sensitive(0) #Disable import button + logging.debug('<<') def on_buttonSelectFiles_clicked(self, widget): + logging.debug('>>') selectedFiles = fileChooserDialog(title=_("Choose a file (or files) to import activities from"), multiple=True).getFiles() while gtk.events_pending(): # This allows the GUI to update gtk.main_iteration() # before completion of this entire action if selectedFiles is None or len(selectedFiles) == 0: #Nothing selected + logging.debug("No files selected") + logging.debug('<<') return + logging.debug("%s files selected" % len(selectedFiles)) for filename in selectedFiles: #Multiple files class_index = len(self.processClasses) #Validate file self.processClasses.append(self.validateFile(filename)) if self.processClasses[class_index] is not None: - self.updateStatusbar(self.statusbarImportFile, _("Found file of type: %s") % self.processClasses[class_index].getFileType() ) + filetype = self.processClasses[class_index].getFileType() + self.updateStatusbar(self.statusbarImportFile, _("Found file of type: %s") % filetype ) + logging.debug(_("Found file of type: %s") % filetype) activitiesSummary = self.processClasses[class_index].getActivitiesSummary() activity_count = len(activitiesSummary) + logging.debug("%s activities in file: %s" % (str(activity_count), filename) ) #Add file to files treeview iter = self.files_store.append() self.files_store.set( @@ -638,26 +700,34 @@ ) else: #Selected file not understood by any of the process files #Display error + logging.debug(_("File %s is of unknown or unsupported file type" % filename)) msg = _("File %s is of unknown or unsupported file type" % filename) md = gtk.MessageDialog(self.win_importdata, gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_ERROR, gtk.BUTTONS_CLOSE, msg) md.set_title("Error") md.run() md.destroy() + logging.debug('<<') def on_buttonFileClose_clicked(self, widget): + logging.debug('--') self.close_window() def on_buttonDeviceClose_clicked(self, widget): + logging.debug('--') self.close_window() def on_buttonOptionsClose_clicked(self, widget): + logging.debug('--') self.close_window() def on_buttonPluginsClose_clicked(self, widget): + logging.debug('--') self.close_window() def on_buttonDeviceToolRescan_clicked(self, widget): + logging.debug('--') self.detect_tools() def on_comboboxDevice_changed(self, widget): + logging.debug('--') self.detect_tools() Modified: pytrainer/trunk/pytrainer/main.py =================================================================== --- pytrainer/trunk/pytrainer/main.py 2010-03-10 09:34:21 UTC (rev 525) +++ pytrainer/trunk/pytrainer/main.py 2010-03-11 06:09:55 UTC (rev 526) @@ -63,7 +63,7 @@ class pyTrainer: def __init__(self,filename = None, data_path = None): #Version constants - self.version ="1.7.1_svn#525" + self.version ="1.7.1_svn#526" self.DB_version = 3 #Setup usage and permitted options This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jb...@us...> - 2010-03-10 09:34:28
|
Revision: 525 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=525&view=rev Author: jblance Date: 2010-03-10 09:34:21 +0000 (Wed, 10 Mar 2010) Log Message: ----------- Unified import now supports kml files as exported by geodistance Modified Paths: -------------- pytrainer/trunk/glade/newrecord.glade pytrainer/trunk/import/file_kml20.py pytrainer/trunk/pytrainer/extensions/waypointeditor.py pytrainer/trunk/pytrainer/gui/windowrecord.py pytrainer/trunk/pytrainer/lib/gpx.py pytrainer/trunk/pytrainer/main.py pytrainer/trunk/pytrainer/record.py Modified: pytrainer/trunk/glade/newrecord.glade =================================================================== --- pytrainer/trunk/glade/newrecord.glade 2010-03-10 06:37:50 UTC (rev 524) +++ pytrainer/trunk/glade/newrecord.glade 2010-03-10 09:34:21 UTC (rev 525) @@ -546,7 +546,7 @@ <widget class="GtkLabel" id="label133"> <property name="visible">True</property> <property name="xalign">0</property> - <property name="label" translatable="yes">Velocity (km/h)</property> + <property name="label" translatable="yes">Average (km/h)</property> </widget> <packing> <property name="left_attach">2</property> @@ -592,7 +592,7 @@ <child> <widget class="GtkLabel" id="label162"> <property name="visible">True</property> - <property name="label" translatable="yes"><b>Velocity</b></property> + <property name="label" translatable="yes"><b>Speed</b></property> <property name="use_markup">True</property> </widget> <packing> Modified: pytrainer/trunk/import/file_kml20.py =================================================================== --- pytrainer/trunk/import/file_kml20.py 2010-03-10 06:37:50 UTC (rev 524) +++ pytrainer/trunk/import/file_kml20.py 2010-03-10 09:34:21 UTC (rev 525) @@ -19,7 +19,10 @@ import logging import os +import math import datetime +from dateutil.tz import * +from StringIO import StringIO from lxml import etree from pytrainer.lib.xmlUtils import XMLParser @@ -59,17 +62,18 @@ xmlschema_doc = etree.parse(self.main_data_path+"schemas/kml20-geodistance.xsd") xmlschema = etree.XMLSchema(xmlschema_doc) if (xmlschema.validate(xmldoc)): + self.activities.append(xmldoc) # Assuming one activity per file #Valid file self.xmldoc = xmldoc - startTime = datetime.datetime.now() + self.startTime = datetime.datetime.now(tzlocal()) inDatabase = False #cant really check, as dont have start time etc duration = 0 # - distance = "" + distance = self.getDistance(xmldoc) index = "%d:%d" % (0,0) sport = "Running" self.activitiesSummary.append( (index, inDatabase, - startTime.strftime("%Y-%m-%dT%H:%M:%S"), + self.startTime.strftime("%Y-%m-%dT%H:%M:%S%z"), distance, str(duration), sport, @@ -81,6 +85,35 @@ return False return False + def getDistance(self, xmldoc): + ''' function to calculate distance from gps coordinates - code from gpx.py and of uncertain origins.... + ''' + total_dist = 0 + last_lat = last_lon = None + coords = xmldoc.find(".//{http://earth.google.com/kml/2.0}coordinates") + if coords is None: + return total_dist + else: + logging.debug("Found %s coords" % len(coords)) + items = coords.text.strip().split() + lat = lon = None + for item in items: + lon, lat, other = item.split(',') + #Convert lat and lon from degrees to radians + tmp_lat = float(lat)*0.01745329252 #0.01745329252 = number of radians in a degree + tmp_lon = float(lon)*0.01745329252 #57.29577951 = 1/0.01745329252 or degrees per radian + if last_lat is not None: + try: + #dist=math.acos(tempnum)*111.302*57.29577951 + dist=math.acos((math.sin(last_lat)*math.sin(tmp_lat))+(math.cos(last_lat)*math.cos(tmp_lat)*math.cos(tmp_lon-last_lon)))*111.302*57.29577951 + except Exception as e: + print e + dist=0 + total_dist += dist + last_lat = tmp_lat + last_lon = tmp_lon + return round(total_dist, 2) + def getDateTime(self, time_): return Date().getDateTime(time_) @@ -89,27 +122,55 @@ Generate GPX file based on activity ID Returns (sport, GPX filename) ''' - '''sport = None + sport = None gpxFile = None #index = "%d:%d" % (self.activities.index((sport, activities)), activities.index(activity)) sportID, activityID = ID.split(':') sportID = int(sportID) activityID = int(activityID) - sport, activities = self.activities[sportID] + #activities = self.activities[sportID] activitiesCount = len(self.activities) if activitiesCount > 0 and activityID < activitiesCount: gpxFile = "%s/kml20-%s-%d.gpx" % (self.tmpdir, file_id, activityID) - activity = activities[activityID] + activity = self.activities[activityID] self.createGPXfile(gpxFile, activity) - return sport, gpxFile''' + return sport, gpxFile def createGPXfile(self, gpxfile, activity): ''' Function to transform a Garmin Training Center v2 Track to a valid GPX+ file ''' - '''xslt_doc = etree.parse(self.data_path+"/translate_garmintcxv1.xsl") - transform = etree.XSLT(xslt_doc) - #xml_doc = etree.parse(filename) - xml_doc = activity - result_tree = transform(xml_doc) - result_tree.write(gpxfile, xml_declaration=True)''' + tree = etree.parse(StringIO('''<?xml version='1.0' encoding='ASCII'?> + <gpx creator="pytrainer http://sourceforge.net/projects/pytrainer" + version="1.1" + xmlns="http://www.topografix.com/GPX/1/1" + xmlns:gpxdata="http://www.cluetrust.com/XML/GPXDATA/1/0" > + </gpx>''')) + + root = tree.getroot() + + metadata = etree.SubElement(root, "metadata") + name = etree.SubElement(metadata, "name") + name.text = "NeedsaName" #TODO + link = etree.SubElement(metadata, "link", href="http://sourceforge.net/projects/pytrainer") + time = etree.SubElement(metadata, "time") + time.text = self.startTime.strftime("%Y-%m-%dT%H:%M:%S%z") + trk = etree.SubElement(root, "trk") + trkseg = etree.SubElement(trk, "trkseg") + #for trkpt in file + coords = activity.find(".//{http://earth.google.com/kml/2.0}coordinates") + if coords is None: + pass + else: + items = coords.text.strip().split() + lat = lon = None + for item in items: + lon, lat, other = item.split(',') + trkpt = etree.SubElement(trkseg, "trkpt", lat=lat, lon=lon) + ele = etree.SubElement(trkpt, "ele") + ele.text = "0" #TODO + #trkpt_time = etree.SubElement(trkpt, "time") + #trkpt_time.text = "2010-03-02T04:52:35Z" #TODO + + #print(etree.tostring(tree, pretty_print=True)) + tree.write(gpxfile, method="xml", pretty_print=True, xml_declaration=True) Modified: pytrainer/trunk/pytrainer/extensions/waypointeditor.py =================================================================== --- pytrainer/trunk/pytrainer/extensions/waypointeditor.py 2010-03-10 06:37:50 UTC (rev 524) +++ pytrainer/trunk/pytrainer/extensions/waypointeditor.py 2010-03-10 09:34:21 UTC (rev 525) @@ -65,7 +65,6 @@ lon, lat, id_waypoint = float(lon), float(lat), int(id_waypoint) retorno = self.waypoint.getwaypointInfo(id_waypoint) if retorno: - print retorno name, comment, sym = retorno[0][5], retorno[0][3], retorno[0][6] self.waypoint.updateWaypoint(id_waypoint, lat, lon, name, comment, sym) else: Modified: pytrainer/trunk/pytrainer/gui/windowrecord.py =================================================================== --- pytrainer/trunk/pytrainer/gui/windowrecord.py 2010-03-10 06:37:50 UTC (rev 524) +++ pytrainer/trunk/pytrainer/gui/windowrecord.py 2010-03-10 09:34:21 UTC (rev 525) @@ -103,7 +103,10 @@ details["complete"] = False details["rcd_distance"] = activity[2] duration = activity[3] - hours, mins, secs = duration.split(":") + if duration.count(":") == 2: + hours, mins, secs = duration.split(":") + else: + hours = mins = secs = 0 #details["rcd_hour"] = float(hours) #details["rcd_min"] = float(mins) #details["rcd_second"] = float(secs) @@ -118,14 +121,14 @@ self.button24.hide() #GPX file "Calculate Values" button self.button10.hide() #Distance "Calculate" button self.button11.hide() #Duration "Calculate" button - self.button12.hide() #Velocity "Calculate" button + #self.button12.hide() #Velocity "Calculate" button self.button43.hide() #Pace "Calculate" button #Make GPX file 'unsensitive' self.rcd_gpxfile.set_sensitive(0) #Make General settings unsensitive #self.frameGeneral.set_sensitive(0) #TODO fix update to allow edits here #Make Velocity settings unsensitive - self.frameVelocity.set_sensitive(0) #TODO fix update to allow edits here + #self.frameVelocity.set_sensitive(0) #TODO fix update to allow edits here #Make advanced tab settings unsensitive self.vbox26.set_sensitive(0) #TODO fix update to allow edits here #Make comments unsensitive @@ -420,7 +423,7 @@ #Update duration in data store self.activity_data[self.active_row]["rcd_time"] = (hour, min, sec) #Update duration in treeview - self.store[self.active_row][3] = "%d:%d:%d" % (int(hour), int(min), int(sec)) + self.store[self.active_row][3] = "%d:%.2d:%.2d" % (int(hour), int(min), int(sec)) def on_rcd_date_changed(self, widget): if self.mode == "multiple_activities" and self.active_row is not None: Modified: pytrainer/trunk/pytrainer/lib/gpx.py =================================================================== --- pytrainer/trunk/pytrainer/lib/gpx.py 2010-03-10 06:37:50 UTC (rev 524) +++ pytrainer/trunk/pytrainer/lib/gpx.py 2010-03-10 09:34:21 UTC (rev 525) @@ -65,6 +65,7 @@ self.unegative = 0 self.maxvel = 0 self.maxhr = 0 + self.hr_average = 0 self.date = "" #self.Date = Date() self.calories= 0 @@ -199,6 +200,7 @@ if trkpoints is None or len(trkpoints) == 0: logging.debug( "No trkpoints found in file") return retorno + logging.debug("%d trkpoints in file" % len(trkpoints)) date_ = tree.find(timeTag).text #mk_time = self.getDateTime(date_)[0] #UTC Date @@ -210,6 +212,7 @@ lat = trkpoint.get("lat") lon = trkpoint.get("lon") if lat is None or lat == "" or lon is None or lon == "": + logging.debug("lat or lon is blank") continue #get the heart rate value from the gpx extended format file hrResult = trkpoint.find(hrTag) @@ -258,22 +261,23 @@ #Para las vueltas diferentes a la primera / For the returns different from first if last_lat != "False": time_ = tmp_time - last_time + #if time_>0: + #Caqlculate diference betwen last and new point + #tempnum=(math.sin(last_lat)*math.sin(tmp_lat))+(math.cos(last_lat)*math.cos(tmp_lat)*math.cos(tmp_lon-last_lon)) + #try: + #Pasamos la distancia de radianes a metros.. creo / We convert the distance from radians to meters + #David no me mates que esto lo escribi hace anhos / Do not kill me this was written ages ago + #http://faculty.washington.edu/blewis/ocn499/EXER04.htm equation for the distance between 2 points on a spherical earth + try: + #dist=math.acos(tempnum)*111.302*57.29577951 + dist=math.acos((math.sin(last_lat)*math.sin(tmp_lat))+(math.cos(last_lat)*math.cos(tmp_lat)*math.cos(tmp_lon-last_lon)))*111.302*57.29577951 + except: + dist=0 + total_dist += dist + total_hr += hr + if hr>self.maxhr: + self.maxhr = hr if time_>0: - #Caqlculate diference betwen last and new point - #tempnum=(math.sin(last_lat)*math.sin(tmp_lat))+(math.cos(last_lat)*math.cos(tmp_lat)*math.cos(tmp_lon-last_lon)) - #try: - #Pasamos la distancia de radianes a metros.. creo / We convert the distance from radians to meters - #David no me mates que esto lo escribi hace anhos / Do not kill me this was written ages ago - #http://faculty.washington.edu/blewis/ocn499/EXER04.htm equation for the distance between 2 points on a spherical earth - try: - #dist=math.acos(tempnum)*111.302*57.29577951 - dist=math.acos((math.sin(last_lat)*math.sin(tmp_lat))+(math.cos(last_lat)*math.cos(tmp_lat)*math.cos(tmp_lon-last_lon)))*111.302*57.29577951 - except: - dist=0 - total_dist += dist - total_hr += hr - if hr>self.maxhr: - self.maxhr = hr #dividimos kilometros por hora (no por segundo) / Calculate kilometers per hour (not including seconds) tmp_vel = dist/((time_)/3600.0) vel,his_vel = self._calculate_velocity(tmp_vel,his_vel, 3) @@ -282,12 +286,14 @@ if vel>self.maxvel: self.maxvel=vel self.total_time += time_ - retorno.append((total_dist,tmp_alt, self.total_time,vel,lat,lon,hr,cadence)) - rel_alt = tmp_alt - last_alt #Could allow for some 'jitter' in height here - if rel_alt > 0: - self.upositive += rel_alt - elif rel_alt < 0: - self.unegative -= rel_alt + else: + vel = 0 + rel_alt = tmp_alt - last_alt #Could allow for some 'jitter' in height here + if rel_alt > 0: + self.upositive += rel_alt + elif rel_alt < 0: + self.unegative -= rel_alt + retorno.append((total_dist,tmp_alt, self.total_time,vel,lat,lon,hr,cadence)) last_lat = tmp_lat last_lon = tmp_lon Modified: pytrainer/trunk/pytrainer/main.py =================================================================== --- pytrainer/trunk/pytrainer/main.py 2010-03-10 06:37:50 UTC (rev 524) +++ pytrainer/trunk/pytrainer/main.py 2010-03-10 09:34:21 UTC (rev 525) @@ -63,7 +63,7 @@ class pyTrainer: def __init__(self,filename = None, data_path = None): #Version constants - self.version ="1.7.1_svn#524" + self.version ="1.7.1_svn#525" self.DB_version = 3 #Setup usage and permitted options Modified: pytrainer/trunk/pytrainer/record.py =================================================================== --- pytrainer/trunk/pytrainer/record.py 2010-03-10 06:37:50 UTC (rev 524) +++ pytrainer/trunk/pytrainer/record.py 2010-03-10 09:34:21 UTC (rev 525) @@ -224,28 +224,31 @@ logging.debug('>>') gpx = Gpx(self.data_path,gpxOrig) distance, time, maxspeed, maxheartrate = gpx.getMaxValues() - if time == 0: #invalid record - print "Invalid record" - return (None, None) + #if time == 0: #invalid record + # print "Invalid record" + # return (None, None) upositive,unegative = gpx.getUnevenness() - speed = distance*3600/time - time_hhmmss = [time//3600,(time/60)%60,time%60] + if time > 0: + speed = distance*3600/time + time_hhmmss = [time//3600,(time/60)%60,time%60] + else: + speed = 0 + time_hhmmss = [0,0,0] summaryRecord = {} summaryRecord['rcd_gpxfile'] = gpxOrig summaryRecord['rcd_sport'] = entry[0] summaryRecord['rcd_date'] = gpx.getDate() summaryRecord['rcd_calories'] = gpx.getCalories() - logging.debug('rcd_calories: ' + str(summaryRecord['rcd_calories'])) summaryRecord['rcd_comments'] = '' summaryRecord['rcd_title'] = '' summaryRecord['rcd_time'] = time_hhmmss #ToDo: makes no sense to work with arrays summaryRecord['rcd_distance'] = "%0.2f" %distance if speed == 0: - summaryRecord['rcd_pace'] = 0 + summaryRecord['rcd_pace'] = "0" else: summaryRecord['rcd_pace'] = "%d.%02d" %((3600/speed)/60,(3600/speed)%60) if maxspeed == 0: - summaryRecord['rcd_maxpace'] = 0 + summaryRecord['rcd_maxpace'] = "0" else: summaryRecord['rcd_maxpace'] = "%d.%02d" %((3600/maxspeed)/60,(3600/maxspeed)%60) summaryRecord['rcd_average'] = speed This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jb...@us...> - 2010-03-10 06:37:56
|
Revision: 524 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=524&view=rev Author: jblance Date: 2010-03-10 06:37:50 +0000 (Wed, 10 Mar 2010) Log Message: ----------- Some minor corrections to waypoint editor code Modified Paths: -------------- pytrainer/trunk/pytrainer/extensions/waypointeditor.py pytrainer/trunk/pytrainer/main.py pytrainer/trunk/pytrainer/waypoint.py Modified: pytrainer/trunk/pytrainer/extensions/waypointeditor.py =================================================================== --- pytrainer/trunk/pytrainer/extensions/waypointeditor.py 2010-03-08 10:29:29 UTC (rev 523) +++ pytrainer/trunk/pytrainer/extensions/waypointeditor.py 2010-03-10 06:37:50 UTC (rev 524) @@ -45,6 +45,7 @@ def handle_title_changed(self, *args): title = self.moz.get_title() + print "Received title", title m = re.match("call:([a-zA-Z]*)[(](.*)[)]", title) if m: fname = m.group(1) @@ -64,7 +65,8 @@ lon, lat, id_waypoint = float(lon), float(lat), int(id_waypoint) retorno = self.waypoint.getwaypointInfo(id_waypoint) if retorno: - name, comment, sym = retorno[5], retorno[3], retorno[6] + print retorno + name, comment, sym = retorno[0][5], retorno[0][3], retorno[0][6] self.waypoint.updateWaypoint(id_waypoint, lat, lon, name, comment, sym) else: raise KeyError("Unknown waypoint id %d", id_waypoint) Modified: pytrainer/trunk/pytrainer/main.py =================================================================== --- pytrainer/trunk/pytrainer/main.py 2010-03-08 10:29:29 UTC (rev 523) +++ pytrainer/trunk/pytrainer/main.py 2010-03-10 06:37:50 UTC (rev 524) @@ -63,7 +63,7 @@ class pyTrainer: def __init__(self,filename = None, data_path = None): #Version constants - self.version ="1.7.1_svn#523" + self.version ="1.7.1_svn#524" self.DB_version = 3 #Setup usage and permitted options Modified: pytrainer/trunk/pytrainer/waypoint.py =================================================================== --- pytrainer/trunk/pytrainer/waypoint.py 2010-03-08 10:29:29 UTC (rev 523) +++ pytrainer/trunk/pytrainer/waypoint.py 2010-03-10 06:37:50 UTC (rev 524) @@ -60,8 +60,8 @@ def getwaypointInfo(self,id_waypoint): logging.debug(">>") self.ddbb.connect() - retorno = self.ddbb.select("waypoint", - "lat,lon,ele,comment,time,name,sym" + retorno = self.ddbb.select("waypoints", + "lat,lon,ele,comment,time,name,sym", "id_waypoint=\"%s\"" %id_waypoint) self.ddbb.disconnect() logging.debug("<<") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jb...@us...> - 2010-03-08 10:29:56
|
Revision: 523 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=523&view=rev Author: jblance Date: 2010-03-08 10:29:29 +0000 (Mon, 08 Mar 2010) Log Message: ----------- Unified import - Initial attempt at processing kml files, files accepted but not imported yet Modified Paths: -------------- pytrainer/trunk/pytrainer/gui/windowrecord.py pytrainer/trunk/pytrainer/main.py pytrainer/trunk/schemas/ogckml22.xsd Added Paths: ----------- pytrainer/trunk/import/file_kml20.py pytrainer/trunk/schemas/atom-author-link.xsd pytrainer/trunk/schemas/kml20-geodistance.xsd pytrainer/trunk/schemas/xAL.xsd Added: pytrainer/trunk/import/file_kml20.py =================================================================== --- pytrainer/trunk/import/file_kml20.py (rev 0) +++ pytrainer/trunk/import/file_kml20.py 2010-03-08 10:29:29 UTC (rev 523) @@ -0,0 +1,115 @@ +# -*- coding: iso-8859-1 -*- + +#Copyright (C) Fiz Vazquez vu...@si... +# Modified by dgranda + +#This program is free software; you can redistribute it and/or +#modify it under the terms of the GNU General Public License +#as published by the Free Software Foundation; either version 2 +#of the License, or (at your option) any later version. + +#This program is distributed in the hope that it will be useful, +#but WITHOUT ANY WARRANTY; without even the implied warranty of +#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +#GNU General Public License for more details. + +#You should have received a copy of the GNU General Public License +#along with this program; if not, write to the Free Software +#Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +import logging +import os +import datetime +from lxml import etree + +from pytrainer.lib.xmlUtils import XMLParser +from pytrainer.lib.system import checkConf +from pytrainer.lib.date import Date +#from pytrainer.gui.dialogs import fileChooserDialog, guiFlush + +class kml20(): + def __init__(self, parent = None, data_path = None): + self.parent = parent + self.conf = checkConf() + self.tmpdir = self.conf.getValue("tmpdir") + self.main_data_path = data_path + self.data_path = os.path.dirname(__file__) + self.xmldoc = None + self.activitiesSummary = [] + self.activities = [] + #self.sportsList = ("Running", "Biking", "Other", "MultiSport") + + def getXmldoc(self): + ''' Function to return parsed xmlfile ''' + return self.xmldoc + + def getFileType(self): + return _("Geodistance kml version 2.0 file") + + def getActivitiesSummary(self): + return self.activitiesSummary + + def testFile(self, filename): + logging.debug('>>') + logging.debug("Testing " + filename) + try: + #parse filename as xml + xmldoc = etree.parse(filename) + #Parse XML schema + xmlschema_doc = etree.parse(self.main_data_path+"schemas/kml20-geodistance.xsd") + xmlschema = etree.XMLSchema(xmlschema_doc) + if (xmlschema.validate(xmldoc)): + #Valid file + self.xmldoc = xmldoc + startTime = datetime.datetime.now() + inDatabase = False #cant really check, as dont have start time etc + duration = 0 # + distance = "" + index = "%d:%d" % (0,0) + sport = "Running" + self.activitiesSummary.append( (index, + inDatabase, + startTime.strftime("%Y-%m-%dT%H:%M:%S"), + distance, + str(duration), + sport, + ) ) + #print self.activitiesSummary + return True + except: + #Not valid file + return False + return False + + def getDateTime(self, time_): + return Date().getDateTime(time_) + + def getGPXFile(self, ID, file_id): + ''' + Generate GPX file based on activity ID + Returns (sport, GPX filename) + ''' + '''sport = None + gpxFile = None + #index = "%d:%d" % (self.activities.index((sport, activities)), activities.index(activity)) + sportID, activityID = ID.split(':') + sportID = int(sportID) + activityID = int(activityID) + sport, activities = self.activities[sportID] + activitiesCount = len(self.activities) + if activitiesCount > 0 and activityID < activitiesCount: + gpxFile = "%s/kml20-%s-%d.gpx" % (self.tmpdir, file_id, activityID) + activity = activities[activityID] + self.createGPXfile(gpxFile, activity) + return sport, gpxFile''' + + def createGPXfile(self, gpxfile, activity): + ''' Function to transform a Garmin Training Center v2 Track to a valid GPX+ file + ''' + '''xslt_doc = etree.parse(self.data_path+"/translate_garmintcxv1.xsl") + transform = etree.XSLT(xslt_doc) + #xml_doc = etree.parse(filename) + xml_doc = activity + result_tree = transform(xml_doc) + result_tree.write(gpxfile, xml_declaration=True)''' + Modified: pytrainer/trunk/pytrainer/gui/windowrecord.py =================================================================== --- pytrainer/trunk/pytrainer/gui/windowrecord.py 2010-03-08 08:58:42 UTC (rev 522) +++ pytrainer/trunk/pytrainer/gui/windowrecord.py 2010-03-08 10:29:29 UTC (rev 523) @@ -159,8 +159,6 @@ def on_accept_clicked(self,widget): if self.mode == "multiple_activities": - print "Multi window true and accept clicked" - print "#TODO" row = 0 for activity in self.activity_data: if activity["complete"] is False: Modified: pytrainer/trunk/pytrainer/main.py =================================================================== --- pytrainer/trunk/pytrainer/main.py 2010-03-08 08:58:42 UTC (rev 522) +++ pytrainer/trunk/pytrainer/main.py 2010-03-08 10:29:29 UTC (rev 523) @@ -63,7 +63,7 @@ class pyTrainer: def __init__(self,filename = None, data_path = None): #Version constants - self.version ="1.7.1_svn#522" + self.version ="1.7.1_svn#523" self.DB_version = 3 #Setup usage and permitted options Added: pytrainer/trunk/schemas/atom-author-link.xsd =================================================================== --- pytrainer/trunk/schemas/atom-author-link.xsd (rev 0) +++ pytrainer/trunk/schemas/atom-author-link.xsd 2010-03-08 10:29:29 UTC (rev 523) @@ -0,0 +1,66 @@ +<?xml version="1.0" encoding="UTF-8"?> +<schema xmlns="http://www.w3.org/2001/XMLSchema" + elementFormDefault="qualified" + targetNamespace="http://www.w3.org/2005/Atom" + xmlns:atom="http://www.w3.org/2005/Atom" version="1.0.0"> + + <annotation> + <appinfo>atom-author-link.xsd 2008-01-23</appinfo> + <documentation>There is no official atom XSD. This XSD is created based on: + http://atompub.org/2005/08/17/atom.rnc. A subset of Atom as used in the + ogckml22.xsd is defined here. </documentation> + </annotation> + + <!-- Person Construct --> + <complexType name="atomPersonConstruct"> + <choice minOccurs="0" maxOccurs="unbounded"> + <element ref="atom:name"/> + <element ref="atom:uri"/> + <element ref="atom:email"/> + </choice> + </complexType> + + <element name="name" type="string"/> + <element name="uri" type="string"/> + <element name="email" type="atom:atomEmailAddress"/> + + <!-- atom:author --> + <element name="author" type="atom:atomPersonConstruct"/> + + <!-- atom:link --> + <element name="link"> + <complexType> + + <attribute name="href" use="required"/> + <attribute name="rel"/> + <attribute name="type" type="atom:atomMediaType"/> + <attribute name="hreflang" type="atom:atomLanguageTag"/> + <attribute name="title"/> + <attribute name="length"/> + + </complexType> + + </element> + + <!-- Whatever a media type is, it contains at least one slash --> + <simpleType name="atomMediaType"> + <restriction base="string"> + <pattern value=".+/.+"/> + </restriction> + </simpleType> + + <!-- As defined in RFC 3066 --> + <simpleType name="atomLanguageTag"> + <restriction base="string"> + <pattern value="[A-Za-z]{1,8}(-[A-Za-z0-9]{1,8})*"/> + </restriction> + </simpleType> + + <!-- Whatever an email address is, it contains at least one @ --> + <simpleType name="atomEmailAddress"> + <restriction base="string"> + <pattern value=".+@.+"/> + </restriction> + </simpleType> + +</schema> Added: pytrainer/trunk/schemas/kml20-geodistance.xsd =================================================================== --- pytrainer/trunk/schemas/kml20-geodistance.xsd (rev 0) +++ pytrainer/trunk/schemas/kml20-geodistance.xsd 2010-03-08 10:29:29 UTC (rev 523) @@ -0,0 +1,773 @@ +<?xml version="1.0" encoding="utf-8"?> +<?xml-stylesheet type="text/xsl" href="xs3p.xsl"?> +<xsd:schema targetNamespace="http://earth.google.com/kml/2.0" elementFormDefault="qualified" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://earth.google.com/kml/2.0"> + <xsd:annotation> + <xsd:documentation>TimeStamp: 30-10-2005 + KML schema version 2.0 - + For more information on KML visit http://www.keyhole.com/kml/docs/webhelp/index.htm + The KML 2.0 vocabulary was not fixed at the end of October 2005. + This schema will be update weekly until fixation.</xsd:documentation> + </xsd:annotation> + <!-- ="/\w(\w|\d\_|)*/ --> + <xsd:attribute name="id" type="xsd:ID"/> + <xsd:element name="kml"> + <xsd:complexType> + <xsd:choice> + <xsd:element ref="Document"/> + <xsd:element ref="Folder"/> + <xsd:element ref="Placemark"/> + <xsd:element ref="LookAt"/> + <xsd:element ref="NetworkLink"/> + <xsd:element ref="NetworkLinkControl"/> + <xsd:element ref="GroundOverlay"/> + <xsd:element ref="ScreenOverlay"/> + </xsd:choice> + <xsd:attribute name="id" type="xsd:ID" use="optional"/> + </xsd:complexType> + </xsd:element> + <xsd:element name="Document"> + <xsd:complexType> + <xsd:choice minOccurs="0" maxOccurs="unbounded"> + <xsd:element ref="Document" minOccurs="0" maxOccurs="unbounded"/> + <xsd:element ref="Folder" minOccurs="0" maxOccurs="unbounded"/> + <xsd:element ref="GroundOverlay" minOccurs="0" maxOccurs="unbounded"/> + <xsd:element ref="LookAt" minOccurs="0" maxOccurs="unbounded"/> + <xsd:element ref="NetworkLink" minOccurs="0" maxOccurs="unbounded"/> + <xsd:element ref="Placemark" minOccurs="0" maxOccurs="unbounded"/> + <xsd:element ref="Schema" minOccurs="0" maxOccurs="unbounded"/> + <xsd:element ref="ScreenOverlay" minOccurs="0" maxOccurs="unbounded"/> + <xsd:element ref="Style" minOccurs="0" maxOccurs="unbounded"/> + <xsd:element ref="StyleMap" minOccurs="0" maxOccurs="unbounded"/> + <xsd:element ref="StyleBlinker" minOccurs="0" maxOccurs="unbounded"/> + <xsd:element ref="description" minOccurs="0"/> + <xsd:element ref="name" minOccurs="0"/> + <xsd:element ref="Snippet" minOccurs="0"/> + <xsd:element ref="visibility" minOccurs="0"/> + </xsd:choice> + <xsd:attribute name="id" type="xsd:ID" use="optional"/> + </xsd:complexType> + </xsd:element> + <xsd:element name="Folder"> + <xsd:complexType> + <xsd:choice minOccurs="0" maxOccurs="unbounded"> + <xsd:element ref="Document" minOccurs="0" maxOccurs="unbounded"/> + <xsd:element ref="Folder" minOccurs="0" maxOccurs="unbounded"/> + <xsd:element ref="GroundOverlay" minOccurs="0" maxOccurs="unbounded"/> + <xsd:element ref="LookAt" minOccurs="0" maxOccurs="unbounded"/> + <xsd:element ref="NetworkLink" minOccurs="0" maxOccurs="unbounded"/> + <xsd:element ref="Placemark" minOccurs="0" maxOccurs="unbounded"/> + <xsd:element ref="ScreenOverlay" minOccurs="0" maxOccurs="unbounded"/> + <xsd:element ref="Style" minOccurs="0" maxOccurs="unbounded"/> + <xsd:element ref="description" minOccurs="0"/> + <xsd:element ref="name" minOccurs="0"/> + <xsd:element ref="Snippet" minOccurs="0"/> + <xsd:element ref="open" minOccurs="0"/> + <xsd:element ref="visibility" minOccurs="0"/> + </xsd:choice> + <xsd:attribute name="id" type="xsd:ID" use="optional"/> + </xsd:complexType> + </xsd:element> + <xsd:element name="Placemark"> + <xsd:complexType> + <xsd:choice minOccurs="0" maxOccurs="unbounded"> + <xsd:element ref="description" minOccurs="0"/> + <xsd:element ref="name" minOccurs="0"/> + <xsd:element name="open" type="xsd:boolean"/> + <xsd:element ref="Snippet" minOccurs="0"/> + <xsd:element ref="Style" minOccurs="0"/> + <xsd:element ref="LookAt" minOccurs="0" maxOccurs="unbounded"/> + <xsd:element ref="MultiGeometry" minOccurs="0" maxOccurs="unbounded"/> + <xsd:element ref="MultiLineString" minOccurs="0" maxOccurs="unbounded"/> + <xsd:element ref="MultiPoint" minOccurs="0" maxOccurs="unbounded"/> + <xsd:element ref="MultiPolygon" minOccurs="0" maxOccurs="unbounded"/> + <xsd:element ref="Point" minOccurs="0" maxOccurs="unbounded"/> + <xsd:element ref="Polygon" minOccurs="0" maxOccurs="unbounded"/> + <xsd:element ref="TimePeriod" minOccurs="0"/> + <xsd:element ref="LineString" minOccurs="0" maxOccurs="unbounded"/> + <xsd:element ref="address" minOccurs="0"/> + <xsd:element ref="styleUrl" minOccurs="0"/> + <xsd:element ref="visibility" minOccurs="0"/> + </xsd:choice> + <xsd:attribute name="id" type="xsd:ID" use="optional"/> + </xsd:complexType> + </xsd:element> + <xsd:element name="GroundOverlay"> + <xsd:complexType> + <xsd:all> + <xsd:element ref="Icon"/> + <xsd:element ref="LatLonBox"/> + <xsd:element ref="drawOrder" minOccurs="0"/> + <xsd:element ref="description" minOccurs="0"/> + <xsd:element ref="name" minOccurs="0"/> + <xsd:element ref="LookAt" minOccurs="0"/> + <xsd:element ref="visibility" minOccurs="0"/> + <xsd:element ref="refreshInterval" minOccurs="0"/> + <xsd:element ref="color" minOccurs="0"/> + </xsd:all> + <xsd:attribute name="id" type="xsd:ID" use="optional"/> + </xsd:complexType> + </xsd:element> + <xsd:element name="LatLonBox"> + <xsd:complexType> + <xsd:all> + <xsd:element ref="north"/> + <xsd:element ref="east"/> + <xsd:element ref="south"/> + <xsd:element ref="west"/> + <xsd:element ref="rotation" minOccurs="0"/> + </xsd:all> + <xsd:attribute name="id" type="xsd:ID" use="optional"/> + </xsd:complexType> + </xsd:element> + <xsd:element name="north" type="xsd:double"/> + <xsd:element name="east" type="xsd:double"/> + <xsd:element name="south" type="xsd:double"/> + <xsd:element name="west" type="xsd:double"/> + <xsd:element name="rotation" type="xsd:decimal"/> + <xsd:element name="ScreenOverlay"> + <xsd:complexType> + <xsd:all> + <xsd:element ref="Icon"/> + <xsd:element ref="drawOrder" minOccurs="0"/> + <xsd:element ref="description" minOccurs="0"/> + <xsd:element ref="name" minOccurs="0"/> + <xsd:element ref="overlayXY" minOccurs="0"/> + <xsd:element ref="screenXY" minOccurs="0"/> + <xsd:element ref="size" minOccurs="0"/> + <xsd:element ref="visibility" minOccurs="0"/> + <xsd:element ref="rotation" minOccurs="0"/> + <xsd:element ref="refreshInterval" minOccurs="0"/> + <xsd:element ref="color" minOccurs="0"/> + </xsd:all> + <xsd:attribute name="id" type="xsd:ID" use="optional"/> + </xsd:complexType> + </xsd:element> + <xsd:element name="overlayXY"> + <xsd:complexType> + <xsd:attribute name="id" type="xsd:ID" use="optional"/> + <xsd:attribute name="x" use="required"> + <xsd:simpleType> + <xsd:restriction base="xsd:decimal"> + <xsd:minInclusive value="0"/> + </xsd:restriction> + </xsd:simpleType> + </xsd:attribute> + <xsd:attribute name="y" use="required"> + <xsd:simpleType> + <xsd:restriction base="xsd:decimal"> + <xsd:minInclusive value="0"/> + </xsd:restriction> + </xsd:simpleType> + </xsd:attribute> + <xsd:attribute name="xunits" use="required"> + <xsd:simpleType> + <xsd:restriction base="xsd:token"> + <xsd:enumeration value="pixels"/> + <xsd:enumeration value="fraction"/> + </xsd:restriction> + </xsd:simpleType> + </xsd:attribute> + <xsd:attribute name="yunits" use="required"> + <xsd:simpleType> + <xsd:restriction base="xsd:token"> + <xsd:enumeration value="pixels"/> + <xsd:enumeration value="fraction"/> + </xsd:restriction> + </xsd:simpleType> + </xsd:attribute> + </xsd:complexType> + </xsd:element> + <xsd:element name="screenXY"> + <xsd:complexType> + <xsd:attribute name="x" type="xsd:decimal" use="required"/> + <xsd:attribute name="y" type="xsd:decimal" use="required"/> + <xsd:attribute name="xunits" use="required"> + <xsd:simpleType> + <xsd:restriction base="xsd:token"> + <xsd:enumeration value="pixels"/> + <xsd:enumeration value="insetPixels"/> + <xsd:enumeration value="fraction"/> + </xsd:restriction> + </xsd:simpleType> + </xsd:attribute> + <xsd:attribute name="yunits" use="required"> + <xsd:simpleType> + <xsd:restriction base="xsd:token"> + <xsd:enumeration value="pixels"/> + <xsd:enumeration value="insetPixels"/> + <xsd:enumeration value="fraction"/> + </xsd:restriction> + </xsd:simpleType> + </xsd:attribute> + </xsd:complexType> + </xsd:element> + <xsd:element name="drawOrder"> + <xsd:simpleType> + <xsd:restriction base="xsd:int"> + <xsd:minInclusive value="0"/> + <xsd:maxInclusive value="99"/> + </xsd:restriction> + </xsd:simpleType> + </xsd:element> + <xsd:element name="Icon"> + <xsd:complexType> + <xsd:all> + <xsd:element ref="href"/> + <xsd:element ref="h" minOccurs="0"/> + <xsd:element ref="w" minOccurs="0"/> + <xsd:element ref="x" minOccurs="0"/> + <xsd:element ref="y" minOccurs="0"/> + <xsd:element ref="refreshInterval" minOccurs="0"/> + <xsd:element ref="refreshMode" minOccurs="0"/> + <xsd:element ref="viewRefreshMode" minOccurs="0"/> + <xsd:element ref="viewRefreshTime" minOccurs="0"/> + <xsd:element ref="viewBoundScale" minOccurs="0"/> + </xsd:all> + <xsd:attribute name="id" type="xsd:ID" use="optional"/> + </xsd:complexType> + </xsd:element> + <xsd:element name="x"> + <xsd:simpleType> + <xsd:restriction base="xsd:int"> + <xsd:minInclusive value="0"/> + </xsd:restriction> + </xsd:simpleType> + </xsd:element> + <xsd:element name="y"> + <xsd:simpleType> + <xsd:restriction base="xsd:int"> + <xsd:minInclusive value="0"/> + </xsd:restriction> + </xsd:simpleType> + </xsd:element> + <xsd:element name="w"> + <xsd:simpleType> + <xsd:restriction base="xsd:int"> + <xsd:minInclusive value="-1"/> + </xsd:restriction> + </xsd:simpleType> + </xsd:element> + <xsd:element name="h"> + <xsd:simpleType> + <xsd:restriction base="xsd:int"> + <xsd:minInclusive value="-1"/> + </xsd:restriction> + </xsd:simpleType> + </xsd:element> + <xsd:element name="viewBoundScale" type="xsd:double"> + <xsd:annotation> + <xsd:documentation>Used for overlays in either network links or placemark overlays to indicate the percentage of screen space to fill with data. If you are creating a ground overlay to deliver dynamic data via a network link, you can set the view-bound scale to 1.0 so that the dynamic date entirely fills the screen. This would be a typical setting to use when the user will not need to adjust the size of the overlay. Values: View bound scale is set to 1.0 as default for network links and 0.75 for overlays if not specified. Otherwise, you can set the value to a fractional portion of the screen size, including values greater than 1.0. Keep in mind that when using this tag for ground overlays where the user might want to modify the position, you should keep the value to a smaller fraction of the screen size to provide for easier editing. Otherwise, set the bound to reflect the area of data relative to the viewing boundaries of the client screen that you want to display.</xsd:documentation> + </xsd:annotation> + </xsd:element> + <xsd:element name="LookAt"> + <xsd:complexType> + <xsd:all> + <xsd:element ref="longitude"/> + <xsd:element ref="latitude"/> + <xsd:element ref="range"/> + <xsd:element ref="tilt"/> + <xsd:element ref="heading"/> + <xsd:element ref="timePosition" minOccurs="0"/> + </xsd:all> + <xsd:attribute name="id" type="xsd:ID" use="optional"/> + </xsd:complexType> + </xsd:element> + <xsd:element name="longitude" type="xsd:double"/> + <xsd:element name="latitude" type="xsd:double"/> + <xsd:element name="range" type="xsd:double"/> + <xsd:element name="tilt"> + <xsd:simpleType> + <xsd:restriction base="xsd:double"> + <xsd:minInclusive value="-90"/> + <xsd:maxInclusive value="90"/> + </xsd:restriction> + </xsd:simpleType> + </xsd:element> + <xsd:element name="heading"> + <xsd:simpleType> + <xsd:restriction base="xsd:double"> + <xsd:minInclusive value="-360"/> + <xsd:maxInclusive value="360"/> + </xsd:restriction> + </xsd:simpleType> + </xsd:element> + <xsd:element name="timePosition"> + <xsd:simpleType> + <xsd:restriction base="xsd:string"> + <xsd:pattern value="(\d{4})*(\-\d{2})*(\-\d{2})*(T\d{2}:\d{2}:\d{2})*Z*"/> + </xsd:restriction> + </xsd:simpleType> + </xsd:element> + <xsd:element name="MultiGeometry"> + <xsd:complexType> + <xsd:choice minOccurs="0" maxOccurs="unbounded"> + <xsd:element ref="extrude" minOccurs="0"/> + <xsd:element ref="tessellate" minOccurs="0"/> + <xsd:element ref="altitudeMode" minOccurs="0"/> + <xsd:element ref="MultiGeometry" minOccurs="0" maxOccurs="unbounded"/> + <xsd:element ref="MultiLineString" minOccurs="0" maxOccurs="unbounded"/> + <xsd:element ref="MultiPoint" minOccurs="0" maxOccurs="unbounded"/> + <xsd:element ref="MultiPolygon" minOccurs="0" maxOccurs="unbounded"/> + <xsd:element ref="LineString" minOccurs="0" maxOccurs="unbounded"/> + <xsd:element ref="Point" minOccurs="0" maxOccurs="unbounded"/> + <xsd:element ref="Polygon" minOccurs="0" maxOccurs="unbounded"/> + <xsd:element ref="Placemark" minOccurs="0" maxOccurs="unbounded"/> + </xsd:choice> + <xsd:attribute name="id" type="xsd:ID" use="optional"/> + </xsd:complexType> + </xsd:element> + <xsd:element name="MultiLineString"> + <xsd:complexType> + <xsd:all> + <xsd:element ref="LineString" minOccurs="0"/> + </xsd:all> + <xsd:attribute name="id" type="xsd:ID" use="optional"/> + </xsd:complexType> + </xsd:element> + <xsd:element name="LineString"> + <xsd:complexType> + <xsd:all> + <xsd:element ref="extrude" minOccurs="0"/> + <xsd:element ref="tessellate" minOccurs="0"/> + <xsd:element ref="altitudeMode" minOccurs="0"/> + <xsd:element ref="coordinates"/> + </xsd:all> + <xsd:attribute name="id" type="xsd:ID" use="optional"/> + </xsd:complexType> + </xsd:element> + <xsd:element name="MultiPoint"> + <xsd:complexType> + <xsd:all> + <xsd:element ref="Point" minOccurs="0"/> + </xsd:all> + <xsd:attribute name="id" type="xsd:ID" use="optional"/> + </xsd:complexType> + </xsd:element> + <xsd:element name="Point"> + <xsd:complexType> + <xsd:all> + <xsd:element ref="altitudeMode" minOccurs="0"/> + <xsd:element ref="extrude" minOccurs="0"/> + <xsd:element ref="coordinates"/> + </xsd:all> + <xsd:attribute name="id" type="xsd:ID" use="optional"/> + </xsd:complexType> + </xsd:element> + <xsd:element name="MultiPolygon"> + <xsd:complexType> + <xsd:all> + <xsd:element ref="Polygon" minOccurs="0"/> + </xsd:all> + <xsd:attribute name="id" type="xsd:ID" use="optional"/> + </xsd:complexType> + </xsd:element> + <xsd:element name="Polygon"> + <xsd:complexType> + <xsd:all> + <xsd:element ref="extrude" minOccurs="0"/> + <xsd:element ref="tessellate" minOccurs="0"/> + <xsd:element ref="altitudeMode" minOccurs="0"/> + <xsd:element ref="innerBoundaryIs" minOccurs="0"/> + <xsd:element ref="outerBoundaryIs" minOccurs="0"/> + </xsd:all> + <xsd:attribute name="id" type="xsd:ID" use="optional"/> + </xsd:complexType> + </xsd:element> + <xsd:element name="innerBoundaryIs"> + <xsd:complexType> + <xsd:all> + <xsd:element ref="LinearRing"/> + </xsd:all> + <xsd:attribute name="id" type="xsd:ID" use="optional"/> + </xsd:complexType> + </xsd:element> + <xsd:element name="outerBoundaryIs"> + <xsd:complexType> + <xsd:all> + <xsd:element ref="LinearRing"/> + </xsd:all> + <xsd:attribute name="id" type="xsd:ID" use="optional"/> + </xsd:complexType> + </xsd:element> + <xsd:element name="LinearRing"> + <xsd:complexType> + <xsd:all> + <xsd:element ref="coordinates"/> + </xsd:all> + <xsd:attribute name="id" type="xsd:ID" use="optional"/> + </xsd:complexType> + </xsd:element> + <xsd:element name="coordinates" type="xsd:string"/> + <xsd:element name="NetworkLinkControl"> + <xsd:complexType> + <xsd:all> + <xsd:element ref="cookie" minOccurs="0"/> + <xsd:element ref="linkDescription" minOccurs="0"/> + <xsd:element ref="linkName" minOccurs="0"/> + <!--xsd:element ref="linkSnippet" minOccurs="0"/--> + <xsd:element ref="message" minOccurs="0"/> + <xsd:element ref="minRefreshPeriod" minOccurs="0"/> + </xsd:all> + <xsd:attribute name="id" type="xsd:ID" use="optional"/> + </xsd:complexType> + </xsd:element> + <xsd:element name="cookie" type="xsd:string"/> + <xsd:element name="linkDescription" type="xsd:string"/> + <xsd:element name="linkName" type="xsd:string"/> + <xsd:element name="message" type="xsd:string"/> + <xsd:element name="minRefreshPeriod" type="xsd:int"/> + <xsd:element name="NetworkLink"> + <xsd:complexType> + <xsd:all> + <xsd:element ref="Url"/> + <xsd:element ref="flyToView" minOccurs="0"/> + <xsd:element ref="description" minOccurs="0"/> + <xsd:element ref="name" minOccurs="0"/> + <xsd:element ref="refreshVisibility" minOccurs="0"/> + <xsd:element ref="visibility" minOccurs="0"/> + </xsd:all> + <xsd:attribute name="id" type="xsd:ID" use="optional"/> + </xsd:complexType> + </xsd:element> + <xsd:element name="Url"> + <xsd:complexType> + <xsd:all> + <xsd:element ref="href"/> + <xsd:element ref="refreshMode" minOccurs="0"/> + <xsd:element ref="refreshInterval" minOccurs="0"/> + <xsd:element ref="viewRefreshMode" minOccurs="0"/> + <xsd:element ref="viewRefreshTime" minOccurs="0"/> + <xsd:element ref="viewFormat" minOccurs="0"/> + </xsd:all> + <xsd:attribute name="id" type="xsd:ID" use="optional"/> + </xsd:complexType> + </xsd:element> + <xsd:element name="flyToView" type="xsd:boolean"/> + <xsd:element name="Schema"> + <xsd:complexType> + <xsd:all> + <xsd:element ref="name" minOccurs="0"/> + <xsd:element ref="ObjArrayField" minOccurs="0"/> + <xsd:element ref="ObjField" minOccurs="0"/> + <xsd:element ref="SimpleArrayField" minOccurs="0"/> + <xsd:element ref="SimpleField" minOccurs="0"/> + <xsd:element ref="parent" minOccurs="0"/> + </xsd:all> + <xsd:attribute name="id" type="xsd:ID" use="optional"/> + </xsd:complexType> + </xsd:element> + <xsd:element name="ObjArrayField"> + <xsd:complexType> + <xsd:all> + <xsd:element ref="name"/> + <xsd:element ref="type"/> + </xsd:all> + <xsd:attribute name="id" type="xsd:ID" use="optional"/> + </xsd:complexType> + </xsd:element> + <xsd:element name="ObjField"> + <xsd:complexType> + <xsd:all> + <xsd:element ref="name"/> + <xsd:element ref="type"/> + </xsd:all> + <xsd:attribute name="id" type="xsd:ID" use="optional"/> + </xsd:complexType> + </xsd:element> + <xsd:element name="SimpleArrayField"> + <xsd:complexType> + <xsd:all> + <xsd:element ref="name" minOccurs="0"/> + <xsd:element ref="type" minOccurs="0"/> + </xsd:all> + <xsd:attribute name="id" type="xsd:ID" use="optional"/> + </xsd:complexType> + </xsd:element> + <xsd:element name="SimpleField"> + <xsd:complexType> + <xsd:all> + <xsd:element ref="name" minOccurs="0"/> + <xsd:element ref="type" minOccurs="0"/> + </xsd:all> + <xsd:attribute name="id" type="xsd:ID" use="optional"/> + </xsd:complexType> + </xsd:element> + <xsd:element name="parent" type="xsd:string"/> + <xsd:element name="type" type="xsd:string"/> + <xsd:element name="Style"> + <xsd:complexType> + <xsd:all> + <xsd:element ref="Icon" minOccurs="0"/> + <xsd:element ref="IconStyle" minOccurs="0"/> + <xsd:element ref="LineStyle" minOccurs="0"/> + <xsd:element ref="PolyStyle" minOccurs="0"/> + <xsd:element ref="LabelStyle" minOccurs="0"/> + <xsd:element ref="BalloonStyle" minOccurs="0"/> + <xsd:element ref="color" minOccurs="0"/> + <xsd:element ref="scale" minOccurs="0"/> + </xsd:all> + <xsd:attribute name="id" type="xsd:ID" use="optional"/> + </xsd:complexType> + </xsd:element> + <xsd:element name="BalloonStyle"> + <xsd:complexType> + <xsd:all> + <xsd:element ref="color" minOccurs="0"/> + <xsd:element ref="text" minOccurs="0"/> + </xsd:all> + <xsd:attribute name="id" type="xsd:ID" use="optional"/> + </xsd:complexType> + </xsd:element> + <xsd:element name="text" type="xsd:string"> + <xsd:annotation> + <xsd:documentation>Child element of BalloonStyle, can contain HTML + Content should be wrapped by CDATA + name or description content is substituted by this text content + by using $[name] or $[description] one can use name/description content in the balloon</xsd:documentation> + </xsd:annotation> + </xsd:element> + <xsd:element name="IconStyle"> + <xsd:complexType> + <xsd:all> + <xsd:element ref="color" minOccurs="0"/> + <xsd:element ref="colorMode" minOccurs="0"/> + <xsd:element ref="heading" minOccurs="0"/> + <xsd:element ref="Icon" minOccurs="0"/> + <xsd:element ref="scale" minOccurs="0"/> + </xsd:all> + <xsd:attribute name="id" type="xsd:ID" use="optional"/> + </xsd:complexType> + </xsd:element> + <xsd:element name="LabelStyle"> + <xsd:complexType> + <xsd:all> + <xsd:element ref="color" minOccurs="0"/> + <xsd:element ref="colorMode" minOccurs="0"/> + <xsd:element ref="scale" minOccurs="0"/> + </xsd:all> + <xsd:attribute name="id" type="xsd:ID" use="optional"/> + </xsd:complexType> + </xsd:element> + <xsd:element name="LineStyle"> + <xsd:complexType> + <xsd:all> + <xsd:element ref="color" minOccurs="0"/> + <xsd:element ref="colorMode" minOccurs="0"/> + <xsd:element ref="width" minOccurs="0"/> + </xsd:all> + <xsd:attribute name="id" type="xsd:ID" use="optional"/> + </xsd:complexType> + </xsd:element> + <xsd:element name="PolyStyle"> + <xsd:complexType> + <xsd:all> + <xsd:element ref="color" minOccurs="0"/> + <xsd:element ref="colorMode" minOccurs="0"/> + <xsd:element ref="fill" minOccurs="0"/> + <xsd:element ref="outline" minOccurs="0"/> + </xsd:all> + <xsd:attribute name="id" type="xsd:ID" use="optional"/> + </xsd:complexType> + </xsd:element> + <xsd:element name="width"> + <xsd:simpleType> + <xsd:restriction base="xsd:int"> + <xsd:minInclusive value="0"/> + </xsd:restriction> + </xsd:simpleType> + </xsd:element> + <xsd:element name="StyleBlinker"> + <xsd:complexType> + <xsd:sequence> + <xsd:element ref="numCycles"/> + <xsd:element ref="State" minOccurs="2" maxOccurs="2"/> + </xsd:sequence> + <xsd:attribute name="id" type="xsd:ID" use="optional"/> + </xsd:complexType> + </xsd:element> + <xsd:element name="State"> + <xsd:complexType> + <xsd:all> + <xsd:element ref="duration"/> + <xsd:element ref="key"/> + <xsd:element ref="styleUrl"/> + </xsd:all> + <xsd:attribute name="id" type="xsd:ID" use="optional"/> + </xsd:complexType> + </xsd:element> + <xsd:element name="duration" type="xsd:int"/> + <xsd:element name="numCycles" type="xsd:int"/> + <xsd:element name="StyleMap"> + <xsd:complexType> + <xsd:choice> + <xsd:element ref="Pair" minOccurs="2" maxOccurs="2"/> + </xsd:choice> + <xsd:attribute name="id" type="xsd:ID" use="optional"/> + </xsd:complexType> + </xsd:element> + <xsd:element name="Pair"> + <xsd:complexType> + <xsd:all> + <xsd:element ref="key"/> + <xsd:element ref="styleUrl"/> + </xsd:all> + <xsd:attribute name="id" type="xsd:ID" use="optional"/> + </xsd:complexType> + </xsd:element> + <xsd:element name="key"> + <xsd:simpleType> + <xsd:restriction base="xsd:token"> + <xsd:enumeration value="normal"/> + <xsd:enumeration value="highlight"/> + <xsd:enumeration value="select"/> + <xsd:enumeration value="on"/> + <xsd:enumeration value="off"/> + </xsd:restriction> + </xsd:simpleType> + </xsd:element> + <xsd:element name="styleUrl" type="xsd:anyURI"/> + <xsd:element name="viewFormat" type="xsd:string"> + <xsd:annotation> + <xsd:documentation>A user defined variable. Available parameters are as follows: + BBOX= [bboxWest],[bboxSouth],[bboxEast],[bboxNorth],[lookatLon], + [lookatLat],[lookatRange],[lookatTilt],[lookatHeading] + To check if it can occur as a child of Icon aswell.</xsd:documentation> + </xsd:annotation> + </xsd:element> + <xsd:element name="altitudeMode"> + <xsd:simpleType> + <xsd:restriction base="xsd:token"> + <xsd:enumeration value="clampedToGround"/> + <xsd:enumeration value="relativeToGround"/> + <xsd:enumeration value="absolute"/> + </xsd:restriction> + </xsd:simpleType> + </xsd:element> + <xsd:element name="color"> + <xsd:simpleType> + <xsd:restriction base="xsd:hexBinary"/> + </xsd:simpleType> + </xsd:element> + <xsd:element name="colorMode"> + <xsd:simpleType> + <xsd:restriction base="xsd:token"> + <xsd:enumeration value="normal"/> + <xsd:enumeration value="random"/> + </xsd:restriction> + </xsd:simpleType> + </xsd:element> + <xsd:element name="scale" type="xsd:decimal"/> + <xsd:element name="TimePeriod"> + <xsd:complexType> + <xsd:all> + <xsd:element ref="begin" minOccurs="0"/> + <xsd:element ref="end" minOccurs="0"/> + </xsd:all> + <xsd:attribute name="id" type="xsd:ID" use="optional"/> + </xsd:complexType> + </xsd:element> + <xsd:element name="begin"> + <xsd:complexType> + <xsd:all> + <xsd:element ref="TimeInstant" minOccurs="0"/> + </xsd:all> + </xsd:complexType> + </xsd:element> + <xsd:element name="end"> + <xsd:complexType> + <xsd:all> + <xsd:element ref="TimeInstant" minOccurs="0"/> + </xsd:all> + </xsd:complexType> + </xsd:element> + <xsd:element name="TimeInstant"> + <xsd:complexType> + <xsd:all> + <xsd:element ref="timePosition"/> + </xsd:all> + <xsd:attribute name="id" type="xsd:ID" use="optional"/> + </xsd:complexType> + </xsd:element> + <xsd:element name="name" type="xsd:string"/> + <xsd:element name="description" type="xsd:string"/> + <xsd:element name="Snippet"> + <xsd:complexType> + <xsd:simpleContent> + <xsd:extension base="xsd:string"> + <xsd:attribute name="maxLines" type="xsd:unsignedByte" use="optional"/> + </xsd:extension> + </xsd:simpleContent> + </xsd:complexType> + </xsd:element> + <xsd:element name="open" type="xsd:boolean"/> + <xsd:element name="visibility" type="xsd:boolean"/> + <xsd:element name="extrude" type="xsd:boolean"/> + <xsd:element name="fill" type="xsd:boolean"/> + <xsd:element name="outline" type="xsd:boolean"/> + <xsd:element name="tessellate" type="xsd:boolean"/> + <xsd:element name="href" type="xsd:anyURI"/> + <xsd:element name="address" type="xsd:string"/> + <xsd:element name="refreshMode"> + <xsd:simpleType> + <xsd:restriction base="xsd:token"> + <xsd:enumeration value="onChange"/> + <xsd:enumeration value="onInterval"/> + </xsd:restriction> + </xsd:simpleType> + </xsd:element> + <xsd:element name="refreshInterval" type="xsd:int"/> + <xsd:element name="refreshVisibility" type="xsd:boolean"/> + <xsd:element name="viewRefreshMode"> + <xsd:simpleType> + <xsd:restriction base="xsd:token"> + <xsd:enumeration value="never"/> + <xsd:enumeration value="onRequest"/> + <xsd:enumeration value="onStop"/> + </xsd:restriction> + </xsd:simpleType> + </xsd:element> + <xsd:element name="viewRefreshTime"> + <xsd:simpleType> + <xsd:restriction base="xsd:int"> + <xsd:minInclusive value="0"/> + </xsd:restriction> + </xsd:simpleType> + </xsd:element> + <xsd:element name="size"> + <xsd:complexType> + <xsd:attribute name="x" use="required"> + <xsd:simpleType> + <xsd:restriction base="xsd:decimal"> + <xsd:minInclusive value="-1"/> + </xsd:restriction> + </xsd:simpleType> + </xsd:attribute> + <xsd:attribute name="y" use="required"> + <xsd:simpleType> + <xsd:restriction base="xsd:decimal"> + <xsd:minInclusive value="-1"/> + </xsd:restriction> + </xsd:simpleType> + </xsd:attribute> + <xsd:attribute name="xunits" use="required"> + <xsd:simpleType> + <xsd:restriction base="xsd:token"> + <xsd:enumeration value="pixels"/> + <xsd:enumeration value="insetPixels"/> + <xsd:enumeration value="fraction"/> + </xsd:restriction> + </xsd:simpleType> + </xsd:attribute> + <xsd:attribute name="yunits" use="required"> + <xsd:simpleType> + <xsd:restriction base="xsd:token"> + <xsd:enumeration value="pixels"/> + <xsd:enumeration value="insetPixels"/> + <xsd:enumeration value="fraction"/> + </xsd:restriction> + </xsd:simpleType> + </xsd:attribute> + <xsd:attribute name="id" type="xsd:ID" use="optional"/> + </xsd:complexType> + </xsd:element> +</xsd:schema> Modified: pytrainer/trunk/schemas/ogckml22.xsd =================================================================== --- pytrainer/trunk/schemas/ogckml22.xsd 2010-03-08 08:58:42 UTC (rev 522) +++ pytrainer/trunk/schemas/ogckml22.xsd 2010-03-08 10:29:29 UTC (rev 523) @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> -<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" +<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:kml="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:xal="urn:oasis:names:tc:ciq:xsdschema:xAL:2.0" @@ -16,11 +17,11 @@ <!-- import atom:author and atom:link --> <xsd:import namespace="http://www.w3.org/2005/Atom" - schemaLocation="atom-author-link.xsd"/> + schemaLocation="atom-author-link.xsd"/> <!-- import xAL:Address --> <xsd:import namespace="urn:oasis:names:tc:ciq:xsdschema:xAL:2.0" - schemaLocation="http://docs.oasis-open.org/election/external/xAL.xsd"/> + schemaLocation="xAL.xsd"/> <!-- KML field types (simple content) --> Added: pytrainer/trunk/schemas/xAL.xsd =================================================================== --- pytrainer/trunk/schemas/xAL.xsd (rev 0) +++ pytrainer/trunk/schemas/xAL.xsd 2010-03-08 10:29:29 UTC (rev 523) @@ -0,0 +1,1680 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--Modified by Ram Kumar (MSI) on 24 July 2002--> +<xs:schema targetNamespace="urn:oasis:names:tc:ciq:xsdschema:xAL:2.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="urn:oasis:names:tc:ciq:xsdschema:xAL:2.0" elementFormDefault="qualified"> + <xs:annotation> + <xs:documentation>xAL: eXtensible Address Language +This is an XML document type definition (DTD) for +defining addresses. +Original Date of Creation: 1 March 2001 +Copyright(c) 2000, OASIS. All Rights Reserved [http://www.oasis-open.org] +Contact: Customer Information Quality Technical Committee, OASIS +http://www.oasis-open.org/committees/ciq +VERSION: 2.0 [MAJOR RELEASE] Date of Creation: 01 May 2002 +Last Update: 24 July 2002 +Previous Version: 1.3</xs:documentation> + </xs:annotation> + <xs:annotation> + <xs:documentation>Common Attributes:Type - If not documented then it means, possible values of Type not limited to: Official, Unique, Abbreviation, OldName, Synonym +Code:Address element codes are used by groups like postal groups like ECCMA, ADIS, UN/PROLIST for postal services</xs:documentation> + </xs:annotation> + <xs:attributeGroup name="grPostal"> + <xs:attribute name="Code"> + <xs:annotation> + <xs:documentation>Used by postal services to encode the name of the element.</xs:documentation> + </xs:annotation> + </xs:attribute> + </xs:attributeGroup> + <xs:element name="xAL"> + <xs:annotation> + <xs:documentation>Root element for a list of addresses</xs:documentation> + </xs:annotation> + <xs:complexType> + <xs:sequence> + <xs:element ref="AddressDetails" maxOccurs="unbounded"/> + <xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + <xs:attribute name="Version"> + <xs:annotation> + <xs:documentation>Specific to DTD to specify the version number of DTD</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:anyAttribute namespace="##other"/> + </xs:complexType> + </xs:element> + <xs:element name="AddressDetails" type="AddressDetails"> + <xs:annotation> + <xs:documentation>This container defines the details of the address. Can define multiple addresses including tracking address history</xs:documentation> + </xs:annotation> + </xs:element> + <xs:complexType name="AddressDetails"> + <xs:sequence> + <xs:element name="PostalServiceElements" minOccurs="0"> + <xs:annotation> + <xs:documentation>Postal authorities use specific postal service data to expedient delivery of mail</xs:documentation> + </xs:annotation> + <xs:complexType> + <xs:sequence> + <xs:element name="AddressIdentifier" minOccurs="0" maxOccurs="unbounded"> + <xs:annotation> + <xs:documentation>A unique identifier of an address assigned by postal authorities. Example: DPID in Australia</xs:documentation> + </xs:annotation> + <xs:complexType mixed="true"> + <xs:attribute name="IdentifierType"> + <xs:annotation> + <xs:documentation>Type of identifier. eg. DPID as in Australia</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="Type"/> + <xs:attributeGroup ref="grPostal"/> + <xs:anyAttribute namespace="##other"/> + </xs:complexType> + </xs:element> + <xs:element name="EndorsementLineCode" minOccurs="0"> + <xs:annotation> + <xs:documentation>Directly affects postal service distribution</xs:documentation> + </xs:annotation> + <xs:complexType mixed="true"> + <xs:attribute name="Type"> + <xs:annotation> + <xs:documentation>Specific to postal service</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attributeGroup ref="grPostal"/> + <xs:anyAttribute namespace="##other"/> + </xs:complexType> + </xs:element> + <xs:element name="KeyLineCode" minOccurs="0"> + <xs:annotation> + <xs:documentation>Required for some postal services</xs:documentation> + </xs:annotation> + <xs:complexType mixed="true"> + <xs:attribute name="Type"> + <xs:annotation> + <xs:documentation>Specific to postal service</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attributeGroup ref="grPostal"/> + <xs:anyAttribute namespace="##other"/> + </xs:complexType> + </xs:element> + <xs:element name="Barcode" minOccurs="0"> + <xs:annotation> + <xs:documentation>Required for some postal services</xs:documentation> + </xs:annotation> + <xs:complexType mixed="true"> + <xs:attribute name="Type"> + <xs:annotation> + <xs:documentation>Specific to postal service</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attributeGroup ref="grPostal"/> + <xs:anyAttribute namespace="##other"/> + </xs:complexType> + </xs:element> + <xs:element name="SortingCode" minOccurs="0"> + <xs:annotation> + <xs:documentation>Used for sorting addresses. Values may for example be CEDEX 16 (France)</xs:documentation> + </xs:annotation> + <xs:complexType> + <xs:attribute name="Type"> + <xs:annotation> + <xs:documentation>Specific to postal service</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attributeGroup ref="grPostal"/> + </xs:complexType> + </xs:element> + <xs:element name="AddressLatitude" minOccurs="0"> + <xs:annotation> + <xs:documentation>Latitude of delivery address</xs:documentation> + </xs:annotation> + <xs:complexType mixed="true"> + <xs:attribute name="Type"> + <xs:annotation> + <xs:documentation>Specific to postal service</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attributeGroup ref="grPostal"/> + <xs:anyAttribute namespace="##other"/> + </xs:complexType> + </xs:element> + <xs:element name="AddressLatitudeDirection" minOccurs="0"> + <xs:annotation> + <xs:documentation>Latitude direction of delivery address;N = North and S = South</xs:documentation> + </xs:annotation> + <xs:complexType mixed="true"> + <xs:annotation> + <xs:documentation>Specific to postal service</xs:documentation> + </xs:annotation> + <xs:attribute name="Type"/> + <xs:attributeGroup ref="grPostal"/> + <xs:anyAttribute namespace="##other"/> + </xs:complexType> + </xs:element> + <xs:element name="AddressLongitude" minOccurs="0"> + <xs:annotation> + <xs:documentation>Longtitude of delivery address</xs:documentation> + </xs:annotation> + <xs:complexType mixed="true"> + <xs:attribute name="Type"> + <xs:annotation> + <xs:documentation>Specific to postal service</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attributeGroup ref="grPostal"/> + <xs:anyAttribute namespace="##other"/> + </xs:complexType> + </xs:element> + <xs:element name="AddressLongitudeDirection" minOccurs="0"> + <xs:annotation> + <xs:documentation>Longtitude direction of delivery address;N=North and S=South</xs:documentation> + </xs:annotation> + <xs:complexType mixed="true"> + <xs:attribute name="Type"> + <xs:annotation> + <xs:documentation>Specific to postal service</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attributeGroup ref="grPostal"/> + <xs:anyAttribute namespace="##other"/> + </xs:complexType> + </xs:element> + <xs:element name="SupplementaryPostalServiceData" minOccurs="0" maxOccurs="unbounded"> + <xs:annotation> + <xs:documentation>any postal service elements not covered by the container can be represented using this element</xs:documentation> + </xs:annotation> + <xs:complexType mixed="true"> + <xs:attribute name="Type"> + <xs:annotation> + <xs:documentation>Specific to postal service</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attributeGroup ref="grPostal"/> + <xs:anyAttribute namespace="##other"/> + </xs:complexType> + </xs:element> + <xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + <xs:attribute name="Type"> + <xs:annotation> + <xs:documentation>USPS, ECMA, UN/PROLIST, etc</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:anyAttribute namespace="##other"/> + </xs:complexType> + </xs:element> + <xs:choice minOccurs="0"> + <xs:annotation> + <xs:documentation>Use the most suitable option. Country contains the most detailed information while Locality is missing Country and AdminArea</xs:documentation> + </xs:annotation> + <xs:element name="Address"> + <xs:annotation> + <xs:documentation>Address as one line of free text</xs:documentation> + </xs:annotation> + <xs:complexType mixed="true"> + <xs:attribute name="Type"> + <xs:annotation> + <xs:documentation>Postal, residential, corporate, etc</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attributeGroup ref="grPostal"/> + <xs:anyAttribute namespace="##other"/> + </xs:complexType> + </xs:element> + <xs:element name="AddressLines" type="AddressLinesType"> + <xs:annotation> + <xs:documentation>Container for Address lines</xs:documentation> + </xs:annotation> + </xs:element> + <xs:element name="Country"> + <xs:annotation> + <xs:documentation>Specification of a country</xs:documentation> + </xs:annotation> + <xs:complexType> + <xs:sequence> + <xs:element ref="AddressLine" minOccurs="0" maxOccurs="unbounded"/> + <xs:element name="CountryNameCode" minOccurs="0" maxOccurs="unbounded"> + <xs:annotation> + <xs:documentation>A country code according to the specified scheme</xs:documentation> + </xs:annotation> + <xs:complexType mixed="true"> + <xs:attribute name="Scheme"> + <xs:annotation> + <xs:documentation>Country code scheme possible values, but not limited to: iso.3166-2, iso.3166-3 for two and three character country codes.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attributeGroup ref="grPostal"/> + <xs:anyAttribute namespace="##other"/> + </xs:complexType> + </xs:element> + <xs:element ref="CountryName" minOccurs="0" maxOccurs="unbounded"/> + <xs:choice minOccurs="0"> + <xs:element ref="AdministrativeArea"/> + <xs:element ref="Locality"/> + <xs:element ref="Thoroughfare"/> + </xs:choice> + <xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + <xs:anyAttribute namespace="##other"/> + </xs:complexType> + </xs:element> + <xs:element ref="AdministrativeArea"/> + <xs:element ref="Locality"/> + <xs:element ref="Thoroughfare"/> + </xs:choice> + <xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + <xs:attribute name="AddressType"> + <xs:annotation> + <xs:documentation>Type of address. Example: Postal, residential,business, primary, secondary, etc</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="CurrentStatus"> + <xs:annotation> + <xs:documentation>Moved, Living, Investment, Deceased, etc..</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="ValidFromDate"> + <xs:annotation> + <xs:documentation>Start Date of the validity of address</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="ValidToDate"> + <xs:annotation> + <xs:documentation>End date of the validity of address</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="Usage"> + <xs:annotation> + <xs:documentation>Communication, Contact, etc.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attributeGroup ref="grPostal"/> + <xs:attribute name="AddressDetailsKey"> + <xs:annotation> + <xs:documentation>Key identifier for the element for not reinforced references from other elements. Not required to be unique for the document to be valid, but application may get confused if not unique. Extend this schema adding unique contraint if needed.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:anyAttribute namespace="##other"/> + </xs:complexType> + <xs:complexType name="AddressLinesType"> + <xs:sequence> + <xs:element ref="AddressLine" maxOccurs="unbounded"/> + <xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + <xs:anyAttribute namespace="##other"/> + </xs:complexType> + <xs:complexType name="BuildingNameType" mixed="true"> + <xs:attribute name="Type"/> + <xs:attribute name="TypeOccurrence"> + <xs:annotation> + <xs:documentation>Occurrence of the building name before/after the type. eg. EGIS BUILDING where name appears before type</xs:documentation> + </xs:annotation> + <xs:simpleType> + <xs:restriction base="xs:NMTOKEN"> + <xs:enumeration value="Before"/> + <xs:enumeration value="After"/> + </xs:restriction> + </xs:simpleType> + </xs:attribute> + <xs:attributeGroup ref="grPostal"/> + <xs:anyAttribute namespace="##other"/> + </xs:complexType> + <xs:complexType name="DependentLocalityType"> + <xs:sequence> + <xs:element ref="AddressLine" minOccurs="0" maxOccurs="unbounded"/> + <xs:element name="DependentLocalityName" minOccurs="0" maxOccurs="unbounded"> + <xs:annotation> + <xs:documentation>Name of the dependent locality</xs:documentation> + </xs:annotation> + <xs:complexType mixed="true"> + <xs:attribute name="Type"/> + <xs:attributeGroup ref="grPostal"/> + <xs:anyAttribute namespace="##other"/> + </xs:complexType> + </xs:element> + <xs:element name="DependentLocalityNumber" minOccurs="0"> + <xs:annotation> + <xs:documentation>Number of the dependent locality. Some areas are numbered. Eg. SECTOR 5 in a Suburb as in India or SOI SUKUMVIT 10 as in Thailand</xs:documentation> + </xs:annotation> + <xs:complexType mixed="true"> + <xs:attribute name="NameNumberOccurrence"> + <xs:annotation> + <xs:documentation>Eg. SECTOR occurs before 5 in SECTOR 5</xs:documentation> + </xs:annotation> + <xs:simpleType> + <xs:restriction base="xs:NMTOKEN"> + <xs:enumeration value="Before"/> + <xs:enumeration value="After"/> + </xs:restriction> + </xs:simpleType> + </xs:attribute> + <xs:attributeGroup ref="grPostal"/> + <xs:anyAttribute namespace="##other"/> + </xs:complexType> + </xs:element> + <xs:choice minOccurs="0"> + <xs:element ref="PostBox"/> + <xs:element name="LargeMailUser" type="LargeMailUserType"> + <xs:annotation> + <xs:documentation>Specification of a large mail user address. Examples of large mail users are postal companies, companies in France with a cedex number, hospitals and airports with their own post code. Large mail user addresses do not have a street name with premise name or premise number in countries like Netherlands. But they have a POBox and street also in countries like France</xs:documentation> + </xs:annotation> + </xs:element> + <xs:element ref="PostOffice"/> + <xs:element name="PostalRoute" type="PostalRouteType"> + <xs:annotation> + <xs:documentation> A Postal van is specific for a route as in Is`rael, Rural route</xs:documentation> + </xs:annotation> + </xs:element> + </xs:choice> + <xs:element ref="Thoroughfare" minOccurs="0"/> + <xs:element ref="Premise" minOccurs="0"/> + <xs:element name="DependentLocality" type="DependentLocalityType" minOccurs="0"> + <xs:annotation> + <xs:documentation>Dependent localities are Districts within cities/towns, locality divisions, postal +divisions of cities, suburbs, etc. DependentLocality is a recursive element, but no nesting deeper than two exists (Locality-DependentLocality-DependentLocality).</xs:documentation> + </xs:annotation> + </xs:element> + <xs:element ref="PostalCode" minOccurs="0"/> + <xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + <xs:attribute name="Type"> + <xs:annotation> + <xs:documentation>City or IndustrialEstate, etc</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="UsageType"> + <xs:annotation> + <xs:documentation>Postal or Political - Sometimes locations must be distinguished between postal system, and physical locations as defined by a political system</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="Connector"> + <xs:annotation> + <xs:documentation>"VIA" as in Hill Top VIA Parish where Parish is a locality and Hill Top is a dependent locality</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="Indicator"> + <xs:annotation> + <xs:documentation>Eg. Erode (Dist) where (Dist) is the Indicator</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:anyAttribute namespace="##other"/> + </xs:complexType> + <xs:complexType name="FirmType"> + <xs:sequence> + <xs:element ref="AddressLine" minOccurs="0" maxOccurs="unbounded"/> + <xs:element name="FirmName" minOccurs="0" maxOccurs="unbounded"> + <xs:annotation> + <xs:documentation>Name of the firm</xs:documentation> + </xs:annotation> + <xs:complexType mixed="true"> + <xs:attribute name="Type"/> + <xs:attributeGroup ref="grPostal"/> + <xs:anyAttribute namespace="##other"/> + </xs:complexType> + </xs:element> + <xs:element ref="Department" minOccurs="0" maxOccurs="unbounded"/> + <xs:element name="MailStop" type="MailStopType" minOccurs="0"> + <xs:annotation> + <xs:documentation>A MailStop is where the the mail is delivered to within a premise/subpremise/firm or a facility.</xs:documentation> + </xs:annotation> + </xs:element> + <xs:element ref="PostalCode" minOccurs="0"/> + <xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + <xs:attribute name="Type"/> + <xs:anyAttribute namespace="##other"/> + </xs:complexType> + <xs:complexType name="LargeMailUserType"> + <xs:sequence> + <xs:element ref="AddressLine" minOccurs="0" maxOccurs="unbounded"/> + <xs:element name="LargeMailUserName" minOccurs="0" maxOccurs="unbounded"> + <xs:annotation> + <xs:documentation>Name of the large mail user. eg. Smith Ford International airport</xs:documentation> + </xs:annotation> + <xs:complexType mixed="true"> + <xs:attribute name="Type" type="xs:string"> + <xs:annotation> + <xs:documentation>Airport, Hospital, etc</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="Code" type="xs:string"/> + <xs:anyAttribute namespace="##other"/> + </xs:complexType> + </xs:element> + <xs:element name="LargeMailUserIdentifier" minOccurs="0"> + <xs:annotation> + <xs:documentation>Specification of the identification number of a large mail user. An example are the Cedex codes in France.</xs:documentation> + </xs:annotation> + <xs:complexType mixed="true"> + <xs:attribute name="Type" type="xs:string"> + <xs:annotation> + <xs:documentation>CEDEX Code</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="Indicator"> + <xs:annotation> + <xs:documentation>eg. Building 429 in which Building is the Indicator</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attributeGroup ref="grPostal"/> + <xs:anyAttribute namespace="##other"/> + </xs:complexType> + </xs:element> + <xs:element name="BuildingName" type="BuildingNameType" minOccurs="0" maxOccurs="unbounded"> + <xs:annotation> + <xs:documentation>Name of the building</xs:documentation> + </xs:annotation> + </xs:element> + <xs:element ref="Department" minOccurs="0"/> + <xs:element ref="PostBox" minOccurs="0"/> + <xs:element ref="Thoroughfare" minOccurs="0"/> + <xs:element ref="PostalCode" minOccurs="0"/> + <xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + <xs:attribute name="Type" type="xs:string"/> + <xs:anyAttribute namespace="##other"/> + </xs:complexType> + <xs:complexType name="MailStopType"> + <xs:sequence> + <xs:element ref="AddressLine" minOccurs="0" maxOccurs="unbounded"/> + <xs:element name="MailStopName" minOccurs="0"> + <xs:annotation> + <xs:documentation>Name of the the Mail Stop. eg. MSP, MS, etc</xs:documentation> + </xs:annotation> + <xs:complexType mixed="true"> + <xs:attribute name="Type"/> + <xs:attributeGroup ref="grPostal"/> + <xs:anyAttribute namespace="##other"/> + </xs:complexType> + </xs:element> + <xs:element name="MailStopNumber" minOccurs="0"> + <xs:annotation> + <xs:documentation>Number of the Mail stop. eg. 123 in MS 123</xs:documentation> + </xs:annotation> + <xs:complexType mixed="true"> + <xs:attribute name="NameNumberSeparator"> + <xs:annotation> + <xs:documentation>"-" in MS-123</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attributeGroup ref="grPostal"/> + <xs:anyAttribute namespace="##other"/> + </xs:complexType> + </xs:element> + <xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + <xs:attribute name="Type"/> + <xs:anyAttribute namespace="##other"/> + </xs:complexType> + <xs:complexType name="PostalRouteType"> + <xs:sequence> + <xs:element ref="AddressLine" minOccurs="0" maxOccurs="unbounded"/> + <xs:choice> + <xs:element name="PostalRouteName" maxOccurs="unbounded"> + <xs:annotation> + <xs:documentation> Name of the Postal Route</xs:documentation> + </xs:annotation> + <xs:complexType mixed="true"> + <xs:attribute name="Type"/> + <xs:attributeGroup ref="grPostal"/> + <xs:anyAttribute namespace="##other"/> + <... [truncated message content] |
From: <jb...@us...> - 2010-03-08 08:58:48
|
Revision: 522 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=522&view=rev Author: jblance Date: 2010-03-08 08:58:42 +0000 (Mon, 08 Mar 2010) Log Message: ----------- Unified import - expand editable options before import Modified Paths: -------------- pytrainer/trunk/glade/newrecord.glade pytrainer/trunk/pytrainer/gui/windowrecord.py pytrainer/trunk/pytrainer/main.py Modified: pytrainer/trunk/glade/newrecord.glade =================================================================== --- pytrainer/trunk/glade/newrecord.glade 2010-03-07 07:49:52 UTC (rev 521) +++ pytrainer/trunk/glade/newrecord.glade 2010-03-08 08:58:42 UTC (rev 522) @@ -268,6 +268,7 @@ <property name="climb_rate">1</property> <property name="numeric">True</property> <property name="wrap">True</property> + <signal name="value_changed" handler="on_rcd_duration_value_changed"/> </widget> <packing> <property name="expand">False</property> @@ -290,10 +291,11 @@ <property name="width_request">47</property> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="adjustment">0 0 59 2 2 0</property> + <property name="adjustment">0 0 59 1 2 0</property> <property name="climb_rate">1</property> <property name="numeric">True</property> <property name="wrap">True</property> + <signal name="value_changed" handler="on_rcd_duration_value_changed"/> </widget> <packing> <property name="expand">False</property> @@ -319,6 +321,7 @@ <property name="adjustment">0 0 59 1 2 0</property> <property name="climb_rate">1</property> <property name="wrap">True</property> + <signal name="value_changed" handler="on_rcd_duration_value_changed"/> </widget> <packing> <property name="expand">False</property> @@ -340,6 +343,7 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="width_chars">7</property> + <signal name="changed" handler="on_rcd_distance_changed"/> </widget> <packing> <property name="left_attach">1</property> @@ -389,6 +393,7 @@ <property name="can_focus">True</property> <property name="editable">False</property> <property name="width_chars">10</property> + <signal name="changed" handler="on_rcd_date_changed"/> </widget> <packing> <property name="expand">False</property> @@ -456,6 +461,7 @@ <property name="can_focus">True</property> <property name="width_chars">10</property> <property name="text" translatable="yes">12:00:00</property> + <signal name="changed" handler="on_rcd_starttime_changed"/> </widget> <packing> <property name="left_attach">3</property> Modified: pytrainer/trunk/pytrainer/gui/windowrecord.py =================================================================== --- pytrainer/trunk/pytrainer/gui/windowrecord.py 2010-03-07 07:49:52 UTC (rev 521) +++ pytrainer/trunk/pytrainer/gui/windowrecord.py 2010-03-08 08:58:42 UTC (rev 522) @@ -123,7 +123,7 @@ #Make GPX file 'unsensitive' self.rcd_gpxfile.set_sensitive(0) #Make General settings unsensitive - self.frameGeneral.set_sensitive(0) #TODO fix update to allow edits here + #self.frameGeneral.set_sensitive(0) #TODO fix update to allow edits here #Make Velocity settings unsensitive self.frameVelocity.set_sensitive(0) #TODO fix update to allow edits here #Make advanced tab settings unsensitive @@ -405,6 +405,35 @@ #Update sport in treeview self.store[self.active_row][4] = sport + def on_rcd_distance_changed(self, widget): + if self.mode == "multiple_activities" and self.active_row is not None: + distance = self.rcd_distance.get_text() + #Update distance in data store + self.activity_data[self.active_row]["rcd_distance"] = distance + #Update distance in treeview + self.store[self.active_row][2] = distance + + def on_rcd_duration_value_changed(self, widget): + if self.mode == "multiple_activities" and self.active_row is not None: + hour = self.rcd_hour.get_value() + min = self.rcd_min.get_value() + sec = self.rcd_second.get_value() + #print hour, min, sec + #Update duration in data store + self.activity_data[self.active_row]["rcd_time"] = (hour, min, sec) + #Update duration in treeview + self.store[self.active_row][3] = "%d:%d:%d" % (int(hour), int(min), int(sec)) + + def on_rcd_date_changed(self, widget): + if self.mode == "multiple_activities" and self.active_row is not None: + #Update date in data store + self.activity_data[self.active_row]["rcd_date"] = self.rcd_date.get_text() + + def on_rcd_starttime_changed(self, widget): + if self.mode == "multiple_activities" and self.active_row is not None: + #Update start time in data store + self.activity_data[self.active_row]["rcd_starttime"] = self.rcd_starttime.get_text() + def on_treeviewEntries_row_activated(self, treeview, event): ''' Callback to display details of different activity Modified: pytrainer/trunk/pytrainer/main.py =================================================================== --- pytrainer/trunk/pytrainer/main.py 2010-03-07 07:49:52 UTC (rev 521) +++ pytrainer/trunk/pytrainer/main.py 2010-03-08 08:58:42 UTC (rev 522) @@ -63,7 +63,7 @@ class pyTrainer: def __init__(self,filename = None, data_path = None): #Version constants - self.version ="1.7.1_svn#521" + self.version ="1.7.1_svn#522" self.DB_version = 3 #Setup usage and permitted options This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jb...@us...> - 2010-03-07 07:49:58
|
Revision: 521 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=521&view=rev Author: jblance Date: 2010-03-07 07:49:52 +0000 (Sun, 07 Mar 2010) Log Message: ----------- Unified import - file import allows editing of information before import Modified Paths: -------------- pytrainer/trunk/glade/importdata.glade pytrainer/trunk/glade/newrecord.glade pytrainer/trunk/import/file_garmintcxv1.py pytrainer/trunk/import/file_garmintcxv2.py pytrainer/trunk/import/file_garmintools.py pytrainer/trunk/import/file_gpxplus.py pytrainer/trunk/pytrainer/gui/windowimportdata.py pytrainer/trunk/pytrainer/gui/windowmain.py pytrainer/trunk/pytrainer/gui/windowrecord.py pytrainer/trunk/pytrainer/main.py pytrainer/trunk/pytrainer/record.py Modified: pytrainer/trunk/glade/importdata.glade =================================================================== --- pytrainer/trunk/glade/importdata.glade 2010-03-04 17:58:49 UTC (rev 520) +++ pytrainer/trunk/glade/importdata.glade 2010-03-07 07:49:52 UTC (rev 521) @@ -183,12 +183,19 @@ <property name="visible">True</property> <property name="orientation">vertical</property> <child> - <widget class="GtkTreeView" id="treeviewImportFiles"> + <widget class="GtkScrolledWindow" id="scrolledwindowImportFiles"> <property name="visible">True</property> <property name="can_focus">True</property> + <property name="hscrollbar_policy">automatic</property> + <property name="vscrollbar_policy">never</property> + <child> + <widget class="GtkTreeView" id="treeviewImportFiles"> + <property name="visible">True</property> + <property name="can_focus">True</property> + </widget> + </child> </widget> <packing> - <property name="pack_type">end</property> <property name="position">1</property> </packing> </child> Modified: pytrainer/trunk/glade/newrecord.glade =================================================================== --- pytrainer/trunk/glade/newrecord.glade 2010-03-04 17:58:49 UTC (rev 520) +++ pytrainer/trunk/glade/newrecord.glade 2010-03-07 07:49:52 UTC (rev 521) @@ -15,11 +15,12 @@ <widget class="GtkScrolledWindow" id="scrolledwindowEntries"> <property name="can_focus">True</property> <property name="hscrollbar_policy">automatic</property> - <property name="vscrollbar_policy">automatic</property> + <property name="vscrollbar_policy">never</property> <child> <widget class="GtkTreeView" id="treeviewEntries"> <property name="visible">True</property> <property name="can_focus">True</property> + <signal name="button_press_event" handler="on_treeviewEntries_row_activated"/> </widget> </child> </widget> @@ -71,6 +72,7 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="invisible_char">●</property> + <signal name="changed" handler="on_rcd_title_changed"/> </widget> <packing> <property name="left_attach">1</property> @@ -160,6 +162,7 @@ <property name="width_request">134</property> <property name="visible">True</property> <property name="items" translatable="yes"></property> + <signal name="changed" handler="on_rcd_sport_changed"/> </widget> <packing> <property name="left_attach">1</property> @@ -448,7 +451,7 @@ </packing> </child> <child> - <widget class="GtkEntry" id="rcd_time"> + <widget class="GtkEntry" id="rcd_starttime"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="width_chars">10</property> Modified: pytrainer/trunk/import/file_garmintcxv1.py =================================================================== --- pytrainer/trunk/import/file_garmintcxv1.py 2010-03-04 17:58:49 UTC (rev 520) +++ pytrainer/trunk/import/file_garmintcxv1.py 2010-03-07 07:49:52 UTC (rev 521) @@ -133,7 +133,7 @@ def getDateTime(self, time_): return Date().getDateTime(time_) - def getGPXFile(self, ID): + def getGPXFile(self, ID, file_id): """ Generate GPX file based on activity ID @@ -148,7 +148,7 @@ sport, activities = self.activities[sportID] activitiesCount = len(self.activities) if activitiesCount > 0 and activityID < activitiesCount: - gpxFile = "%s/garmin-tcxv1-%d.gpx" % (self.tmpdir, activityID) + gpxFile = "%s/garmin-tcxv1-%s-%d.gpx" % (self.tmpdir, file_id, activityID) activity = activities[activityID] self.createGPXfile(gpxFile, activity) return sport, gpxFile Modified: pytrainer/trunk/import/file_garmintcxv2.py =================================================================== --- pytrainer/trunk/import/file_garmintcxv2.py 2010-03-04 17:58:49 UTC (rev 520) +++ pytrainer/trunk/import/file_garmintcxv2.py 2010-03-07 07:49:52 UTC (rev 521) @@ -138,7 +138,7 @@ def getDateTime(self, time_): return Date().getDateTime(time_) - def getGPXFile(self, ID): + def getGPXFile(self, ID, file_id): """ Generate GPX file based on activity ID @@ -149,7 +149,7 @@ activityID = int(ID) activitiesCount = len(self.activities) if activitiesCount > 0 and activityID < activitiesCount: - gpxFile = "%s/garmin-tcxv2-%d.gpx" % (self.tmpdir, activityID) + gpxFile = "%s/garmin-tcxv2-%s-%d.gpx" % (self.tmpdir, file_id, activityID) activity = self.activities[int(activityID)] sport = self.getSport(activity) self.createGPXfile(gpxFile, activity) Modified: pytrainer/trunk/import/file_garmintools.py =================================================================== --- pytrainer/trunk/import/file_garmintools.py 2010-03-04 17:58:49 UTC (rev 520) +++ pytrainer/trunk/import/file_garmintools.py 2010-03-07 07:49:52 UTC (rev 521) @@ -135,7 +135,7 @@ return time return None - def getGPXFile(self, ID): + def getGPXFile(self, ID, file_id): """ Generate GPX file based on activity ID @@ -144,7 +144,7 @@ sport = None gpxFile = None if ID == "0": #Only one activity in file - gpxFile = "%s/garmintools-%s.gpx" % (self.tmpdir, ID) + gpxFile = "%s/garmintools-%s-%s.gpx" % (self.tmpdir, file_id, ID) sport = self.getSport(self.xmldoc) self.createGPXfile(gpxFile, self.xmldoc) return sport, gpxFile Modified: pytrainer/trunk/import/file_gpxplus.py =================================================================== --- pytrainer/trunk/import/file_gpxplus.py 2010-03-04 17:58:49 UTC (rev 520) +++ pytrainer/trunk/import/file_gpxplus.py 2010-03-07 07:49:52 UTC (rev 521) @@ -111,7 +111,7 @@ return timeElement.text return None - def getGPXFile(self, ID): + def getGPXFile(self, ID, file_id): """ Generate GPX file based on activity ID @@ -120,7 +120,7 @@ sport = None gpxFile = None if ID == "0": #Only one activity in file - gpxFile = "%s/gpx-%s.gpx" % (self.tmpdir, ID) + gpxFile = "%s/gpx-%s-%s.gpx" % (self.tmpdir, file_id, ID) sport = self.getSport(self.xmldoc) self.createGPXfile(gpxFile, self.xmldoc) return sport, gpxFile Modified: pytrainer/trunk/pytrainer/gui/windowimportdata.py =================================================================== --- pytrainer/trunk/pytrainer/gui/windowimportdata.py 2010-03-04 17:58:49 UTC (rev 520) +++ pytrainer/trunk/pytrainer/gui/windowimportdata.py 2010-03-07 07:49:52 UTC (rev 521) @@ -418,7 +418,7 @@ distance = item[3] duration = item[4] sport = item[5] - gpx_file = self.processClasses[file_id].getGPXFile(activity_id)[1] + gpx_file = self.processClasses[file_id].getGPXFile(activity_id, file_id)[1] selectedActivities.append((activity_id, start_time, distance, duration, sport, gpx_file)) logging.debug( "Found %d selected activities to import" % len(selectedActivities) ) return selectedActivities @@ -584,10 +584,10 @@ self.importSelectedActivities(selectedActivities) self.updateStatusbar(self.statusbarImportFile, msgImported) #Display informational dialog box - md = gtk.MessageDialog(self.win_importdata, gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_INFO, gtk.BUTTONS_CLOSE, msgImported) - md.set_title(_("Import Success")) - md.run() - md.destroy() + #md = gtk.MessageDialog(self.win_importdata, gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_INFO, gtk.BUTTONS_CLOSE, msgImported) + #md.set_title(_("Import Success")) + #md.run() + #md.destroy() self.buttonFileImport.set_sensitive(0) #Disable import button def on_buttonSelectFiles_clicked(self, widget): Modified: pytrainer/trunk/pytrainer/gui/windowmain.py =================================================================== --- pytrainer/trunk/pytrainer/gui/windowmain.py 2010-03-04 17:58:49 UTC (rev 520) +++ pytrainer/trunk/pytrainer/gui/windowmain.py 2010-03-07 07:49:52 UTC (rev 521) @@ -926,6 +926,7 @@ def on_gpsplugins_activate(self,widget): self.parent.editGpsPlugins() #hasta aqui revisado + def on_allRecordTreeView_button_press(self, treeview, event): logging.debug(">>") #print "on_allRecordTreeView_" Modified: pytrainer/trunk/pytrainer/gui/windowrecord.py =================================================================== --- pytrainer/trunk/pytrainer/gui/windowrecord.py 2010-03-04 17:58:49 UTC (rev 520) +++ pytrainer/trunk/pytrainer/gui/windowrecord.py 2010-03-07 07:49:52 UTC (rev 521) @@ -36,6 +36,7 @@ self.mode = "newrecord" self.id_record = "" self.store = None + self.active_row = None SimpleGladeApp.__init__(self, data_path+glade_path, root, domain) self.conf_options = [ "rcd_date", @@ -81,8 +82,9 @@ self.rcd_calories.set_text(calories) def populateMultiWindow(self, activities): - + self.mode = "multiple_activities" #activities (activity_id, start_time, distance, duration, sport, gpx_file) + self.activity_data = [] #Make treeview self.store = self.build_tree_view() #Add data @@ -97,11 +99,44 @@ 4, activity[4], 5, activity[5] ) - #Make row clickable to show details - #Select first activity - + details = {} + details["complete"] = False + details["rcd_distance"] = activity[2] + duration = activity[3] + hours, mins, secs = duration.split(":") + #details["rcd_hour"] = float(hours) + #details["rcd_min"] = float(mins) + #details["rcd_second"] = float(secs) + #details["rcd_time"] = (((float(hours) * 60) + float(mins)) * 60) + float(secs) + details["rcd_time"] = (float(hours), float(mins), float(secs)) + details["rcd_sport"] = activity[4] + details["rcd_gpxfile"] = activity[5] + self.activity_data.append(details) self.scrolledwindowEntries.show_all() + #Hide some of the buttons + self.button25.hide() #GPX file "Open" button + self.button24.hide() #GPX file "Calculate Values" button + self.button10.hide() #Distance "Calculate" button + self.button11.hide() #Duration "Calculate" button + self.button12.hide() #Velocity "Calculate" button + self.button43.hide() #Pace "Calculate" button + #Make GPX file 'unsensitive' + self.rcd_gpxfile.set_sensitive(0) + #Make General settings unsensitive + self.frameGeneral.set_sensitive(0) #TODO fix update to allow edits here + #Make Velocity settings unsensitive + self.frameVelocity.set_sensitive(0) #TODO fix update to allow edits here + #Make advanced tab settings unsensitive + self.vbox26.set_sensitive(0) #TODO fix update to allow edits here + #Make comments unsensitive + self.frame23.set_sensitive(0) #TODO fix update to allow edits here + while gtk.events_pending(): # This allows the GUI to update + gtk.main_iteration() # before completion of this entire action + #Select first row and display details + self.treeviewEntries.set_cursor(0) + self.show_treeviewEntries_row(0) + def build_tree_view(self): store = gtk.ListStore( gobject.TYPE_STRING, gobject.TYPE_STRING, @@ -123,42 +158,58 @@ return store def on_accept_clicked(self,widget): - list_options = {} - trackSummary = {} - for i in self.conf_options: - var = getattr(self,i) - if i == "rcd_title": - list_options[i] = var.get_text().replace("\"","'") - elif i != "rcd_sport" and i != "rcd_comments": - list_options[i] = var.get_text() - elif i == "rcd_sport": - list_options[i] = var.get_active_text() - elif i == "rcd_comments": - buffer = var.get_buffer() - start,end = buffer.get_bounds() - list_options[i] = buffer.get_text(start,end, True) - list_options[i] = list_options[i].replace("\"","'") - list_options["rcd_time"] = [self.rcd_hour.get_value_as_int(),self.rcd_min.get_value_as_int(),self.rcd_second.get_value_as_int()] - if self.mode == "newrecord": - logging.debug('Track data: '+str(list_options)) - if list_options["rcd_gpxfile"] != "": - logging.info('Adding new activity based on GPX file') - trackSummary=(list_options["rcd_sport"],"","") - self.parent.insertNewRecord(list_options["rcd_gpxfile"], trackSummary) - else: - logging.info('Adding new activity based on provided data') - #Manual entry, calculate time info - record_time = self.rcd_time.get_text() - record_date = self.rcd_date.get_text() - localtz = Date().getLocalTZ() - date = dateutil.parser.parse(record_date+" "+record_time+" "+localtz) - local_date = str(date) - utc_date = date.astimezone(tzutc()).strftime("%Y-%m-%dT%H:%M:%SZ") - list_options["date_time_utc"] = utc_date - list_options["date_time_local"] = local_date - self.parent.insertRecord(list_options) - elif self.mode == "editrecord": - self.parent.updateRecord(list_options, self.id_record) + if self.mode == "multiple_activities": + print "Multi window true and accept clicked" + print "#TODO" + row = 0 + for activity in self.activity_data: + if activity["complete"] is False: + #Did not view or modify this record - need to get all the details + print "Activity incomplete.. " + activity["rcd_gpxfile"] + self.update_activity_data(row, activity["rcd_gpxfile"], activity["rcd_sport"]) + activity["rcd_title"] = activity["rcd_title"].replace("\"","'") + #Add activity to DB etc + laps = activity.pop("laps", ()) + self.parent.insertRecord(activity, laps) + row += 1 + + else: + list_options = {} + trackSummary = {} + for i in self.conf_options: + var = getattr(self,i) + if i == "rcd_title": + list_options[i] = var.get_text().replace("\"","'") + elif i != "rcd_sport" and i != "rcd_comments": + list_options[i] = var.get_text() + elif i == "rcd_sport": + list_options[i] = var.get_active_text() + elif i == "rcd_comments": + buffer = var.get_buffer() + start,end = buffer.get_bounds() + list_options[i] = buffer.get_text(start,end, True) + list_options[i] = list_options[i].replace("\"","'") + list_options["rcd_time"] = [self.rcd_hour.get_value_as_int(),self.rcd_min.get_value_as_int(),self.rcd_second.get_value_as_int()] + if self.mode == "newrecord": + logging.debug('Track data: '+str(list_options)) + if list_options["rcd_gpxfile"] != "": + logging.info('Adding new activity based on GPX file') + trackSummary=(list_options["rcd_sport"],"","") + self.parent.insertNewRecord(list_options["rcd_gpxfile"], trackSummary) + else: + logging.info('Adding new activity based on provided data') + #Manual entry, calculate time info + record_time = self.rcd_starttime.get_text() + record_date = self.rcd_date.get_text() + localtz = Date().getLocalTZ() + date = dateutil.parser.parse(record_date+" "+record_time+" "+localtz) + local_date = str(date) + utc_date = date.astimezone(tzutc()).strftime("%Y-%m-%dT%H:%M:%SZ") + list_options["date_time_utc"] = utc_date + list_options["date_time_local"] = local_date + self.parent.insertRecord(list_options) + elif self.mode == "editrecord": + self.parent.updateRecord(list_options, self.id_record) self.close_window() def on_cancel_clicked(self,widget): @@ -185,12 +236,13 @@ self.rcd_min.set_value(min) self.rcd_second.set_value(sec) - def setValue(self,var,value, format="%0.2f"): - var = getattr(self,var) + def setValue(self,var_name,value, format="%0.2f"): + var = getattr(self,var_name) try: - valueString = format %value + valueString = format % value var.set_text(valueString) - except: + except Exception as e: + print var_name, value, e pass def setValues(self,values): @@ -215,7 +267,7 @@ if local_time is not None: dateTime = dateutil.parser.parse(local_time) sTime = dateTime.strftime("%X") - self.rcd_time.set_text("%s" % sTime) + self.rcd_starttime.set_text("%s" % sTime) sportID = values[2] sportPosition = self.getSportPosition(sportID) self.rcd_sport.set_active(sportPosition) @@ -226,7 +278,7 @@ def getSportPosition(self, sportID): """ - Function to determin the position in the sport array for a given sport ID + Function to determine the position in the sport array for a given sport ID Needed as once sports are deleted there are gaps in the list... """ count = 0 @@ -235,7 +287,19 @@ return count count +=1 return 0 - + + def getSportPositionByName(self, sport): + """ + Function to determine the position in the sport array for a given sport + Needed as once sports are deleted there are gaps in the list... + """ + count = 0 + for key, value in self.listSport.iteritems(): + if value == sport: + return count + count +=1 + return None + def on_calctime_clicked(self,widget): try: distance = self.rcd_distance.get_text() @@ -245,6 +309,119 @@ except: pass + def update_activity_data(self, row, gpx_file, sport): + self.activity_data[row]["rcd_comments"] = "" + gpx_summary, laps = self.parent.summaryFromGPX(gpx_file, (sport,"")) + local_time = gpx_summary['date_time_local'] + start_date = local_time.strftime("%Y-%m-%d") + start_time = local_time.strftime("%H:%M:%S") + self.activity_data[row]["rcd_date"] = start_date + self.activity_data[row]["rcd_starttime"] = start_time + self.activity_data[row]["date_time_local"] = gpx_summary['date_time_local'] + self.activity_data[row]["date_time_utc"] = gpx_summary['date_time_utc'] + self.activity_data[row]["rcd_average"] = gpx_summary["rcd_average"] + self.activity_data[row]["rcd_calories"] = gpx_summary["rcd_calories"] + self.activity_data[row]["rcd_beats"] = gpx_summary["rcd_beats"] + self.activity_data[row]["rcd_upositive"] = gpx_summary["rcd_upositive"] + self.activity_data[row]["rcd_unegative"] = gpx_summary["rcd_unegative"] + self.activity_data[row]["rcd_maxvel"] = gpx_summary["rcd_maxvel"] + self.activity_data[row]["rcd_maxpace"] = gpx_summary["rcd_maxpace"] + self.activity_data[row]["rcd_pace"] = gpx_summary["rcd_pace"] + self.activity_data[row]["rcd_maxbeats"] = gpx_summary["rcd_maxbeats"] + self.activity_data[row]["rcd_title"] = "" + self.activity_data[row]["laps"] = laps + self.activity_data[row]["complete"] = True + + + def show_treeviewEntries_row(self, row): + ''' + Show details of treeview entry + TODO need to maintain any changes and display those.... + ''' + 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 = Date().time2second(self.activity_data[row]["rcd_time"]) #TODO Fix to use timeinseconds!! + self.setTime(time) #TODO Fix to use timeinseconds!! + #self.rcd_hour.set_value(self.activity_data[row]["rcd_hour"]) + #self.rcd_min.set_value(self.activity_data[row]["rcd_min"]) + #self.rcd_second.set_value(self.activity_data[row]["rcd_second"]) + #Set distance + self.setValue("rcd_distance",self.activity_data[row]["rcd_distance"], "%s") + #set start date + #start_date = start + #self.setValue("rcd_date", start, "%s") + 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_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"], "%0.0f") + self.setValue("rcd_beats",self.activity_data[row]["rcd_beats"], "%0.0f") + self.setValue("rcd_upositive",self.activity_data[row]["rcd_upositive"]) + self.setValue("rcd_unegative",self.activity_data[row]["rcd_unegative"]) + 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"], "%0.0f") + self.rcd_title.set_text(self.activity_data[row]["rcd_title"]) + + def on_rcd_title_changed(self, widget): + if self.mode == "multiple_activities" and self.active_row is not None: + self.activity_data[self.active_row]["rcd_title"] = self.rcd_title.get_text() + + def on_rcd_sport_changed(self, widget): + if self.mode == "multiple_activities" and self.active_row is not None: + sport = self.rcd_sport.get_active_text() + #Update sport in data store + self.activity_data[self.active_row]["rcd_sport"] = sport + #Update sport in treeview + self.store[self.active_row][4] = sport + + def on_treeviewEntries_row_activated(self, treeview, event): + ''' + Callback to display details of different activity + ''' + #Get row that was selected + x = int(event.x) + y = int(event.y) + time = event.time + pthinfo = treeview.get_path_at_pos(x, y) + if pthinfo is not None: + path, col, cellx, celly = pthinfo + treeview.grab_focus() + treeview.set_cursor(path, col, 0) + while gtk.events_pending(): # This allows the GUI to update + gtk.main_iteration() # before completion of this entire action + self.show_treeviewEntries_row(path[0]) + def on_calcaverage_clicked(self,widget): try: hour = self.rcd_hour.get_value_as_int() Modified: pytrainer/trunk/pytrainer/main.py =================================================================== --- pytrainer/trunk/pytrainer/main.py 2010-03-04 17:58:49 UTC (rev 520) +++ pytrainer/trunk/pytrainer/main.py 2010-03-07 07:49:52 UTC (rev 521) @@ -63,7 +63,7 @@ class pyTrainer: def __init__(self,filename = None, data_path = None): #Version constants - self.version ="1.7.1_svn#519" + self.version ="1.7.1_svn#521" self.DB_version = 3 #Setup usage and permitted options Modified: pytrainer/trunk/pytrainer/record.py =================================================================== --- pytrainer/trunk/pytrainer/record.py 2010-03-04 17:58:49 UTC (rev 520) +++ pytrainer/trunk/pytrainer/record.py 2010-03-07 07:49:52 UTC (rev 521) @@ -56,7 +56,7 @@ def newMultiRecord(self, activities, list_sport): logging.debug('>>') #activities (activity_id, start_time, distance, duration, sport, gpx_file) - self.recordwindow = WindowRecord(self.data_path, list_sport, windowTitle="Modify details before importing") + self.recordwindow = WindowRecord(self.data_path, list_sport, parent=self, windowTitle="Modify details before importing") self.recordwindow.populateMultiWindow(activities) self.recordwindow.run() logging.debug('<<') This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dg...@us...> - 2010-03-04 17:58:56
|
Revision: 520 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=520&view=rev Author: dgranda Date: 2010-03-04 17:58:49 +0000 (Thu, 04 Mar 2010) Log Message: ----------- Making shebang compatible with all python versions installed, see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=568781 Modified Paths: -------------- pytrainer/trunk/bin/pytrainer pytrainer/trunk/extensions/dotclear/main.py pytrainer/trunk/plugins/garmin-hr/garminhr.py pytrainer/trunk/plugins/garmin-hr-file/garminhrfile.py pytrainer/trunk/plugins/garmintools_full/garmintools_full.py pytrainer/trunk/plugins/googleearth/main.py pytrainer/trunk/pytrainer/lib/gtrnctr2gpx.py pytrainer/trunk/schemas/validate_gpsfile.py Modified: pytrainer/trunk/bin/pytrainer =================================================================== --- pytrainer/trunk/bin/pytrainer 2010-03-04 09:07:17 UTC (rev 519) +++ pytrainer/trunk/bin/pytrainer 2010-03-04 17:58:49 UTC (rev 520) @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python # -*- coding: iso-8859-1 -*- #Copyright (C) Fiz Vazquez vu...@si... Modified: pytrainer/trunk/extensions/dotclear/main.py =================================================================== --- pytrainer/trunk/extensions/dotclear/main.py 2010-03-04 09:07:17 UTC (rev 519) +++ pytrainer/trunk/extensions/dotclear/main.py 2010-03-04 17:58:49 UTC (rev 520) @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python # -*- coding: iso-8859-1 -*- #Copyright (C) DJ dj...@na... http://blog.dedj.be Modified: pytrainer/trunk/plugins/garmin-hr/garminhr.py =================================================================== --- pytrainer/trunk/plugins/garmin-hr/garminhr.py 2010-03-04 09:07:17 UTC (rev 519) +++ pytrainer/trunk/plugins/garmin-hr/garminhr.py 2010-03-04 17:58:49 UTC (rev 520) @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python # -*- coding: iso-8859-1 -*- #Copyright (C) Fiz Vazquez vu...@si... Modified: pytrainer/trunk/plugins/garmin-hr-file/garminhrfile.py =================================================================== --- pytrainer/trunk/plugins/garmin-hr-file/garminhrfile.py 2010-03-04 09:07:17 UTC (rev 519) +++ pytrainer/trunk/plugins/garmin-hr-file/garminhrfile.py 2010-03-04 17:58:49 UTC (rev 520) @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python # -*- coding: iso-8859-1 -*- #Copyright (C) Modified: pytrainer/trunk/plugins/garmintools_full/garmintools_full.py =================================================================== --- pytrainer/trunk/plugins/garmintools_full/garmintools_full.py 2010-03-04 09:07:17 UTC (rev 519) +++ pytrainer/trunk/plugins/garmintools_full/garmintools_full.py 2010-03-04 17:58:49 UTC (rev 520) @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python # -*- coding: iso-8859-1 -*- #Copyright (C) Fiz Vazquez vu...@si... Modified: pytrainer/trunk/plugins/googleearth/main.py =================================================================== --- pytrainer/trunk/plugins/googleearth/main.py 2010-03-04 09:07:17 UTC (rev 519) +++ pytrainer/trunk/plugins/googleearth/main.py 2010-03-04 17:58:49 UTC (rev 520) @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python # -*- coding: iso-8859-1 -*- #Copyright (C) Fiz Vazquez vu...@si... Modified: pytrainer/trunk/pytrainer/lib/gtrnctr2gpx.py =================================================================== --- pytrainer/trunk/pytrainer/lib/gtrnctr2gpx.py 2010-03-04 09:07:17 UTC (rev 519) +++ pytrainer/trunk/pytrainer/lib/gtrnctr2gpx.py 2010-03-04 17:58:49 UTC (rev 520) @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python # -*- coding: iso-8859-1 -*- #Copyright (C) Fiz Vazquez vu...@si... Modified: pytrainer/trunk/schemas/validate_gpsfile.py =================================================================== --- pytrainer/trunk/schemas/validate_gpsfile.py 2010-03-04 09:07:17 UTC (rev 519) +++ pytrainer/trunk/schemas/validate_gpsfile.py 2010-03-04 17:58:49 UTC (rev 520) @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python import os, sys from optparse import OptionParser This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jb...@us...> - 2010-03-04 09:07:57
|
Revision: 519 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=519&view=rev Author: jblance Date: 2010-03-04 09:07:17 +0000 (Thu, 04 Mar 2010) Log Message: ----------- Unified import - auto start file import option Modified Paths: -------------- pytrainer/trunk/glade/importdata.glade pytrainer/trunk/pytrainer/gui/windowimportdata.py pytrainer/trunk/pytrainer/main.py Modified: pytrainer/trunk/glade/importdata.glade =================================================================== --- pytrainer/trunk/glade/importdata.glade 2010-03-03 22:25:30 UTC (rev 518) +++ pytrainer/trunk/glade/importdata.glade 2010-03-04 09:07:17 UTC (rev 519) @@ -475,6 +475,7 @@ <child> <widget class="GtkHBox" id="hboxDefaultTab"> <property name="visible">True</property> + <property name="orientation">vertical</property> <child> <widget class="GtkRadioButton" id="radiobuttonTabGPSDevice"> <property name="label" translatable="yes">Import from GPS Device</property> @@ -492,19 +493,41 @@ </packing> </child> <child> - <widget class="GtkRadioButton" id="radiobuttonFile"> - <property name="label" translatable="yes">Import from File</property> + <widget class="GtkHBox" id="hbox1"> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="active">True</property> - <property name="draw_indicator">True</property> - <property name="group">radiobuttonTabGPSDevice</property> + <child> + <widget class="GtkRadioButton" id="radiobuttonFile"> + <property name="label" translatable="yes">Import from File</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="draw_indicator">True</property> + <property name="group">radiobuttonTabGPSDevice</property> + </widget> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <widget class="GtkCheckButton" id="checkbuttonAutoLaunch"> + <property name="label" translatable="yes">Launch 'File Select' on start</property> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="tooltip" translatable="yes">Automatically start the file selection dialog</property> + <property name="xalign">0.47999998927116394</property> + <property name="draw_indicator">True</property> + </widget> + <packing> + <property name="padding">10</property> + <property name="position">1</property> + </packing> + </child> </widget> <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="padding">10</property> <property name="position">1</property> </packing> </child> Modified: pytrainer/trunk/pytrainer/gui/windowimportdata.py =================================================================== --- pytrainer/trunk/pytrainer/gui/windowimportdata.py 2010-03-03 22:25:30 UTC (rev 518) +++ pytrainer/trunk/pytrainer/gui/windowimportdata.py 2010-03-04 09:07:17 UTC (rev 519) @@ -51,16 +51,21 @@ self.defaulttab = 0 else: self.defaulttab = int(self.defaulttab) + self.auto_launch = self.configuration.getValue("pytraining","auto_launch_file_selection") + if self.auto_launch == "True": + self.auto_launch = True + else: + self.auto_launch = False self.notebookMainTabs.set_current_page(self.defaulttab) - self.init_tab(self.defaulttab) + self.init_tab(self.defaulttab, first=True) - def init_tab(self, page): + def init_tab(self, page, first=False): if page == 0: #'Import from GPS Device' tab self.init_gpsdevice_tab() elif page == 1: #'Import from File' tab - self.init_file_tab() + self.init_file_tab(first) elif page ==2: #'Plugins' tab self.init_plugins_tab() @@ -80,7 +85,7 @@ def init_gpsdevice_tab(self): return - def init_file_tab(self): + def init_file_tab(self, first=False): #self.filechooserbuttonSelectFile.unselect_all() self.updateStatusbar(self.statusbarImportFile, _("No file selected") ) self.processClasses = [] @@ -94,6 +99,11 @@ self.files_store.clear() self.buttonRemoveSelectedFiles.set_sensitive(0) self.buttonFileImport.set_sensitive(0) + if first and self.auto_launch: + while gtk.events_pending(): # This allows the GUI to update + gtk.main_iteration() # before completion of this entire action + print "autolaunch active" + self.buttonSelectFiles.clicked() return def init_plugins_tab(self): @@ -147,10 +157,13 @@ #Set correct radiobutton based on saved preference if self.defaulttab == 1: self.radiobuttonFile.set_active(1) + self.checkbuttonAutoLaunch.set_sensitive(1) elif self.defaulttab == 2: self.radiobuttonPlugins.set_active(1) else: self.radiobuttonTabGPSDevice.set_active(1) + if self.auto_launch: + self.checkbuttonAutoLaunch.set_active(1) return def detect_tools(self): @@ -346,14 +359,18 @@ """ Save options selected in options tab """ + self.autoLaunchFileSelection = "False" #Default tab option if self.radiobuttonTabGPSDevice.get_active(): self.defaulttab = "0" elif self.radiobuttonFile.get_active(): self.defaulttab = "1" + if self.checkbuttonAutoLaunch.get_active(): + self.autoLaunchFileSelection = "True" elif self.radiobuttonPlugins.get_active(): self.defaulttab = "2" self.configuration.setValue("pytraining","import_default_tab",self.defaulttab) + self.configuration.setValue("pytraining","auto_launch_file_selection",self.autoLaunchFileSelection) #option def removeSelectedFiles(self): @@ -450,6 +467,9 @@ ## Window signal handlers ## ############################ + def on_radiobuttonFile_toggled(self, *args): + print "radio button toggled" + def on_pluginsButton_Configure_clicked(self, button, pluginClass): ''' Handler for plugin Buttons Modified: pytrainer/trunk/pytrainer/main.py =================================================================== --- pytrainer/trunk/pytrainer/main.py 2010-03-03 22:25:30 UTC (rev 518) +++ pytrainer/trunk/pytrainer/main.py 2010-03-04 09:07:17 UTC (rev 519) @@ -63,7 +63,7 @@ class pyTrainer: def __init__(self,filename = None, data_path = None): #Version constants - self.version ="1.7.1_svn#517" + self.version ="1.7.1_svn#519" self.DB_version = 3 #Setup usage and permitted options This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |