Changeset 165

Show
Ignore:
Timestamp:
01/20/08 21:47:30 (1 year ago)
Author:
vud1
Message:

--

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • pytrainer/trunk/pytrainer/extensions/googlemaps.py

    r161 r165  
    4141                if not os.path.isdir(extensiondir): 
    4242                        os.mkdir(extensiondir) 
    43  
     43                points = [] 
     44                levels = [] 
     45                pointlist = [] 
     46                htmlfile = self.conf.getValue("tmpdir")+"/index.html" 
     47                 
    4448                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("\\","\\\\") 
    5456         
    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() 
    5963                        self.moz.load_url("file://"+htmlfile) 
    6064                #       self.htmlfile = htmlfile 
     
    161165                file.run() 
    162166                 
    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> 
     173No 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  
    3030                 about_widget = aboutwindow.get_widget("aboutdialog1") 
    3131                 about_widget.set_version(self.version) 
     32                 about_widget.set_name("pyTrainer") 
    3233