Changeset 7dc6e55


Ignore:
Timestamp:
03/28/12 21:21:59 (4 years ago)
Author:
Martin Kolman <martin.kolman@…>
Branches:
master
Children:
6255792
Parents:
b164932
git-author:
Martin Kolman <martin.kolman@…> (03/28/12 21:21:59)
git-committer:
Martin Kolman <martin.kolman@…> (03/28/12 21:21:59)
Message:

spellcheck

Location:
modules
Files:
29 edited

Legend:

Unmodified
Added
Removed
  • modules/base_module.py

    r30bff6f1 r7dc6e55  
    9797 
    9898  def shutdown(self): 
    99     """Program is about to shutdown (don't rely solely on this for anything important like saving someone's tracklog!)""" 
     99    """ 
     100    Program is about to shutdown 
     101    (don't rely solely on this for anything important like saving someone's tracklog!) 
     102    """ 
    100103    pass 
  • modules/color.py

    r7d1b4b7 r7dc6e55  
    1010     provides: 
    1111     * hex color string 
    12      * cairo compatible rgba tupple 
     12     * cairo compatible rgba tuple 
    1313     * a gtk.gdkColor object 
    1414     """ 
  • modules/device_modules/device_android_chroot.py

    rd43e221 r7dc6e55  
    5555 
    5656  def textEntryIminent(self): 
    57     """in SHR on Neo, we need to temporarry disable fullscreen 
     57    """in SHR on Neo, we need to temporary disable fullscreen 
    5858    (if we are in fullscreen), 
    5959    or else the text entry box won't show up""" 
  • modules/device_modules/device_neo.py

    rd43e221 r7dc6e55  
    5555 
    5656  def textEntryIminent(self): 
    57     """in SHR on Neo, we need to temporarry disable fullscreen 
     57    """in SHR on Neo, we need to temporarily disable fullscreen 
    5858    (if we are in fullscreen), 
    5959    or else the text entry box won't show up""" 
  • modules/geo.py

    r30bff6f1 r7dc6e55  
    125125 
    126126def circleAroundPointCluster(cluster): 
    127   """Find a cricle around a given point cluster and return its centre and radius""" 
    128  
    129   """we get the most nort,west,south,east points as a heristics for the preliminary circle""" 
     127  """Find a circle around a given point cluster and return its centre and radius""" 
     128 
     129  """we get the most north, west, south, east points as a heuristics for the preliminary circle""" 
    130130  maxLat = max(cluster, key=lambda x: x['latitude']) 
    131131  minLat = min(cluster, key=lambda x: x['latitude']) 
     
    136136  latDist = distance(maxLat['latitude'],maxLat['longitude'],minLat['latitude'],minLat['longitude']) 
    137137  lonDist = distance(maxLon['latitude'],maxLon['longitude'],minLon['latitude'],minLon['longitude']) 
    138   if latDist >= lonDist: #the horizonatal distance is the longest 
     138  if latDist >= lonDist: #the horizontal distance is the longest 
    139139    centreX = (maxLat['latitude'] + minLat['latitude'])/2.0 
    140140    centreY = (maxLat['longitude'] + minLat['longitude'])/2.0 
     
    160160 
    161161def perElevList(trackpointsList, numPoints=200): 
    162   """determine elevation in regual interval, numPoints gives the number of intervals""" 
     162  """determine elevation in regular interval, numPoints gives the number of intervals""" 
    163163  points = [{'lat': point.latitude,'lon': point.longitude, 'elev': point.elevation} for point in trackpointsList[0]] 
    164164 
     
    247247        newElev = prevElev + dElev 
    248248 
    249       # add cooridnates to periodic points 
     249      # add coordinates to periodic points 
    250250      (lat1,lon1) = prevPoint[2:4] 
    251251      (lat2,lon2) = nextPoint[2:4] 
  • modules/mod_clickHandler.py

    r30bff6f1 r7dc6e55  
    7474    """handle long press""" 
    7575 
    76     """ make sure subsegvent long presses are ignored until release """ 
     76    """ make sure subsequent long presses are ignored until release """ 
    7777    if self.ignoreNextClicks == 0: 
    7878      for area in self.areas: 
     
    114114                  m.dragEvent(startX,startY,dx,dy,x,y) 
    115115                else: 
    116                   print "Drag registered to nonexistant module %s" % module 
     116                  print "Drag registered to nonexistent module %s" % module 
    117117 
    118118if(__name__ == "__main__"): 
  • modules/mod_display.py

    r7d1b4b7 r7dc6e55  
    4242    """according to documentation on: 
    4343    (http://wiki.maemo.org/PyMaemo/Python-osso_examples#Device_State), 
    44     every display_blanking_pause() call pauses screenblank for 60 secconds, 
    45     to make sure, we request every 30 secconds""" 
     44    every display_blanking_pause() call pauses screenblank for 60 seconds, 
     45    to make sure, we request every 30 seconds""" 
    4646    self.pauseScreenBlankingEnabled = False 
    4747    self.screenBlankPauseInterval = 30 
     
    127127  def getFullscreenEnabled(self): 
    128128    """ 
    129     True - we are in fullscreen, False othewise 
     129    True - we are in fullscreen, False otherwise 
    130130    """ 
    131131    return self.fullscreen 
     
    134134 
    135135  def screenBlankingControlSupported(self): 
    136     """report if controling the screen blanking is supported""" 
     136    """report if controlling the screen blanking is supported""" 
    137137    return self.dmod.screenBlankingControlSupported() 
    138138 
     
    277277      currentTime = time.time() 
    278278      if (currentTime - self.lastScreenblankPauseRequest)>self.screenBlankPauseInterval: 
    279         # reaguest to pause screen blanking for 60 secconds every 30 secconds 
     279        # request to pause screen blanking for 60 seconds every 30 seconds 
    280280        self.pauseScreenBlanking() 
    281281    if self.checkConditions: # run a check for screen un/blanking conditions 
  • modules/mod_icons.py

    rd3b35f3 r7dc6e55  
    198198      pixbuf = gtk.gdk.pixbuf_new_from_file(path) 
    199199      """ 
    200       if width or height are not set, we thek tehm from the pixbuf 
     200      if width or height are not set, we take them from the pixbuf 
    201201      if both are not set, we disable scaling 
    202202      """ 
     
    226226    """return width and height 
    227227       just return w or h if they are set, 
    228        if they are None, use vaules from the given pixbuf""" 
     228       if they are None, use values from the given pixbuf""" 
    229229    if w == None: 
    230230      w = pixbuf.get_width() 
  • modules/mod_loadTracklogs.py

    r7d1b4b7 r7dc6e55  
    2020#--------------------------------------------------------------------------- 
    2121#from dbus.service import Object 
     22from ScrolledText import example 
    2223from base_module import ranaModule 
    2324import geo 
     
    5657        print "loading tracklog: %s" % path 
    5758 
    58         # Zeroeth, is the tracklog already loaded ? 
     59        # Zeroth, is the tracklog already loaded ? 
    5960        if path not in self.tracklogs.keys(): 
    6061          # First, is the cache loaded ? 
     
    178179 
    179180  def getTracklogForPath(self, path): 
    180     # return a tracklog coresponding to the path specified 
     181    # return a tracklog corresponding to the path specified 
    181182    if path in self.tracklogs.keys(): 
    182183      return self.tracklogs[path] 
     
    392393      file = open(path, 'r') 
    393394    except: 
    394       print "loading tracklo failed: %s" % path 
     395      print "loading tracklog failed: %s" % path 
    395396 
    396397    if notify: 
     
    570571    tracklog.type = 'GPX' 
    571572    self.routeInfo = None # a dictionary for storing route information 
    572     # TODO: set this automaticaly 
     573    # TODO: set this automatically 
    573574 
    574575    filename = self.filename 
     
    583584    self.perElevList = None 
    584585 
    585     # dowe have any points to process ? 
     586    # do we have any points to process ? 
    586587    if self.trackpointsList == []: 
    587588      # no points, we are done :) 
     
    629630      self.elevation = True 
    630631      self.routeInfo = {} 
    631       # there we have the poinsts, that contain the highest, lowest, first and last point 
     632      # there we have the points, that contain the highest, lowest, first and last point 
    632633      firstPoint = pointsWithElevation[0] 
    633634      lastPoint = pointsWithElevation[len(pointsWithElevation)-1] 
     
    659660    """ 
    660661    we output the tree structure of the gpx xml back to the file 
    661     this can also meen, that some info that we didnt load to the tree will be lost 
    662     also atributes that were changed after the initial load will be written in the current (changed) state 
     662    this can also mean, that some info that we didn't load to the tree will be lost 
     663    also attributes that were changed after the initial load will be written in the current (changed) state 
    663664    """ 
    664665    f = open(self.filename, "w") # open the old file 
     
    684685  def __init__(self, pointsList, centreX, centreY, radius): 
    685686    self.pointsList = pointsList # points in the cluster 
    686     """coordinates of the circle encompasing all points""" 
     687    """coordinates of the circle encompassing all points""" 
    687688    self.centreX = centreX 
    688689    self.centreY = centreY 
  • modules/mod_markers.py

    r30bff6f1 r7dc6e55  
    206206    once an item is selected, the back action reverts to "set:menu:None", 
    207207    eq. returning to the map screen 
    208     USE CASE: quick returning from search results back to the serch menu 
     208    USE CASE: quick returning from search results back to the search menu 
    209209              to start another search 
    210210    """ 
  • modules/mod_menu.py

    r1d95585 r7dc6e55  
    220220 
    221221  def needRedraw(self): 
    222     """conveninece function for asking for redraw""" 
     222    """convenience function for asking for redraw""" 
    223223    self.set('needRedraw', True) 
    224224 
     
    358358 
    359359    """ 
    360     == Meaning of the menu persistant variable == 
     360    == Meaning of the menu persistent variable == 
    361361    "foo" - the default menu module has to do something with foo 
    362362    "markers#" - the markers module has to draw the menu and gets "" as menu name 
     
    548548 
    549549  def initMenu(self,menu): 
    550     """anitialize menu a menu dictionary instance to default parameters""" 
     550    """initialize menu a menu dictionary instance to default parameters""" 
    551551    self.menus[menu] = self.getInitializedMenu() 
    552552 
     
    13311331 
    13321332  def showTextOld(self,cr,text,x,y,widthLimit=None,fontsize=40): 
    1333     """DEPRECIATED shof text funtion""" 
     1333    """DEPRECIATED show text function""" 
    13341334    if(text): 
    13351335      cr.set_font_size(fontsize) 
  • modules/mod_onlineServices/geocoding.py

    r0e87dda r7dc6e55  
    55class GeoPyPoint(Point): 
    66  """ 
    7   * the GeoPy geocoding results return composite place names contaning 
     7  * the GeoPy geocoding results return composite place names containing 
    88  the address components delimited by ',' 
    99  * this point Point subclass just splits the part before the first ',' 
    1010  and returns it when the getName method is called 
    11   * also, it outpust a description text where all ',' are replaced by newlines 
     11  * also, it outputs a description text where all ',' are replaced by newlines 
    1212  """ 
    1313  def __init__(self, lat, lon, placeText): 
     
    2323 
    2424def _places2points(places): 
    25   """convert place tupples to modRana points""" 
     25  """convert place tuples to modRana points""" 
    2626  points = [] 
    2727  for place in places: 
  • modules/mod_onlineServices/mod_onlineServices.py

    r30bff6f1 r7dc6e55  
    5555      query = urllib.urlopen(url) 
    5656    except: 
    57       "onlineServices: getting elevation from geonames retuned an error" 
     57      "onlineServices: getting elevation from geonames returned an error" 
    5858      return 0 
    5959    return query.read() 
     
    9999        query = urllib.urlopen(url) 
    100100      except: 
    101         "onlineServices: getting elevation from geonames retuned an error" 
     101        "onlineServices: getting elevation from geonames returned an error" 
    102102        results = "0" 
    103103        for i in range(1, len(tempList)): 
     
    149149 
    150150  def googleDirectionsAsync(self, start, destination, outputHandler, key): 
    151     """a background running googledirections query 
    152        -> verbatim start and destination will be used in route descritpion, no geocoding 
     151    """a background running google directions query 
     152       -> verbatim start and destination will be used in route description, no geocoding 
    153153       outputHandler will be provided with the results + the specified key string""" 
    154154    routeRequestSentTimestamp = time.time() # used for measuring how long the route lookup took 
     
    218218        print "onlineServices:Gdirections:routing failed with exception googlemaps status code:%d" % e.status 
    219219    except Exception, e: 
    220       print "onlineServices:Gdirections:routing failed with nongooglemaps exception:\n%s" % e 
     220      print "onlineServices:Gdirections:routing failed with non-googlemaps exception:\n%s" % e 
    221221    self.set('needRedraw', True) 
    222222    return directions 
     
    277277      self._setWorkStatusText("geocoding destination...") 
    278278      destinationAddress = self.googleReverseGeocode(toLat,toLon) 
    279       # return the original start/dest cooridnates 
     279      # return the original start/dest coordinates 
    280280      startLL = start 
    281281      destinationLL = destination 
    282282    else: 
    283       # signalize that the original start/dest cooridnates are unknown 
     283      # signalize that the original start/dest coordinates are unknown 
    284284      startAddress = start 
    285285      destinationAddress = destination 
     
    329329  def _done(self, thread): 
    330330    """a thread reporting it is done""" 
    331     # unregister the thread 
     331    # un-register the thread 
    332332    self._unregisterWorkerThread(thread) 
    333     # if no other thredas are working, disable the overlay 
     333    # if no other threads are working, disable the overlay 
    334334    if not self.workerThreads: 
    335335      self._disableOverlay() 
  • modules/mod_options.py

    r0b8050c2 r7dc6e55  
    232232 
    233233  def removeOption(self, categoryId, groupId, variable): 
    234     """remova an option given by group and variable name""" 
     234    """remove an option given by group and variable name""" 
    235235 
    236236    group = self._getGroupId(categoryId, groupId) 
     
    789789 
    790790#    addOpt("Tracklogs", "showTracklog", 
    791 #    [(False, "Dont draw tracklogs"), 
     791#    [(False, "Don't draw tracklogs"), 
    792792#     ("simple", "Draw simple tracklogs")], 
    793793#     "view", 
     
    920920 
    921921  def _updateVoiceManual(self, action): 
    922     """add or remove custom voce parameters option items""" 
     922    """add or remove custom voice parameters option items""" 
    923923 
    924924    if action == "add": 
     
    995995 
    996996          else: 
    997             # nromal option display 
     997            # normal option display 
    998998            if self.modrana.hasKeyModifierInMode(variable, mode): 
    999999              title = "%s: <small><sup><b>[%s]</b></sup></small>" % ( 
  • modules/mod_positionMarker.py

    r30bff6f1 r7dc6e55  
    7676    cr.save() 
    7777 
    78     # rotate the marker acording to our bearing 
     78    # rotate the marker according to our bearing 
    7979    cr.translate(x1,y1) # we move the coordinates center to where we want the center of the marker 
    8080    cr.rotate(radians(angle)) 
     
    127127    cr.save() 
    128128 
    129     # rotate the marker acording to our bearing 
     129    # rotate the marker according to our bearing 
    130130    cr.translate(x1,y1) # we move the coordinates center to where we want the center of the marker 
    131131 
  • modules/mod_projection.py

    r30bff6f1 r7dc6e55  
    4040  TODO: 
    4141  - why is find edges called twice for position tracking ? 
    42   - dont redraw the whole map for a small nudge 
     42  - don't redraw the whole map for a small nudge 
    4343   -> currently even for a 1 pixel nudge, the whol screen is redrawn 
    4444  - use a mechanism similar to nudging for faster tracklog drawing 
    45    -> shoft the trackpoints so no ll2xy would be needed 
     45   -> show the trackpoints so no ll2xy would be needed 
    4646 
    4747  """ 
     
    6161  def firstTime(self): 
    6262    # make absolutely sure that centering is turned on 
    63     # otherwise we dont know what to show -> black screen => NOT GOOD :) 
     63    # otherwise we don't know what to show -> black screen => NOT GOOD :) 
    6464 
    6565    defaultPosition = (49.2, 16.616667) # Brno 
     
    122122     
    123123  def recentre(self,lat,lon,zoom = None): 
    124 #    print "recentring to: %f,%f" % (lat,lon) 
     124#    print "recentering to: %f,%f" % (lat,lon) 
    125125    """Move the projection to a particular geographic location 
    126126    (with optional zoom level)""" 
  • modules/mod_route.py

    r30bff6f1 r7dc6e55  
    167167      endPos = self.get('endPos', None) 
    168168      pos = self.get('pos', None) 
    169       if pos == None: # well, we dont know where we are, so we dont know here to go :) 
     169      if pos == None: # well, we don't know where we are, so we don't know here to go :) 
    170170        return 
    171171 
    172       if startPos == None and endPos == None: # we know where we are, but we dont know where we should go :) 
     172      if startPos == None and endPos == None: # we know where we are, but we don't know where we should go :) 
    173173        return 
    174174 
     
    190190 
    191191    elif(message == "route"): # find a route 
    192       if (type=='md'): # mesage-list based routing 
     192      if (type=='md'): # message-list based routing 
    193193        if args: 
    194194          type = args['type'] 
     
    277277        self.doAddressRoute(self.startAddress,self.destinationAddress) 
    278278      else: 
    279         print "cant route, start or destionation (or both) not set" 
     279        print "cant route, start or destination (or both) not set" 
    280280 
    281281    elif(message == 'posToStart'): 
     
    357357    self.startAddress = startAddress 
    358358    self.destinationAddress = destinationAddress 
    359     """use cooridnates for start dest or use first/last point from the route 
     359    """use coordinates for start dest or use first/last point from the route 
    360360       if start/dest coordinates are unknown (None)""" 
    361361    if start !=None and destination != None: 
     
    436436          """just skip this as the character is  most probably unknown""" 
    437437          pass 
    438       if cyrillicCharFound: # the substring contains at least one cyrillics character 
     438      if cyrillicCharFound: # the substring contains at least one cyrillic character 
    439439        if cyrillicStringTemp: # append to the already "open" cyrillic string 
    440440          cyrillicStringTemp += ' ' + substring 
     
    517517        return 
    518518 
    519       # as you can see, for some reason, the cooridnates in direction steps are reversed, (lon,lat,0) 
     519      # as you can see, for some reason, the coordinates in direction steps are reversed, (lon,lat,0) 
    520520      steps = map(lambda x: (x['Point']['coordinates'][1],x['Point']['coordinates'][0]), self.directions['Directions']['Routes'][0]['Steps']) 
    521521 
     
    523523      steps.append(self.route[-1]) 
    524524 
    525       # now we convert geographic cooridnates to screen coordinates, so we dont need to do it twice 
     525      # now we convert geographic coordinates to screen coordinates, so we dont need to do it twice 
    526526      steps = map(lambda x: (proj.ll2xy(x[0],x[1])), steps) 
    527527 
     
    585585 
    586586 
    587       # these setting seem to werk the best for routing results: 
    588       # (they have a different structure than loging traces, 
     587      # these setting seem to work the best for routing results: 
     588      # (they have a different structure than logging traces, 
    589589      # eq. long segments delimited by only two points, etc) 
    590       # basicly, routing results heva only the really nedded points -> less points than traces 
     590      # basically, routing results have only the really needed points -> less points than traces 
    591591      if z < 16 and z > 10: 
    592592        modulo = 2**(14-z) 
  • modules/mod_routeProfile.py

    r7d1b4b7 r7dc6e55  
    4141    # is this menu the correct menu ? 
    4242    if menuName != 'routeProfile': 
    43       return # we arent the active menu so we dont do anything 
     43      return # we aren't the active menu so we don't do anything 
    4444    (x1,y1,w,h) = self.get('viewport', None) 
    4545#    if w > h: 
  • modules/mod_search.py

    r30bff6f1 r7dc6e55  
    335335         because the results can be ordered in different manners, we use the absolute index, 
    336336         which is created from the initial ordering 
    337          without this,(with distance sort) we would get different results for a key, if we moved fast enoght :) 
     337         without this,(with distance sort) we would get different results for a key, if we moved fast enough :) 
    338338      """ 
    339339      result = self.getResult(resultNumber, resultList) 
     
    532532      border = 2 
    533533      cr.set_line_width(2) 
    534       cr.set_source_rgba(0, 0, 1, 0.45) # trasparent blue 
     534      cr.set_source_rgba(0, 0, 1, 0.45) # transparent blue 
    535535      (rx,ry,rw,rh) = (x - border+10, y + border+h*0.2, w + 4*border, -(h*1.4)) 
    536536      cr.rectangle(rx,ry,rw,rh) # create the transparent background rectangle 
     
    541541      cr.fill() 
    542542      # draw the actual text 
    543       cr.set_source_rgba(1, 1, 1, 0.95) # slightly trasparent white 
     543      cr.set_source_rgba(1, 1, 1, 0.95) # slightly transparent white 
    544544      menus.drawText(cr, text, rx,ry-(-rh),rw,-rh, 0.05) 
    545 #      cr.show_text(text) # show the trasparent result caption 
     545#      cr.show_text(text) # show the transparent result caption 
    546546      cr.stroke() 
    547547 
     
    577577      border = 2 
    578578      cr.set_line_width(2) 
    579       cr.set_source_rgba(0, 0, 1, 0.45) # trasparent blue 
     579      cr.set_source_rgba(0, 0, 1, 0.45) # transparent blue 
    580580      (rx,ry,rw,rh) = (x - border+10, y + border+h*0.2, w + 4*border, -(h*1.4)) 
    581581      cr.rectangle(rx,ry,rw,rh) # create the transparent background rectangle 
     
    589589       
    590590      # draw the actual text 
    591       cr.set_source_rgba(1, 1, 0, 0.95) # slightly trasparent white 
     591      cr.set_source_rgba(1, 1, 0, 0.95) # slightly transparent white 
    592592      menus.drawText(cr, text, rx,ry-(-rh),rw,-rh, 0.05) 
    593593      cr.stroke() 
     
    647647      textInput = result 
    648648      if online: 
    649         # search wikipedia asynchronously 
     649        # search Wikipedia asynchronously 
    650650        online.wikipediaSearchAsync(textInput, self.handleSearchResult, "wikipedia") 
    651651      else: 
  • modules/mod_showGPX.py

    r7d1b4b7 r7dc6e55  
    424424 
    425425      for path in availableTracklogs: 
    426         # dont override already set colors 
     426        # don't override already set colors 
    427427        if path not in visibleTracklogs.keys(): 
    428428          visibleTracklogs[path] = {'colorName' : self.getDistinctColorName()} 
  • modules/mod_showOSD.py

    r1d95585 r7dc6e55  
    4444 
    4545    # colors 
    46     self.widgetBackgroundColor = (0, 0, 1, 0.45) # trasparent blue 
     46    self.widgetBackgroundColor = (0, 0, 1, 0.45) # transparent blue 
    4747    self.widgetTextColor = (1, 1, 1, 0.95) # slightly transparent white 
    4848#    self.avail = set( 
     
    7373      if 'OSD' in config[mode]: 
    7474        items = config[mode]['OSD'] 
    75         # we dont know the nearest poin when refreshing the screen 
    76         # TODO: dont search for nearest point on every refresh ? 
     75        # we don't know the nearest point when refreshing the screen 
     76        # TODO: don't search for nearest point on every refresh ? 
    7777        self.nearestPoint = None 
    7878        self.nearestIndex = None 
     
    136136        return 
    137137      else: 
    138         if self.distanceList == None: # was the neerest point already determined ? 
     138        if self.distanceList == None: # was the nearest point already determined ? 
    139139          if self.findNearestPoint() == False: # False is returned if the nearest point can not be computed 
    140140            return 
     
    156156        return 
    157157      else: 
    158         if self.distanceList == None: # was the neerest point already determined ? 
     158        if self.distanceList == None: # was the nearest point already determined ? 
    159159          if self.findNearestPoint() == False: # False is returned if the nearest point can not be computed 
    160160            return 
     
    215215  def drawBackground(self, cr, x, y, w, h, source=None): 
    216216    cr.set_line_width(2) 
    217     cr.set_source_rgba(*self.widgetBackgroundColor) # trasparent blue 
     217    cr.set_source_rgba(*self.widgetBackgroundColor) # transparent blue 
    218218#    (rx,ry,rw,rh) = (x, y-h*1.4, w*1.2, (h*2)) 
    219219    (rx,ry,rw,rh) = (x, y, w*1.2, h*1.2) 
     
    223223  def drawBackgroundExact(self, cr, x, y, w, h, source=None): 
    224224    cr.set_line_width(2) 
    225     cr.set_source_rgba(*self.widgetBackgroundColor) # trasparent blue 
     225    cr.set_source_rgba(*self.widgetBackgroundColor) # transparent blue 
    226226    (rx,ry,rw,rh) = (x, y, w, h) 
    227227    cr.rectangle(rx,ry,rw,rh) # create the transparent background rectangle 
     
    231231    cr.set_source_rgba(*self.widgetTextColor) # slightly transparent white 
    232232    cr.move_to(x+10,y) 
    233     cr.show_text(text) # show the trasparent notification text 
     233    cr.show_text(text) # show the transparent notification text 
    234234    cr.stroke() 
    235235    cr.fill() 
     
    287287      segmentLength = float(item['segment_length']) 
    288288 
    289     if self.distanceList == None: # was the neerest point already determined ? 
     289    if self.distanceList == None: # was the nearest point already determined ? 
    290290      if self.findNearestPoint() == False: # False is returned if the nearest point can not be computed 
    291291        return 
  • modules/mod_showPOI.py

    r30bff6f1 r7dc6e55  
    100100          border = 2 
    101101          cr.set_line_width(2) 
    102           cr.set_source_rgba(0.1, 0.6, 0.1, 0.45) # trasparent blue 
     102          cr.set_source_rgba(0.1, 0.6, 0.1, 0.45) # transparent blue 
    103103          (rx,ry,rw,rh) = (x - border+12, y + border+h*0.2 + 6, w + 4*border, -(h*1.4)) 
    104104          cr.rectangle(rx,ry,rw,rh) # create the transparent background rectangle 
     
    116116 
    117117          # draw the actual text 
    118   #        cr.set_source_rgba(1, 1, 0, 0.95) # slightly trasparent white 
    119           cr.set_source_rgba(1, 1, 1, 0.95) # slightly trasparent white 
     118  #        cr.set_source_rgba(1, 1, 0, 0.95) # slightly transparent white 
     119          cr.set_source_rgba(1, 1, 1, 0.95) # slightly transparent white 
    120120          cr.move_to(x+15,y+7) 
    121           cr.show_text(text) # show the trasparent result caption 
     121          cr.show_text(text) # show the transparent result caption 
    122122          cr.stroke() 
    123123 
     
    156156            action = args[1] 
    157157          poiFromCategory = store.getAllPOIFromCategory(catId) 
    158           # convert the output to a listable menu comaptible state 
     158          # convert the output to a listable menu compatible state 
    159159          i = 0 
    160160          for item in poiFromCategory: 
     
    358358      self.activePOI.setLon(float(result)) 
    359359 
    360     # new  poi will be coomited at once, so we disable the autocommit 
    361     # also, the events are chained, so one netry box follows the other 
     360    # new  poi will be committed at once, so we disable the autocommit 
     361    # also, the events are chained, so one entry box follows the other 
    362362    elif key=='newName': 
    363363      self.activePOI.setName(result,commit=False) 
     
    373373      """final step: 
    374374      setup the category chooser menu, 
    375       and make sure the POI is commited after a cetegory is chosen 
     375      and make sure the POI is committed after acategory is chosen 
    376376      """ 
    377377      self._setupPOICategoryChooser('showPOI', 'setCatAndCommit') 
  • modules/mod_stats.py

    r30bff6f1 r7dc6e55  
    5656    speed = self.get('speed', None) 
    5757    if speed == None or speed<=self.minimalSpeed: 
    58       """we have no data, or the speed is below the treshold (we are not moving)""" 
     58      """we have no data, or the speed is below the threshold (we are not moving)""" 
    5959      return 
    6060 
  • modules/mod_storePOI.py

    r7d1b4b7 r7dc6e55  
    163163 
    164164  class POI: 
    165     """this class reperesents a POI""" 
     165    """this class represents a POI""" 
    166166    def __init__(self,callaback,label,description,lat,lon,catId,id=None): 
    167167      self.callback = callaback 
     
    331331      return points 
    332332    except Exception, e: 
    333       print "storePOI: loding POI from file failed:\n%s" % e 
     333      print "storePOI: loading POI from file failed:\n%s" % e 
    334334      return None 
    335335 
     
    433433 
    434434  def storePoint(self, point, returnToMenu=False): 
    435     """store a givne point to the POI database""" 
     435    """store a given point to the POI database""" 
    436436    # TODO: automatic saving without asking 
    437437    # * skip name entry 
     
    494494  """A basic class representing a POI. 
    495495     DEPRECIATED, use the new version in the main class 
    496      this is there only becuase it is needed for import of old POI""" 
     496     this is there only because it is needed for import of old POI""" 
    497497  def __init__(self, name, category, lat, lon): 
    498498    self.name = name 
  • modules/mod_tracklog.py

    r30bff6f1 r7dc6e55  
    3939    self.loggingPaused = False 
    4040    self.loggingStartTimestamp = None 
    41     self.logInterval = 1 #loggin interval in secconds 
    42     self.saveInterval = 10 #saving interval in secconds 
     41    self.logInterval = 1 #loggin interval in seconds 
     42    self.saveInterval = 10 #saving interval in seconds 
    4343    self.lastTimestamp = None 
    4444    self.lastSavedTimestamp = None 
     
    7171      if not self.loggingEnabled: 
    7272        self.loggingEnabled = True 
    73         print "initilizing the log file" 
     73        print "initializing the log file" 
    7474        self.initLog() 
    7575      # or resume an existing one 
     
    166166 
    167167  def initLog(self,type='gpx',name=None): 
    168     """start a new log, zero the apropriate variables, etc.""" 
     168    """start a new log, zero the appropriate variables, etc.""" 
    169169    self.loggingStartTimestamp = int(time.time()) 
    170170    self.maxSpeed = 0 
     
    267267 
    268268  def clean(self): 
    269     """zero unneaded datastructures after logging is stoped""" 
     269    """zero unneeded datastructures after logging is stopped""" 
    270270    self.currentLogGPX = None 
    271271    self.currentTempLog = None 
     
    482482      parentAction = 'set:menu:main' 
    483483 
    484       """this is a alist of button parameters, all buttons can be togglable 
     484      """this is a a list of button parameters, all buttons can be toggleable 
    485485      it is in this form: 
    486486      [list of string-lists for toggling, index of string-list to show] 
  • modules/mod_tracklogManager.py

    r30bff6f1 r7dc6e55  
    3636  def firstTime(self): 
    3737    self.LTModule = self.m.get('loadTracklogs', None) 
    38     # we dont know what tracklogs are awailable yet 
    39     # but we dont need that to setup the cathegories menu 
     38    # we don't know what tracklogs are available yet 
     39    # but we don't need that to setup the categories menu 
    4040    self.setupCathegoriesMenu() 
    4141 
     
    6666      print("tracklogManage: getting elevation info for active tracklog") 
    6767      activeTracklog = self.LTModule.getActiveTracklog() 
    68       # generate a list of (lat,lon) tupples 
     68      # generate a list of (lat,lon) tuples 
    6969      latLonList = map(lambda x: (x.latitude,x.longitude), activeTracklog.trackpointsList[0]) 
    7070      # look-up elevation data using Geonames asynchronously 
     
    133133 
    134134  def setupCathegoriesMenu(self): 
    135     # setup the cathegories menu 
     135    # setup the categories menu 
    136136 
    137137    menus = self.m.get("menu",None) 
     
    149149      menus.addItem(menu, text, icon, "set:currentTracCat:%s" % catId + nextAction) 
    150150 
    151     # setup the set cathegory menu 
     151    # setup the set category menu 
    152152    menu = 'tracklogSetCathegory' 
    153153    nextAction = '|tracklogManager:setActiveTracklogToCurrentCat|set:menu:tracklogManager#tracklogInfo' 
     
    171171      (w1,h1,dx,dy) = alloc 
    172172    else: 
    173       return # we arent the active menu so we dont do anything 
     173      return # we aren't the active menu so we don't do anything 
    174174 
    175175    if menuName == 'tracklogManagerCathegories': 
     
    233233      if track == None: 
    234234        """ there is no active tracklog, 
    235            so we dont draw the rest of the menu 
    236            we also dont setup the tools sub menu 
     235           so we don't draw the rest of the menu 
     236           we also don't setup the tools sub menu 
    237237           """ 
    238238        return 
  • modules/mod_turnByTurn.py

    rd3b35f3 r7dc6e55  
    1919# along with this program.  If not, see <http://www.gnu.org/licenses/>. 
    2020#--------------------------------------------------------------------------- 
     21from ScrolledText import example 
    2122from base_module import ranaModule 
    2223import geo 
     
    189190          if lh > usableHeight: # is the rendered text larger than the usable area ? 
    190191            clipHeight = 0 
    191             # find last completley visible line 
     192            # find last completely visible line 
    192193            cut = False 
    193194            for id in range(0,layout.get_line_count()-1): 
     
    213214              cutSide = bw/10 
    214215              menus.drawButton(cr, bx+bw, textEndY-cutSide/2.0, cutSide, cutSide, "", "center:scissors_right;0>%s" % background, "turnByTurn:showMessageInsideNotification") 
    215               #TODO: show the whole message in a notifications after clicking the scossors 
     216              #TODO: show the whole message in a notifications after clicking the scissors 
    216217              # (this needs line wrapping support in modRana notifications) 
    217218 
     
    249250 
    250251  def sayTurn(self,message,distanceInMeters,forceLanguageCode=False): 
    251     """say a text-to-spech message about a turn 
     252    """say a text-to-speach message about a turn 
    252253       this basically wraps the simple say method from voice and adds some more information, 
    253254       like current distance to the turn 
     
    267268 
    268269      """ the message can contain unicode, this might cause an exception when printing it 
    269       in some systems (SHR-u on Neo, for eaxmaple)""" 
     270      in some systems (SHR-u on Neo, for example)""" 
    270271      try: 
    271272        print "saying: %s" % text 
     
    351352 
    352353  def enabled(self): 
    353     """return True if enabled, false othervise""" 
     354    """return True if enabled, false otherwise""" 
    354355    if self.steps: 
    355356      return True 
     
    363364    self.goToInitialState() 
    364365 
    365     """NOTE: turn and step are used interchangably in the documentation""" 
     366    """NOTE: turn and step are used interchangeably in the documentation""" 
    366367    m = self.m.get('route', None) 
    367368    if m: 
     
    423424            """what is more distant, the closest or the next step ?""" 
    424425            if pos2nextStep < currentStep2nextStep: 
    425               """we are mosty probably already past the closest step, 
     426              """we are mostly probably already past the closest step, 
    426427              so we switch to the next step at once""" 
    427428              print "tbt: already past closest turn, switching to next turn" 
     
    429430              """we play the message for the next step, 
    430431              with current distance to this step, 
    431               to assure there is some voice output immediatelly after 
     432              to assure there is some voice output immediately after 
    432433              getting a new route or rerouting""" 
    433434              plaintextMessage = nextStep['descriptionEspeak'] 
     
    469470 
    470471  def locationUpdateCB(self, key, newValue, oldValue): 
    471     """position chnaged, do a tbt navigation update""" 
     472    """position changed, do a tbt navigation update""" 
    472473    if key == "locationUpdated": # just to be sure 
    473474      self.doNavigationUpdate() 
     
    499500    # GHK: make distance speed-sensitive 
    500501    # 
    501     # I came up with this formula after a lot of exerimentation with 
     502    # I came up with this formula after a lot of experimentation with 
    502503    # gnuplot.  The idea is to give the user some simple parameters to 
    503504    # adjust yet let him have a lot of control.  There are five 
     
    592593        if self.espeakFirstAndHalfTrigger == False and warnTime > 30: 
    593594          if currentDistance <= (20.0*metersPerSecSpeed): 
    594             """in case that the warning time gets too big, add an intemediate warning at 20 secconds 
     595            """in case that the warning time gets too big, add an intermediate warning at 20 seconds 
    595596            NOTE: this means it is said after the first trigger 
    596597            """ 
  • modules/mod_units.py

    r30bff6f1 r7dc6e55  
    2626 
    2727class units(ranaModule): 
    28   """A module handling unit conversions and dispplaying correct units acording to current settings.""" 
     28  """ 
     29  A module handling unit conversions and displaying correct units 
     30  according to current settings. 
     31  """ 
    2932   
    3033  mileInMeters = 1609.344 
     
    253256    """return 
    254257       True if the current speed is above the not moving threshodl, 
    255        False if below the treshodl 
     258       False if below the thresholds 
    256259       None if the current speed is unknown 
    257260       """ 
     
    261264      return (currentspeedKMH>self.notMovingspeed) 
    262265    else: 
    263       # signalise that we cant decite this 
     266      # signalise that we can't decide this 
    264267      return None 
    265268 
  • modules/mod_voice.py

    r30bff6f1 r7dc6e55  
    3434    ranaModule.__init__(self, m, d, i) 
    3535    self.espaekProcess = None 
    36     # this lock is used to make sure there is only one voice speking at once 
     36    # this lock is used to make sure there is only one voice speaking at once 
    3737    self.voiceLock = threading.Lock() 
    3838    # default espeak string for manual editing 
     
    8888 
    8989          """ the message can contain unicode, this might cause an exception when printing it 
    90           in some systems (SHR-u on Neo, for eaxmaple)""" 
     90          in some systems (SHR-u on Neo, for example)""" 
    9191          try: 
    9292            print "saying: %s" % output 
     
    9696            espeakLanguageCode = forceLanguageCode 
    9797          else: 
    98             # the espeak language code is the fisrt part of this whitespace delimited string 
     98            # the espeak language code is the first part of this whitespace delimited string 
    9999            espeakLanguageCode = self.get('directionsLanguage', 'en en').split(" ")[0] 
    100100          self._speak(espeakLanguageCode, output) 
     
    110110          collisionString+= "\nlanguage code: \n%s\nmessage text:\n%s" % (language,text) 
    111111          """ the message can contain unicode, this might cause an exception when printing it 
    112           in some systems (SHR-u on Neo, for eaxmaple)""" 
     112          in some systems (SHR-u on Neo, for example)""" 
    113113          try: 
    114114            print collisionString 
     
    130130      if voiceString != None: 
    131131 
    132         # replace langauge and message variables with appropriate values (if present) 
     132        # replace language and message variables with appropriate values (if present) 
    133133        voiceString = re.sub("%language%", languageCode, voiceString) 
    134134 
     
    138138         
    139139        """ the message can contain unicode, this might cause an exception when printing it 
    140         in some systems (SHR-u on Neo, for eaxmaple)""" 
     140        in some systems (SHR-u on Neo, for example)""" 
    141141        try: 
    142142          print "voice: resulting custom voice string:\n%s" % voiceString 
     
    155155      return subprocess.Popen(args, shell=shell) 
    156156    except TypeError: 
    157       print "voice: voice oduput failed - most probably due to the message containing unicode characters and your shell not properly supporting unicode" 
     157      print "voice: voice output failed - most probably due to the message containing unicode characters and your shell not properly supporting unicode" 
    158158      return None 
    159159 
     
    162162    """return True if there is voice output in progress, False if not""" 
    163163    if self.espaekProcess: # is there a espeak process 
    164       if self.espaekProcess.poll() != None: # none meens the process is still running 
     164      if self.espaekProcess.poll() != None: # none means the process is still running 
    165165        return False # not talking 
    166166      else: 
Note: See TracChangeset for help on using the changeset viewer.