def clean(self) : mtext = removeLinks.sub(" ",self.text) mtext = mtext.replace("#"," ") mtext = mtext.replace("@"," ") mtext = mtext.replace("'","") mtext = speak.expand(mtext,replacements) self.cleanText = mtext
def visit(item) : action = item.getAttribute('action') if action == "" : text = item.getAttribute('title') else : text = eval(action) say_text = speak.expand(text,Weather.substitutes) print text speak.say(say_text)
def visit(item): action = item.getAttribute('action') if action == "": text = item.getAttribute('title') else: text = eval(action) if text is not None: mtext = speak.expand(text, speak.tracker_substitutes) speak.say(mtext, c.menu_voice, c.menu_speed) print(text)
def visit(item) : action = item.getAttribute('action') if action == "" : text = item.getAttribute('title') else : text = eval(action) if text is not None : mtext = speak.expand(text,speak.tracker_substitutes) speak.say(mtext,c.menu_voice,c.menu_speed) print (text)
"expected time of arrival" ]) if c.talk_status == "off": Switch("talk_sw").toggle() while True: if get("talk_sw").on: mode = get("talk_mode").value if mode == "location": string = get("gps").location elif mode == "velocity": string = get("gps").velocity elif mode == "relative location": destination = get("route").current_waypoint string = destination.relative_location elif mode == "relative velocity": destination = get("route").current_waypoint string = destination.relative_velocity elif mode == "expected time of arrival": destination = get("route").current_waypoint string = destination.eta elif mode == "time": string = date_time.say_time() else: pass mstring = speak.expand(string, speak.tracker_substitutes) speak.say(mstring, c.talk_voice) print string time.sleep(get("talk_rate").value)
Switch("talk_sw") Option("talk_mode",["location","velocity","time","relative location","relative velocity","expected time of arrival"]) if c.talk_status == "off" : Switch("talk_sw").toggle() while True : if get("talk_sw").on : mode = get("talk_mode").value if mode == "location" : string = get("gps").location elif mode== "velocity" : string = get("gps").velocity elif mode == "relative location" : destination = get("route").current_waypoint string = destination.relative_location elif mode == "relative velocity" : destination = get("route").current_waypoint string = destination.relative_velocity elif mode == "expected time of arrival" : destination = get("route").current_waypoint string = destination.eta elif mode == "time" : string = date_time.say_time() else : pass mstring = speak.expand(string,speak.tracker_substitutes) speak.say(mstring,c.talk_voice) print string time.sleep(get("talk_rate").value)
import xmlutils import control from persistant import get import position substitutes = { "W":"West","N":"North","S":"South","E":"East", "km/h":"kilometers per hour","C":"Celsius","mph":"miles per hours", "kts": "knots", "Mon":"Monday","Tue":"Tuesday","Wed":"Wednesday","Thu":"Thursday","Fri":"Friday","Sat":"Saturday","Sun":"Sunday", "NNE":"Nor Nor East","NE":"Nor East","ENE":"East Nor East","ESE":"East Sow East", "SE":"Sow East" ,"SSE" :"Sow Sow East", "SSW":"Sow Sow West","SW":"Sow West","WSW":"West Sow West", "WNW":"West Nor West","NW":"Nor West","NNW":"Nor Nor West", "%":"percent" } control.Control("speed",step=10,initial=60) while True : if get("speed").on : position = get("gps") speed = round(conv.convert(position.speedOverGround,"kt","mph"),1) course = int(position.courseOverGround) points = conv.degree_to_compass_point(course) text = points + " at " + str(speed) + " mph " mtext = speak.expand(text,substitutes) speak.say(mtext) print(text) time.sleep(get("speed").value)