summaryrefslogtreecommitdiffstats
path: root/Lib/plat-mac
diff options
context:
space:
mode:
authorJust van Rossum <just@letterror.com>2003-06-21 14:49:14 (GMT)
committerJust van Rossum <just@letterror.com>2003-06-21 14:49:14 (GMT)
commitac8657bb0e2c461a641af323b6df243511800715 (patch)
tree9934e3446d33771d514813ff6bbbba4bc2a69bed /Lib/plat-mac
parent35b50e268372bf1fb38472dfe758447a20792d1b (diff)
downloadcpython-ac8657bb0e2c461a641af323b6df243511800715.zip
cpython-ac8657bb0e2c461a641af323b6df243511800715.tar.gz
cpython-ac8657bb0e2c461a641af323b6df243511800715.tar.bz2
some old changes to this unused module
Diffstat (limited to 'Lib/plat-mac')
-rw-r--r--Lib/plat-mac/terminalcommand.py19
1 files changed, 6 insertions, 13 deletions
diff --git a/Lib/plat-mac/terminalcommand.py b/Lib/plat-mac/terminalcommand.py
index 835a644..292f09c 100644
--- a/Lib/plat-mac/terminalcommand.py
+++ b/Lib/plat-mac/terminalcommand.py
@@ -28,26 +28,19 @@ SEND_MODE = kAENoReply # kAEWaitReply hangs when run from Terminal.app itself
def run(command):
"""Run a shell command in a new Terminal.app window."""
termAddress = AE.AECreateDesc(typeApplSignature, TERMINAL_SIG)
- theEvent = AE.AECreateAppleEvent(kAEMiscStandards, kAEActivate,
- termAddress, kAutoGenerateReturnID,
- kAnyTransactionID)
+ theEvent = AE.AECreateAppleEvent(kAECoreSuite, kAEDoScript, termAddress,
+ kAutoGenerateReturnID, kAnyTransactionID)
+ commandDesc = AE.AECreateDesc(typeChar, command)
+ theEvent.AEPutParamDesc(kAECommandClass, commandDesc)
try:
- theEvent.AESend(SEND_MODE, kAENormalPriority,
- kAEDefaultTimeout)
+ theEvent.AESend(SEND_MODE, kAENormalPriority, kAEDefaultTimeout)
except AE.Error, why:
if why[0] != -600: # Terminal.app not yet running
raise
os.system(START_TERMINAL)
time.sleep(1)
- theEvent.AESend(SEND_MODE, kAENormalPriority,
- kAEDefaultTimeout)
-
- theEvent = AE.AECreateAppleEvent(kAECoreSuite, kAEDoScript, termAddress,
- kAutoGenerateReturnID, kAnyTransactionID)
- commandDesc = AE.AECreateDesc(typeChar, command)
- theEvent.AEPutParamDesc(kAECommandClass, commandDesc)
- theEvent.AESend(SEND_MODE, kAENormalPriority, kAEDefaultTimeout)
+ theEvent.AESend(SEND_MODE, kAENormalPriority, kAEDefaultTimeout)
if __name__ == "__main__":