[Pythonmac-SIG] AE quit() ?

Vincent Marchetti vincem@en.com
Tue, 23 Oct 2001 21:19:15 -0400


-- 
Alexandre Parenteau wrote that the following doesn't work, in attempting to send AppleEvents to 
the CodeWarrior application:

import CodeWarrior
shell = CodeWarrior.CodeWarrior('CWIE', 1)
shell.quit()

giving an error indicating that shell has no 'quit' attribute.

I think this is a result of ambiguous or incomplete "inheritance" rules in the aete dictionaries defining an applications OSA interface. The 'quit' event is supposed to be defined in the "Required Events" Suite (along with open, run, print. It isn't; though; it could also be defined in Standard Events; but it isn't defined there either; and since CodeWarrior; along with any app that uses PowerPlant,defines a non-standard identifier for the Standard Events (CoRe instead of core) the StdSuite.Standard_Suite module events are not being imported.

The quickest solution, I think , is to go into the StdSuite package, module Standard_Suite.py; copy the quit method from the class Standard_Suite_Events; and paste it right into the CodeWarrior class in the __init__ module for the CodeWarrior package.


Vince Marchetti