Kaydet (Commit) ac8657bb authored tarafından Just van Rossum's avatar Just van Rossum

some old changes to this unused module

üst 35b50e26
......@@ -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__":
......
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