From ac8657bb0e2c461a641af323b6df243511800715 Mon Sep 17 00:00:00 2001 From: Just van Rossum Date: Sat, 21 Jun 2003 14:49:14 +0000 Subject: some old changes to this unused module --- Lib/plat-mac/terminalcommand.py | 19 ++++++------------- 1 file 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__": -- cgit v0.12