コード例 #1
0
 def removeWaypoint(self, id_waypoint, confirm=False):
     logging.debug('>>')
     if confirm:
         self.waypoint.removeWaypoint(id_waypoint)
         self.refreshWaypointView()
     else:
         msg = _("Delete this waypoint?")
         params = [id_waypoint, True]
         warning = Warning(self.data_path, self.removeWaypoint, params)
         warning.set_text(msg)
         warning.run()
     logging.debug('<<')
コード例 #2
0
ファイル: main.py プロジェクト: dantleech/pytrainer
 def removeWaypoint(self,id_waypoint, confirm = False):
     logging.debug('>>')
     if confirm:
          self.waypoint.removeWaypoint(id_waypoint)
          self.refreshWaypointView()
     else:
          msg = _("Delete this waypoint?")
          params = [id_waypoint,True]
          warning = Warning(self.data_path,self.removeWaypoint,params)
          warning.set_text(msg)
          warning.run()
     logging.debug('<<')
コード例 #3
0
 def removeRecord(self, id_record, confirm=False, view=None):
     logging.debug('>>')
     if confirm:
         self.record.removeRecord(id_record)
     else:
         msg = _("Delete this database entry?")
         params = [id_record, True]
         warning = Warning(self.data_path, self.removeRecord, params)
         warning.set_text(msg)
         warning.run()
     self.refreshListRecords()
     if view is not None:
         self.refreshGraphView(view)
     logging.debug('<<')
コード例 #4
0
ファイル: main.py プロジェクト: dantleech/pytrainer
 def removeRecord(self, id_record, confirm = False, view=None):
     logging.debug('>>')
     if confirm:
          self.record.removeRecord(id_record)
     else:
          msg = _("Delete this database entry?")
          params = [id_record,True]
          warning = Warning(self.data_path,self.removeRecord,params)
          warning.set_text(msg)
          warning.run()
     self.refreshListRecords()
     if view is not None:
         self.refreshGraphView(view)
     logging.debug('<<')
コード例 #5
0
ファイル: waypoint.py プロジェクト: nanoss/pytrainer
    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("<<")
コード例 #6
0
    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('<<')
コード例 #7
0
ファイル: waypoint.py プロジェクト: MrBricodage/pytrainer
	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("<<")
コード例 #8
0
ファイル: record.py プロジェクト: heiderich/pytrainer
	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('<<')