source: vendor/python/2.5/Doc/mac/libminiae.tex

Last change on this file was 3225, checked in by bird, 18 years ago

Python 2.5

File size: 2.5 KB
Line 
1\section{\module{MiniAEFrame} ---
2 Open Scripting Architecture server support}
3
4\declaremodule{standard}{MiniAEFrame}
5 \platform{Mac}
6\modulesynopsis{Support to act as an Open Scripting Architecture (OSA) server
7(``Apple Events'').}
8
9
10The module \module{MiniAEFrame} provides a framework for an application
11that can function as an Open Scripting Architecture
12\index{Open Scripting Architecture}
13(OSA) server, i.e. receive and process
14AppleEvents\index{AppleEvents}. It can be used in conjunction with
15\refmodule{FrameWork}\refstmodindex{FrameWork} or standalone. As an
16example, it is used in \program{PythonCGISlave}.
17
18
19The \module{MiniAEFrame} module defines the following classes:
20
21
22\begin{classdesc}{AEServer}{}
23A class that handles AppleEvent dispatch. Your application should
24subclass this class together with either
25\class{MiniApplication} or
26\class{FrameWork.Application}. Your \method{__init__()} method should
27call the \method{__init__()} method for both classes.
28\end{classdesc}
29
30\begin{classdesc}{MiniApplication}{}
31A class that is more or less compatible with
32\class{FrameWork.Application} but with less functionality. Its
33event loop supports the apple menu, command-dot and AppleEvents; other
34events are passed on to the Python interpreter and/or Sioux.
35Useful if your application wants to use \class{AEServer} but does not
36provide its own windows, etc.
37\end{classdesc}
38
39
40\subsection{AEServer Objects \label{aeserver-objects}}
41
42\begin{methoddesc}[AEServer]{installaehandler}{classe, type, callback}
43Installs an AppleEvent handler. \var{classe} and \var{type} are the
44four-character OSA Class and Type designators, \code{'****'} wildcards
45are allowed. When a matching AppleEvent is received the parameters are
46decoded and your callback is invoked.
47\end{methoddesc}
48
49\begin{methoddesc}[AEServer]{callback}{_object, **kwargs}
50Your callback is called with the OSA Direct Object as first positional
51parameter. The other parameters are passed as keyword arguments, with
52the 4-character designator as name. Three extra keyword parameters are
53passed: \code{_class} and \code{_type} are the Class and Type
54designators and \code{_attributes} is a dictionary with the AppleEvent
55attributes.
56
57The return value of your method is packed with
58\function{aetools.packevent()} and sent as reply.
59\end{methoddesc}
60
61Note that there are some serious problems with the current
62design. AppleEvents which have non-identifier 4-character designators
63for arguments are not implementable, and it is not possible to return
64an error to the originator. This will be addressed in a future
65release.
Note: See TracBrowser for help on using the repository browser.