[orca-list] Orca Time Script

I have attempted to addapt slightly the time and date script from the Orca FAQ.  I broke it.  I am not sure how.  I added some comments, changed the keybinding to Orca-t instead of Orca-d and made it only speak the time in 12 hour format instead of 24 hour format with AM or PM afterwards.  I placed the file in my ~/.orca/orca-scripts directory with the name timekey.py
The problem is, when I proess Orca-t and/or Orca-d, nothing happens.  Here's the code, can someone please tell me what is wrong with it?  Thanks for the help.
PS  Please take a look at my comments in the code and make sure that I know what I am talking about. :)

"""This script adds time functionality to Orca
Adapted by Storm Dragon from the script posted at:
feel free to modify and/or redistribute this script as you see fit."""
#import gets code that has already been written.
#think of it as using wheels instead of trying to reinvent them.
import orca.input_event # watches for input that Orca recognizes
import orca.keybindings # Handles binding keystrokes for Orca to use.
import orca.orca # Imports the main screen reader
import orca.speech # Handles Orca's speaking abilities
import orca.braille # Displays information in Braille format
import re # Not sure

myKeyBindings = orca.keybindings.KeyBindings()

#Define the sayTime function
def sayTime(script, inputEvent=None):
    import time # imports the Python time library
    message = time.strftime("%I:%M%p", time.localtime())
    return True
#end sayTime function

sayTimeHandler = orca.input_event.InputEventHandler(
    "Presents the time.") # Shows the function of the key press in learn mode

    1 << orca.settings.MODIFIER_ORCA,
    1 << orca.settings.MODIFIER_ORCA,
    sayTimeHandler)) # Sets Orca-t as the say time key

orca.settings.keyBindingsMap["default"] = myKeyBindings

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]