[Pythonmac-SIG] package structure for OSA interfaces

Michael J. Barber mjb@uma.pt
Wed, 23 Jan 2002 11:01:14 +0000


On Tuesday, January 22, 2002, at 11:17  PM, Jack Jansen wrote:

>
> I'm about to check this stuff in. I've made two minor changes to your 
> module (adding a reopen() call and changing the _code), and I've 
> restructured things slightly: this module is now called builtin_Suite 
> in a package _builtinSuites, with a handwritten __init__ module that 
> maps both 'core' and 'reqd' to builtin_Suite. The advantage of this is 
> that no magic is needed in gensuitemodule: builtinSuites is now simply 
> the base package for StdSuites (as StdSuites is for all other suites).
>
Good, I'm glad to hear that my module was a useful starting point.

Let me just summarize a bit. As I understand it, the current status is:

1) No changes are needed in gensuitemodule.

2) Generating an OSA interface package is done using gensuitemodule 
exactly as before.

3) The package will have the four required events, whether the 
application defines them in Standard Suite, Required Suite, or not at 
all.

4) StdSuites can still be generated using gensuitemodule, but we now 
need to select builtinSuites as the base package instead of hitting 
cancel. (I'll change the documentation if this is correct.)

5) The subtle problem with multiple inheritance that you pointed out is 
fixed for Python 2.2+, and still very unlikely in earlier versions.

I'm not totally certain about point 5, actually. I would expect that 
generating StdSuites using gensuitemodule would define the required 
events in StdSuites.Standard_Suite, much in the way that apps can 
override Standard Suite events in their own dictionaries. If that is so, 
the new inheritance rule wouldn't help us without some change to 
gensuitemodule (which probably just consists of checking the name of the 
base package and filtering out the required events if we're inheriting 
from builtinSuites instead of StdSuites).

One more thing. There is a comment in gensuitemodule asking about a list 
of python keywords. Using 'help' from pydoc, they are: ["and", "elif", 
"global", "or", "assert", "else", "if", "pass", "break", "except", 
"import", "print", "class", "exec", "in", "raise", "continue", 
"finally", "is", "return", "def", "for", "lambda", "try", "del", "from", 
"not", "while"]. Some of them are pretty unlikely as AppleScript verbs, 
of course!

Michael