Commit ac8657bb authored by Just van Rossum's avatar Just van Rossum

some old changes to this unused module

parent 35b50e26
...@@ -28,25 +28,18 @@ SEND_MODE = kAENoReply # kAEWaitReply hangs when run from Terminal.app itself ...@@ -28,25 +28,18 @@ SEND_MODE = kAENoReply # kAEWaitReply hangs when run from Terminal.app itself
def run(command): def run(command):
"""Run a shell command in a new Terminal.app window.""" """Run a shell command in a new Terminal.app window."""
termAddress = AE.AECreateDesc(typeApplSignature, TERMINAL_SIG) termAddress = AE.AECreateDesc(typeApplSignature, TERMINAL_SIG)
theEvent = AE.AECreateAppleEvent(kAEMiscStandards, kAEActivate, theEvent = AE.AECreateAppleEvent(kAECoreSuite, kAEDoScript, termAddress,
termAddress, kAutoGenerateReturnID, kAutoGenerateReturnID, kAnyTransactionID)
kAnyTransactionID) commandDesc = AE.AECreateDesc(typeChar, command)
theEvent.AEPutParamDesc(kAECommandClass, commandDesc)
try: try:
theEvent.AESend(SEND_MODE, kAENormalPriority, theEvent.AESend(SEND_MODE, kAENormalPriority, kAEDefaultTimeout)
kAEDefaultTimeout)
except AE.Error, why: except AE.Error, why:
if why[0] != -600: # Terminal.app not yet running if why[0] != -600: # Terminal.app not yet running
raise raise
os.system(START_TERMINAL) os.system(START_TERMINAL)
time.sleep(1) 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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment