def actualize_fromgpx(self, gpxfile): logging.debug(">>") from lib.gpx import Gpx gpx = Gpx(self.data_path, gpxfile) tracks = gpx.getTrackRoutes() if len(tracks) > 1: time = unixtime2date(tracks[0][1]) self.recordwindow.rcd_date.set_text(time) self._actualize_fromgpx(gpx) else: msg = _( "The gpx file seems to be a several days records. Perhaps you will need to edit your gpx file" ) from gui.warning import Warning warning = Warning(self.data_path, self._actualize_fromgpx, [gpx]) warning.set_text(msg) warning.run() logging.debug("<<")
def actualize_fromgpx(self,gpxfile): logging.debug(">>") #self.pytrainer_main.ddbb.connect() from lib.gpx import Gpx gpx = Gpx(self.data_path,gpxfile) tracks = gpx.getTrackRoutes() if len(tracks) > 1: time = self.date.unixtime2date(tracks[0][1]) self.recordwindow.rcd_date.set_text(time) self._actualize_fromgpx(gpx) else: msg = _("The gpx file seems to be a several days records. Perhaps you will need to edit your gpx file") from gui.warning import Warning warning = Warning(self.data_path,self._actualize_fromgpx,[gpx]) warning.set_text(msg) warning.run() #self.pytrainer_main.ddbb.disconnect() logging.debug("<<")
def actualize_fromgpx(self,gpxfile): #TODO remove? - should never have multiple tracks per GPX file logging.debug('>>') logging.debug('loading file: '+gpxfile) gpx = Gpx(self.data_path,gpxfile) tracks = gpx.getTrackRoutes() if len(tracks) == 1: logging.debug('Just 1 track') self._actualize_fromgpx(gpx) elif len(tracks) > 1: logging.debug('Found '+str(len(tracks))+' tracks') self._select_trkfromgpx(gpxfile,tracks) else: msg = _("pytrainer can't import data from your gpx file") from gui.warning import Warning warning = Warning(self.data_path) warning.set_text(msg) warning.run() logging.debug('<<')
def actualize_fromgpx(self,gpxfile): #TODO remove? - should never have multiple tracks per GPX file logging.debug('>>') logging.debug('loading file: '+gpxfile) gpx = Gpx(self.data_path,gpxfile) tracks = gpx.getTrackRoutes() if len(tracks) == 1: logging.debug('Just 1 track') self._actualize_fromgpx(gpx) elif len(tracks) > 1: logging.debug('Found '+str(len(tracks))+' tracks') self._select_trkfromgpx(gpxfile,tracks) else: msg = _("pytrainer can't import data from your gpx file") from gui.warning import Warning warning = Warning(self.data_path) warning.set_text(msg) warning.run() logging.debug('<<')