Changeset 165
- Timestamp:
- 01/20/08 21:47:30 (1 year ago)
- Files:
-
- pytrainer/trunk/pytrainer/extensions/googlemaps.py (modified) (2 diffs)
- pytrainer/trunk/pytrainer/gui/aboutdialog.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
pytrainer/trunk/pytrainer/extensions/googlemaps.py
r161 r165 41 41 if not os.path.isdir(extensiondir): 42 42 os.mkdir(extensiondir) 43 43 points = [] 44 levels = [] 45 pointlist = [] 46 htmlfile = self.conf.getValue("tmpdir")+"/index.html" 47 44 48 gpxfile = self.conf.getValue("gpxdir")+"/%s.gpx" %id_record 45 if not os.path.isfile(gpxfile): 46 return None 47 gpx = Gpx(self.data_path,gpxfile) 48 list_values = gpx.getTrackList() 49 pointlist = [] 50 for i in list_values: 51 pointlist.append((i[4],i[5])) 52 points,levels = Points.encodePoints(pointlist) 53 points = points.replace("\\","\\\\") 49 if os.path.isfile(gpxfile): 50 gpx = Gpx(self.data_path,gpxfile) 51 list_values = gpx.getTrackList() 52 for i in list_values: 53 pointlist.append((i[4],i[5])) 54 points,levels = Points.encodePoints(pointlist) 55 points = points.replace("\\","\\\\") 54 56 55 htmlfile = self.conf.getValue("tmpdir")+"/index.html" 56 self.createHtml(points,levels,pointlist[0]) 57 htmlfile = os.path.abspath(htmlfile) 58 if htmlfile != self.htmlfile: 57 self.createHtml(points,levels,pointlist[0]) 58 htmlfile = os.path.abspath(htmlfile) 59 if htmlfile != self.htmlfile: 60 self.moz.load_url("file://"+htmlfile) 61 else: 62 self.createErrorHtml() 59 63 self.moz.load_url("file://"+htmlfile) 60 64 # self.htmlfile = htmlfile … … 161 165 file.run() 162 166 163 167 def createErrorHtml(self): 168 content = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \n" 169 content += " \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n" 170 content += " <html xmlns=\"http://www.w3.org/1999/xhtml\" xmlns:v=\"urn:schemas-microsoft-com:vml\">\n" 171 content += """ <head>\n 172 <body> 173 No Gpx Data 174 </body> 175 </html> 176 """ 177 tmpdir = self.conf.getValue("tmpdir") 178 filename = tmpdir+"/index.html" 179 file = fileUtils(filename,content) 180 file.run() pytrainer/trunk/pytrainer/gui/aboutdialog.py
r4 r165 30 30 about_widget = aboutwindow.get_widget("aboutdialog1") 31 31 about_widget.set_version(self.version) 32 about_widget.set_name("pyTrainer") 32 33
