This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| stations = {} | |
| def station(name) : | |
| try : | |
| station = stations[name] | |
| return station | |
| except : | |
| station_item = menu.item(name) | |
| url = station_item.getAttribute("url") | |
| refresh = station_item.getAttribute("refresh") | |
| station = Weather(name,url,refresh) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def mark_ids(node) : | |
| """ mark id attributes as IDs so that getElementById() works | |
| """ | |
| try: | |
| node.setIdAttribute("id") | |
| except: | |
| pass | |
| for child in node.childNodes : |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python | |
| import time | |
| import speak | |
| while True : | |
| message = "The Raspberry Pi time is " + speak.escape_XML(speak.ssml_break(500)) + time.strftime('%I %M %p') | |
| speak.say(message) | |
| time.sleep(60) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python | |
| import speak | |
| import presenter | |
| for key in presenter.read_key() : | |
| print key | |
| speak.say(key) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python | |
| import sys | |
| import tty | |
| def read_key() : | |
| tty.setcbreak(sys.stdin) | |
| last = 0 | |
| while True : | |
| code = ord(sys.stdin.read(1)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python | |
| import time | |
| import speak | |
| while True : | |
| message = "The Raspberry Pi time is " + speak.escape_XML(speak.ssml_break(500)) + time.strftime('%I %M %p') | |
| speak.say(message) | |
| time.sleep(60) |