# HG changeset patch # User Atul Varma # Date 1211096642 25200 # Node ID 9767abfe290ba5527c6a6ff77f619200e4a77d2a # Parent c28ae8f664bacaebea12c56d7f3b9aebbdf8529a Added more service-oriented commands. diff -r c28ae8f664ba -r 9767abfe290b my-enso-commands.py --- a/my-enso-commands.py Sun May 18 00:31:26 2008 -0700 +++ b/my-enso-commands.py Sun May 18 00:44:02 2008 -0700 @@ -10,11 +10,9 @@ import logging from StringIO import StringIO -def cmd_define(ensoapi): +def _do_service(ensoapi, serviceName): import AppKit - serviceName = "Look Up in Dictionary" - text = ensoapi.get_selection().get("text", "").strip() if not text: @@ -34,6 +32,18 @@ finally: pass +def cmd_define(ensoapi): + _do_service(ensoapi, "Look Up in Dictionary") + +def cmd_speak(ensoapi): + _do_service(ensoapi, "Speech/Start Speaking Text") + +def cmd_summarize(ensoapi): + _do_service(ensoapi, "Summarize") + +def cmd_spotlight(ensoapi): + _do_service(ensoapi, "Spotlight") + def cmd_count_lines(ensoapi): seldict = ensoapi.get_selection() ensoapi.display_message( "Selection is %s lines." %