Mercurial > my-enso-commands
changeset 3:9767abfe290b
Added more service-oriented commands.
author | Atul Varma <varmaa@toolness.com> |
---|---|
date | Sun, 18 May 2008 00:44:02 -0700 |
parents | c28ae8f664ba |
children | 141cd4e612bb |
files | my-enso-commands.py |
diffstat | 1 files changed, 13 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- 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." %