[Pkg-running-devel] [SCM] Debian package for pytrainer branch, master, updated. debian/1.6.0.8-1-18-g97d2f5b
Christian Perrier
bubulle at debian.org
Sun Jun 19 20:19:45 UTC 2011
The following commit has been merged in the master branch:
commit e826e0fb462ea9d02e50d394da04f04a663ec569
Author: Christian Perrier <bubulle at debian.org>
Date: Sun Jun 19 22:14:02 2011 +0200
2nd resync with upstream 1.8.0
diff --git a/glade/path2766.png b/glade/path2766.png
deleted file mode 100644
index 78a9c1d..0000000
Binary files a/glade/path2766.png and /dev/null differ
diff --git a/glade/path2772.png b/glade/path2772.png
deleted file mode 100644
index 895f729..0000000
Binary files a/glade/path2772.png and /dev/null differ
diff --git a/pytrainer/lib/heartrate.py b/pytrainer/lib/heartrate.py
deleted file mode 100644
index 91d1865..0000000
--- a/pytrainer/lib/heartrate.py
+++ /dev/null
@@ -1,53 +0,0 @@
-# -*- coding: iso-8859-1 -*-
-
-#Copyright (C) Fiz Vazquez vud1 at sindominio.net
-
-#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.
-
-from system import checkConf
-from xmlUtils import XMLParser
-
-def getZones():
- conf = checkConf()
- filename = conf.getValue("conffile")
- configuration = XMLParser(filename)
- maxhr = int(configuration.getValue("pytraining","prf_maxhr"))
- resthr = int(configuration.getValue("pytraining","prf_minhr"))
-
- if configuration.getValue("pytraining","prf_hrzones_karvonen")=="True":
- #if karvonen method
- targethr1 = ((maxhr - resthr) * 0.50) + resthr
- targethr2 = ((maxhr - resthr) * 0.60) + resthr
- targethr3 = ((maxhr - resthr) * 0.70) + resthr
- targethr4 = ((maxhr - resthr) * 0.80) + resthr
- targethr5 = ((maxhr - resthr) * 0.90) + resthr
- targethr6 = maxhr
- else:
- #if not karvonen method
- targethr1 = maxhr * 0.50
- targethr2 = maxhr * 0.60
- targethr3 = maxhr * 0.70
- targethr4 = maxhr * 0.80
- targethr5 = maxhr * 0.90
- targethr6 = maxhr
-
- zone1 = (targethr1,targethr2,"#ffff99",_("Moderate activity"))
- zone2 = (targethr2,targethr3,"#ffcc00",_("Weight Control"))
- zone3 = (targethr3,targethr4,"#ff9900",_("Aerobic"))
- zone4 = (targethr4,targethr5,"#ff6600",_("Anaerobic"))
- zone5 = (targethr5,targethr6,"#ff0000",_("VO2 MAX"))
-
- return zone5,zone4,zone3,zone2,zone1
-
diff --git a/pytrainer/lib/soapUtils.py b/pytrainer/lib/soapUtils.py
deleted file mode 100644
index f461540..0000000
--- a/pytrainer/lib/soapUtils.py
+++ /dev/null
@@ -1,149 +0,0 @@
-# -*- coding: iso-8859-1 -*-
-
-#Copyright (C) Fiz Vazquez vud1 at sindominio.net
-# vud1 at grupoikusnet.com
-# Jakinbidea & Grupo Ikusnet Developer
-
-#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 SOAPpy
-from pytrainer.lib.ddbb import DDBB
-from pytrainer.lib.xmlUtils import XMLParser
-from pytrainer.lib.system import checkConf
-
-from threading import Thread
-
-class webService(Thread):
- def __init__(self,data_path=None,onchangeAction = None,insertNewRecord=None):
- system = checkConf()
- self.data_path = data_path
- self.conffile = "%s/conf.xml" %system.getValue("confdir")
- self.server = SOAPpy.ThreadingSOAPServer(("localhost", 8081))
- #self.server = SOAPpy.server.InsecureServer(("localhost", 8081))
- self.server.registerFunction(self.getRecordInfo)
- self.server.registerFunction(self.addWaypoint)
- self.server.registerFunction(self.updateWaypoint)
- self.server.registerFunction(self.getWaypoints)
- self.server.registerFunction(self.test)
- self.server.registerFunction(self.newRecord)
- self.onchangeAction = onchangeAction
- self.insertNewRecord = insertNewRecord
- Thread.__init__ ( self )
-
- def getRecordInfo(self,id_record):
- configuration = XMLParser(self.conffile)
- ddbb = DDBB(configuration)
- ddbb.connect()
- recordinfo = ddbb.select("records,sports",
- "sports.name,date,distance,time,beats,comments,average,calories,id_record,title,upositive,unegative,maxspeed,maxpace,pace,maxbeats",
- "id_record=\"%s\" and records.sport=sports.id_sports" %id_record)
- record = recordinfo[0]
- info = {}
- info["sport"] = record[0]
- info["date"] = record[1]
- info["distance"] = record[2]
- info["time"] = record[3]
- info["beats"] = record[4]
- info["comments"] = record[5]
- info["average"] = record[6]
- info["calories"] = record[7]
- info["title"] = record[9]
- info["upositive"] = record[10]
- info["unegative"] = record[11]
- info["maxspeed"] = record[12]
- info["maxpace"] = record[13]
- info["pace"] = record[14]
- info["maxbeats"] = record[15]
- return info
-
- def newRecord(self,title=None,distance=None,time=None,upositive=None, unegative=None, bpm=None,calories=None, date=None, comment=None):
- #self.insertNewRecord(title,distance,time,upositive,unegative,bpm,calories,date,comment)
- #Pasar de la ventana.
- #meter el registro en la bbdd y reiniciar la interfaz
- from pytrainer.lib.ddbb import DDBB
- from pytrainer.lib.xmlUtils import XMLParser
- from pytrainer.lib.system import checkConf
- conf = checkConf()
- filename = conf.getValue("conffile")
- configuration = XMLParser(filename)
- ddbb = DDBB(configuration)
- ddbb.connect()
- cells= "date,sport,distance,time,beats,comments,average,calories,title,upositive,unegative"
- values=[date,1,distance,time,bpm,comment,float(distance)/(float(time)/3600),calories,title,upositive,unegative]
- ddbb.insert("records",cells,values)
- return ddbb.lastRecord("records")
-
- def addWaypoint(self,lon=None,lat=None,name=None,comment=None,sym=None):
- configuration = XMLParser(self.conffile)
- ddbb = DDBB(configuration)
- ddbb.connect()
- cells = "lat,lon,comment,name,sym"
- values = (lat,lon,comment,name,sym)
- ddbb.insert("waypoints",cells,values)
- self.onchangeAction(False,0)
- return ddbb.lastRecord("waypoints")
-
- def getWaypoints(self):
- configuration = XMLParser(self.conffile)
- ddbb = DDBB(configuration)
- ddbb.connect()
- cells = "lat,lon,comment,name,sym"
- return ddbb.select("waypoints","lat,lon,ele,comment,time,name,sym","1=1 order by name")
-
- def updateWaypoint(self,lon=None,lat=None,name=None,comment=None,sym=None,id_waypoint=None):
- if id_waypoint==None:
- return "NACK"
- c = []
- v = []
- values = []
- if lat:
- c.append("lat")
- values.append(lat)
- if lon:
- c.append("lon")
- values.append(lon)
- if comment:
- c.append("comment")
- values.append(comment)
- if sym:
- c.append("sym")
- values.append("sym")
- cells = ""
- count=0
- for i in c:
- if count==1:
- cells +=","
- cells += "%s"%i
- count=1
-
- configuration = XMLParser(self.conffile)
- ddbb = DDBB(configuration)
- ddbb.connect()
- ddbb.update("waypoints",cells,values," id_waypoint=%d" %int(id_waypoint))
- self.onchangeAction(False,0)
- return "ACK"
-
- def test(self,lon=None,lat=None):
- print "Llamando al soap"
- return "Hello world!"
-
- def run(self):
- self.server.serve_forever()
-
- def stop(self):
- self._Thread__stop()
- self.server.server_close()
-
-
diff --git a/pytrainer/lib/system.py b/pytrainer/lib/system.py
deleted file mode 100644
index c88a48c..0000000
--- a/pytrainer/lib/system.py
+++ /dev/null
@@ -1,102 +0,0 @@
-# -*- coding: iso-8859-1 -*-
-
-#Copyright (C) Fiz Vazquez vud1 at sindominio.net
-
-#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 os
-import sys
-
-class checkConf:
- def __init__(self):
- self.home = None
- self.tmpdir = None
- self.confdir = None
- self.conffile = None
- self.gpxdir = None
- self.extensiondir = None
- self.plugindir = None
-
- self._setHome()
- self._setConfFiles()
- self._setTempDir()
- self._setExtensionDir()
- self._setPluginDir()
- self._setGpxDir()
-
- def _setHome(self):
- if sys.platform == "linux2":
- variable = 'HOME'
- elif sys.platform == "win32":
- variable = 'USERPROFILE'
- else:
- print "Unsupported sys.platform: %s." % sys.platform
- sys.exit(1)
- self.home = os.environ[variable]
-
- def _setTempDir(self):
- self.tmpdir = self.confdir+"/tmp"
- if not os.path.isdir(self.tmpdir):
- os.mkdir(self.tmpdir)
-
- def clearTempDir(self):
- """Function to clear out the tmp directory that pytrainer uses
- will only remove files
- """
- if not os.path.isdir(self.tmpdir):
- return
- else:
- files = os.listdir(self.tmpdir)
- for name in files:
- fullname = (os.path.join(self.tmpdir, name))
- if os.path.isfile(fullname):
- os.remove(os.path.join(self.tmpdir, name))
-
- def _setConfFiles(self):
- if sys.platform == "win32":
- self.confdir = self.home+"/pytrainer"
- elif sys.platform == "linux2":
- self.confdir = self.home+"/.pytrainer"
- else:
- print "Unsupported sys.platform: %s." % sys.platform
- sys.exit(1)
- self.conffile = self.confdir+"/conf.xml"
- if not os.path.isdir(self.confdir):
- os.mkdir(self.confdir)
-
- def _setGpxDir(self):
- self.gpxdir = self.confdir+"/gpx"
- if not os.path.isdir(self.gpxdir):
- os.mkdir(self.gpxdir)
-
- def _setExtensionDir(self):
- self.extensiondir = self.confdir+"/extensions"
- if not os.path.isdir(self.extensiondir):
- os.mkdir(self.extensiondir)
-
- def _setPluginDir(self):
- self.plugindir = self.confdir+"/plugins"
- if not os.path.isdir(self.plugindir):
- os.mkdir(self.plugindir)
-
- def getConfFile(self):
- if not os.path.isfile(self.conffile):
- return False
- else:
- return self.conffile
-
- def getValue(self,variable):
- method = getattr(self, variable)
- return method
--
Debian package for pytrainer
More information about the Pkg-running-devel
mailing list