Mercurial > my-enso-commands
comparison my-enso-commands.py @ 9:e5402ead0307
Added mute and unmute
| author | Atul Varma <varmaa@toolness.com> |
|---|---|
| date | Sat, 27 Mar 2010 14:14:30 -0700 |
| parents | 4285e37bea69 |
| children | 10e73bb57b01 |
comparison
equal
deleted
inserted
replaced
| 8:4285e37bea69 | 9:e5402ead0307 |
|---|---|
| 127 outputfile = StringIO() | 127 outputfile = StringIO() |
| 128 img.save(outputfile, "JPEG", quality=90) | 128 img.save(outputfile, "JPEG", quality=90) |
| 129 jpg_size = outputfile.tell() | 129 jpg_size = outputfile.tell() |
| 130 ensoapi.display_message("png size: %d bytes. jpg-90 size: %d bytes." % | 130 ensoapi.display_message("png size: %d bytes. jpg-90 size: %d bytes." % |
| 131 (png_size, jpg_size)) | 131 (png_size, jpg_size)) |
| 132 | |
| 133 def cmd_mute(ensoapi): | |
| 134 """mute the speaker.""" | |
| 135 | |
| 136 _runAppleScript('set volume output muted true') | |
| 137 ensoapi.display_message("Speaker muted.") | |
| 138 | |
| 139 def cmd_unmute(ensoapi): | |
| 140 """unmute the speaker.""" | |
| 141 | |
| 142 _runAppleScript('set volume output muted false') | |
| 143 ensoapi.display_message("Speaker unmuted.") | |
| 132 | 144 |
| 133 def cmd_unupload_image(ensoapi): | 145 def cmd_unupload_image(ensoapi): |
| 134 url = ensoapi.get_selection().get("text", "") | 146 url = ensoapi.get_selection().get("text", "") |
| 135 if url: | 147 if url: |
| 136 if url.startswith(REMOTE_UPLOAD_URL): | 148 if url.startswith(REMOTE_UPLOAD_URL): |
