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

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

src/m/o/modrana-HEAD/modules/mod_options/mod_options.py   modrana(Download)
                themeList = theme.getAvailableThemeIds()
                # check if current theme as set in options exists
                currentTheme = self.get('currentTheme', None)
                if currentTheme is not None:
                    if currentTheme not in themeList:
        if self.get('voiceParameters', None) == "manual":
        elif messageType == "ml" and message == "editVariable":
            (variable, label, description) = args
            initialText = self.get(variable, "")
            entry = self.m.get('textEntry', None)
            if entry:
                        fakeMode = mode
                        mode = self.get('mode', 'car')
                        fakeMode = None
                    value = self.get(variable, None, mode=mode)

src/m/o/modrana-HEAD/modules/mod_route/mod_route.py   modrana(Download)
            proj = self.m.get('projection', None)
            if proj and self.expectStart:
                lastClick = self.get('lastClickXY', None)
                (x, y) = lastClick
                # x and y must be floats, otherwise strange rounding errors
            proj = self.m.get('projection', None)
            if proj and self.expectMiddle:
                lastClick = self.get('lastClickXY', None)
                (x, y) = lastClick
                # x and y must be floats, otherwise strange rounding errors
                # occur when converting to lat lon coordinates
                (lat, lon) = proj.xy2ll(x, y)
                middlePos = self.get('middlePos', [])
            proj = self.m.get('projection', None)
            if proj and self.expectEnd:
                lastClick = self.get('lastClickXY', None)
                (x, y) = lastClick
                # x and y must be floats, otherwise strange rounding errors
        elif message == "p2pRoute": # simple route, between two points
            destination = self.get("endPos", None)
            start = self.get("startPos", None)
            if destination and start:

src/m/o/modrana-HEAD/modules/mod_mapData/mod_mapData.py   modrana(Download)
            # * so, when downloading:
            # -> look at the map OR the batch progress :)**
            (x1, y1, w, h) = self.get('viewport', None)
            self.set('dataMenu', 'edit')
            menus = self.m.get("menu", None)
                action = "set:activeTracklogPath:%s|loadTracklogs:loadActive" % track['path']
                status = self.get('editBatchMenuActive', False)
                if status == True:
                    action += '|menu:setupEditBatchMenu|set:menu:editBatch'
            status = self.get('editBatchMenuActive', False)
            if status == True:
                parent = 'editBatch'
    def refreshTilecount(self):
        """The batch download parameters were changed,
        refresh the current tilecount
        messageType = self.get("downloadType")
        location = self.get("downloadArea", "here") # here or route
        maxZoomLimit = 17

src/m/o/modrana-HEAD/modules/mod_mapView.py   modrana(Download)
    def firstTime(self):
        self.checkMapDraggingMode() # check the map dragging mode on startup
        self.checkCenteringDisableThreshold() # check centering disable threshold on startup
        self.lastZ = int(self.get('z', 15))
        # grid
    def handleMessage(self, message, messageType, args):
        z = self.get('z', 15)
        if message == 'zoomIn':
            newZ = z + 1
            self.set('z', newZ)
        elif message == 'recentreToPos':
            pos = self.get('pos', None)
            proj = self.m.get('projection', None)
            if pos and proj:
    def dragEvent(self, startX, startY, dx, dy, x, y):
        """only drag the map if centering is disabled"""
        if not self.get("centred", False):
            proj = self.m.get('projection', None)
            if proj:
    def handleCentring(self):
        """check if centring is on"""
        if self.get("centred", True):
            # get current position information
            pos = self.get('pos', None)

src/m/o/modrana-HEAD/modules/mod_showTracklogs.py   modrana(Download)
        #    cr.fill()
        visibleTracklogs = self.get('visibleTracklogsDict', {})
        loadTl = self.m.get('loadTracklogs', None) # get the tracklog module
        loadedTracklogsPathList = loadTl.getLoadedTracklogPathList()
            colorName = visibleTracklogs[path]['colorName']
            if self.get('showTracklog', None) == 'simple':
                self.drawSimpleTrack(cr, GPXTracklog, colorName)
            elif self.get('showTracklog', None) == 'colored':
                self.drawColoredTracklog(cr, GPXTracklog)
            if self.get('debugCircles', None) == True:
                self.drawDebugCircles(cr, GPXTracklog)
            if self.get('debugSquares', None) == True:
                self.drawDebugSquares(cr, GPXTracklog)

src/m/o/modrana-HEAD/modules/mod_turnByTurn/mod_turnByTurn.py   modrana(Download)
            # we need to have the viewport available
            vport = self.get('viewport', None)
            menus = self.m.get('menu', None)
            if vport and menus:
    def _automaticReroutingEnabled(self):
        return self.get('reroutingThreshold', REROUTING_DEFAULT_THRESHOLD)
    def sayTurn(self, message, distanceInMeters, forceLanguageCode=False):
        """say a text-to-speech message about a turn
    def getClosestStep(self):
        """get the geographically closest step"""
        proj = self.m.get('projection', None) # we also need the projection module
        pos = self.get('pos', None) # and current position
        if pos and proj:
                # some statistics
                metersPerSecSpeed = self.get('metersPerSecSpeed', None)
                dt = m.routeLookupDuration
                print("turnByTurn: route lookup took: %f s" % dt)
                # as we might be already past it and on our way to the next turn
                cs = self.getClosestStep() # get geographically closest step
                pos = self.get('pos', None) # get current position
                pReachedDist = int(self.get('pointReachedDistance', 30)) # get the trigger distance
                nextTurnId = self.getStepID(cs) + 1

