Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(43)  |  Call(43)  |  Derive(0)  |  Import(0)

src/m/o/modrana-HEAD/modules/mod_route/mod_route.py   modrana(Download)
 
            # stop Turn-by-turn navigation, that can be possibly running
            self.sendMessage('turnByTurn:stop')
 
        elif message == 'expectStart':
                # also ask for instructions for the given point
                if self.handmade:
                    self.sendMessage('route:middleInput')
            self.expectMiddle = False
            self.set('needRedraw', True) # refresh the screen to show the new point
                            import sys
                            e = sys.exc_info()[1]
                            self.sendMessage('ml:notification:m:No route found;3')
                            self.set('needRedraw', True)
                            print(e)
                            where = args['show']
                            if where == 'start':
                                self.sendMessage('mapView:recentre %f %f|set:menu:None' % start)
                            elif where == "destination":
                                self.sendMessage('mapView:recentre %f %f|set:menu:None' % destination)

src/m/o/modrana-HEAD/modules/mod_storePOI.py   modrana(Download)
                    os.rename(oldPOIPath, renamedOldPOIPath)
                    print("storePOI: old POI file moved to: %s" % renamedOldPOIPath)
                    self.sendMessage('ml:notification:m:%d old POI imported to category "Other";10' % len(points))
            except Exception:
                import sys
                self.deletePOI(poiId) # remove the poi from database
                # notify the showPOI module, that it might need to rebuild its menus
                self.sendMessage('showPOI:listMenusDirty')
        elif messageType == 'ms' and message == 'setCatAndCommit':
            # set category and as this is the last needed input,
            self.tempOnlinePOI.storeToDb()
            # signal that the showPOI menus may need to be regenerated
            self.sendMessage('showPOI:listMenusDirty')
            catInfo = self.getCategoryForId(catId)
            catName = catInfo[1]
                self.set('menu', self.menuNameAfterStorageComplete)
 
            self.sendMessage('ml:notification:m:%s has been saved to %s;5' % (POIName, catName))
 
        elif message == "reconnectToDb":
            # result before saving it to POI
            self.tempOnlinePOI.setName(result, commit=False)
            self.sendMessage('ml:notification:m:Select a category for the new POI;3')
            self.sendMessage('ml:showPOI:setupPOICategoryChooser:storePOI;setCatAndCommit')
            self.set('menu', 'menu#list#POICategoryChooser')

src/m/o/modrana-HEAD/modules/mod_showPOI.py   modrana(Download)
                        self.expectPoint = True # turn on registering the whole screen clickable
                    self.set('menu', None)
                    self.sendMessage('ml:notification:m:Tap on the map to add POI;3')
                    self.set('needRedraw', True)
                elif args == "fromMapDone": # this is after the point has been clicked
                # check if the POI menus are "dirty" and need to be regenerated
                if self.listMenusDirty:
                    self.sendMessage('showPOI:setupCategoryList')
                    if self.activePOI:
                        catId = self.activePOI.getCatId()
                        self.sendMessage('ms:showPOI:setupPOIList:%d' % catId)
                # and may need a regen"""
                self.activePOI.routeFrom('currentPosition')
                self.sendMessage('mapView:recentreToPos')
                self.makePOIVisible(self.activePOI)
                self.drawPOI()
            self._setupPOICategoryChooser('showPOI', 'setCatAndCommit')
            self.set('menu', 'menu#list#POICategoryChooser')
            self.sendMessage('ml:notification:m:Select a category for this POI;3')
 
        # "current position as a new POI" entry chain

src/m/o/modrana-HEAD/modules/mod_loadTracklogs.py   modrana(Download)
        count = len(pathList)
        index = 1
        self.sendMessage('notification:loading %d tracklogs#1' % count)
        for path in pathList:
            self.loadTracklog(path, False)
            self.sendMessage('notification:%d of %d loaded#1' % (index, count))
        self.save()
        self.cleanCache()
        self.sendMessage('notification:%d tracks loaded in %1.2f ms#1' % (count, elapsed))
 
 
 
        if notify:
            self.sendMessage('notification:loading %s#1' % path)
 
        if file: # TODO: add handling of other than GPX files
                print("loading tracklog failed:\n%s" % e)
                if notify:
                    self.sendMessage('notification:loading tracklog failed#2')
                return
            file.close()

src/m/o/modrana-HEAD/modules/mod_search.py   modrana(Download)
            lat, lon = activeResult.getLL()
            # clear any old route and route to the result
            self.sendMessage('route:clearRoute|md:route:route:type=pos2ll;toLat=%f;toLon=%f;show=start' % (lat, lon))
 
        self.set("needRedraw", True)
    def handleTextEntryResult(self, key, result):
        # handle custom query input
        if key == "customQuery":
            message = "ms:search:searchThis:%s" % result
            self.sendMessage(message)
                    self._jumpToPoint(point)
                else:
                    self.sendMessage('set:menu:menu#list#%s' % name)
                menu.setOnceBackAction('set:menu:searchWhat')
            else: # just jump to the first result
                point = points[0]
                self._jumpToPoint(point)
        else:
            print("geocoding done - nothing found")
            self.sendMessage('ml:notification:m:No results found for this address.;5')
                    self._jumpToPoint(point)
                else:
                    self.sendMessage('set:menu:menu#list#%s' % name)
                menu.setOnceBackAction('set:menu:searchWhat')
            else: # just jump to the first result

src/m/o/modrana-HEAD/modules/mod_turnByTurn/mod_turnByTurn.py   modrana(Download)
        time.sleep(2) #TODO: improve this
        # 2. get a new route from current position to destination
        self.sendMessage("ms:route:reroute:fromPosToDest")
        # 3. restart routing for to this new route from the closest point
        self.sendMessage("ms:turnByTurn:start:closest")
 
                # show the warning message
                self.sendMessage('ml:notification:m:use at own risk, watch for cliffs, etc.;3')
                # for some reason the combined distance does not account for the last step
                self.mRouteLength = route.getLength()

src/m/o/modrana-HEAD/modules/mod_menu.py   modrana(Download)
 
        elif message == 'shutdownModRana':
            self.sendMessage("ml:notification:m:Shutting down;10")
            cron = self.m.get('cron', None)
            if cron:

src/m/o/modrana-HEAD/modules/mod_mapView.py   modrana(Download)
    def jump2point(self, point):
        """recenter on a given point"""
        z = self.get('z', 15)
        lat, lon = point.getLL()
        self.sendMessage('mapView:recentre %f %f %d|set:menu:None|set:needRedraw:True' % (lat, lon, z))

src/m/o/modrana-HEAD/modules/mod_keys.py   modrana(Download)
    def on_key_press_event(self, widget, event):
        keyName = gtk.gdk.keyval_name(event.keyval)
        if keyName == 'F8':
            # zoom out
            self.sendMessage('mapView:zoomOut')
        elif keyName == 'F7':
            # zoom in
            self.sendMessage('mapView:zoomIn')

src/m/o/modrana-HEAD/modules/mod_onlineServices/mod_onlineServices.py   modrana(Download)
    def _disableOverlay(self):
        """disable the "working" overlay + disable the timestamp"""
        self.sendMessage('ml:notification:workInProgressOverlay:disable')
        self.workStartTimestamp = None