src/m/o/modrana-HEAD/modules/_mod_infoOverlay.py   modrana(Download)
    def get_pos(self):
        pos = self.get('pos', None)
        if pos is None:
            self.lines.append('No position')
            self.lines.append('%1.4f, %1.4f' % pos)
            self.lines.append("Position from: %s" % self.get('pos_source', 'unknown'))
    def get_road(self):
        text = self.get('nearest_road', None)
        if text is not None:
        text = self.get('nearest_place', None)
    def get_speed(self):
        self.lines.append('Speed: %1.1f ' % self.get('speed', 0) + self.unitString)
    def get_bearing(self):
        self.lines.append('Bearing: %03.0f ' % self.get('bearing', 0))

src/m/o/modrana-HEAD/modules/mod_showPOI.py   modrana(Download)
    def makeMapClickable(self):
        """make the whole map/screen clickable and send a specific message when clicked"""
        clickHandler = self.m.get('clickHandler', None)
        (x, y, w, h) = self.get('viewport')
        if clickHandler:
                    lon = POI.getLon()
                    name = POI.getName()
                    hidePOICaptionZl = int(self.get("hideMarkerCaptionsBelowZl", 13))
                    if int(self.get('z', 15)) > hidePOICaptionZl:
                        distanceString = ""
                        pos = self.get('pos', None)
                    # draw a caption with transparent background
                    if int(self.get('z', 15)) > hidePOICaptionZl:
                        extents = cr.text_extents(text) # get the text extents

src/m/o/modrana-HEAD/modules/mod_mapTiles/mod_mapTiles.py   modrana(Download)
    def firstTime(self):
        self.mapViewModule = self.m.get('mapView', None)
        scale = self.get('mapScale', 1)
        self._updateScalingCB('mapScale', scale, scale)
        self.modrana.watch('mapScale', self._updateScalingCB)
        # check if tile filtering is enabled or should be enabled with current theme
        maxThreads = int(self.get("maxAutoDownloadThreads2", 10))
        self._downloader = Downloader(maxThreads)
            scale = int(newValue)
            scale = int(self.get('mapScale', 1))
        if scale == 1: # this will be most of the time, so it is first
            z = int(self.get('z', 15))
        elif scale == 2: # tiles are scaled to 512*512 and represent tiles from zl-1
            z = int(self.get('z', 15)) - 1

src/m/o/modrana-HEAD/modules/mod_menu.py   modrana(Download)
        if (timestamp - self.lastHideCheckTimestamp) > 1:
            self.lastHideCheckTimestamp = timestamp
            if self.get('menu', None) is None:
                # only check in the map view,
                # or else the user might return from menu to a screen wit no buttons,
                # which might be inconvenient
                hideDelay = self.get('hideDelay', 'never')
    def drawScreenOverlay(self, cr):
        """Draw an overlay on top of the map, showing various information
        about position etc."""
        (x, y, w, h) = self.get('viewport')
            # possible main button coordinates override
            mode = self.get('mode', None)
            if mode in self.userConfig:
                if 'override_main_buttons' in self.userConfig[mode]:
            # main buttons
            modeIcon = self.get('mode', 'car')
            # use thinner outline and smaller corner radius
            menuIcon = "%s>generic:;;;;5;10" % modeIcon

  1 | 2 | 3 | 4  Next