korsygfhrtzangaiide
Elepffwdsff
/
usr
/
share
/
doc
/
python-docs-2.7.5
/
html
/
library
/
Upload FileeE
HOME
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>37.5. MiniAEFrame — Open Scripting Architecture server support — Python 2.7.5 documentation</title> <link rel="stylesheet" href="../_static/default.css" type="text/css" /> <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> <script type="text/javascript"> var DOCUMENTATION_OPTIONS = { URL_ROOT: '../', VERSION: '2.7.5', COLLAPSE_INDEX: false, FILE_SUFFIX: '.html', HAS_SOURCE: true }; </script> <script type="text/javascript" src="../_static/jquery.js"></script> <script type="text/javascript" src="../_static/underscore.js"></script> <script type="text/javascript" src="../_static/doctools.js"></script> <script type="text/javascript" src="../_static/sidebar.js"></script> <link rel="search" type="application/opensearchdescription+xml" title="Search within Python 2.7.5 documentation" href="../_static/opensearch.xml"/> <link rel="author" title="About these documents" href="../about.html" /> <link rel="copyright" title="Copyright" href="../copyright.html" /> <link rel="top" title="Python 2.7.5 documentation" href="../index.html" /> <link rel="up" title="37. MacPython OSA Modules" href="macosa.html" /> <link rel="next" title="38. SGI IRIX Specific Services" href="sgi.html" /> <link rel="prev" title="37.4. aetypes — AppleEvent objects" href="aetypes.html" /> <link rel="shortcut icon" type="image/png" href="../_static/py.png" /> <script type="text/javascript" src="../_static/copybutton.js"></script> </head> <body> <div class="related"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="../genindex.html" title="General Index" accesskey="I">index</a></li> <li class="right" > <a href="../py-modindex.html" title="Python Module Index" >modules</a> |</li> <li class="right" > <a href="sgi.html" title="38. SGI IRIX Specific Services" accesskey="N">next</a> |</li> <li class="right" > <a href="aetypes.html" title="37.4. aetypes — AppleEvent objects" accesskey="P">previous</a> |</li> <li><img src="../_static/py.png" alt="" style="vertical-align: middle; margin-top: -1px"/></li> <li><a href="http://www.python.org/">Python</a> »</li> <li> <a href="../index.html">Python 2.7.5 documentation</a> » </li> <li><a href="index.html" >The Python Standard Library</a> »</li> <li><a href="macosa.html" accesskey="U">37. MacPython OSA Modules</a> »</li> </ul> </div> <div class="document"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body"> <div class="section" id="module-MiniAEFrame"> <span id="miniaeframe-open-scripting-architecture-server-support"></span><h1>37.5. <a class="reference internal" href="#module-MiniAEFrame" title="MiniAEFrame: Support to act as an Open Scripting Architecture (OSA) server ("Apple Events"). (Mac)"><tt class="xref py py-mod docutils literal"><span class="pre">MiniAEFrame</span></tt></a> — Open Scripting Architecture server support<a class="headerlink" href="#module-MiniAEFrame" title="Permalink to this headline">¶</a></h1> <p id="index-0">The module <a class="reference internal" href="#module-MiniAEFrame" title="MiniAEFrame: Support to act as an Open Scripting Architecture (OSA) server ("Apple Events"). (Mac)"><tt class="xref py py-mod docutils literal"><span class="pre">MiniAEFrame</span></tt></a> provides a framework for an application that can function as an Open Scripting Architecture (OSA) server, i.e. receive and process AppleEvents. It can be used in conjunction with <a class="reference internal" href="framework.html#module-FrameWork" title="FrameWork: Interactive application framework. (deprecated) (Mac)"><tt class="xref py py-mod docutils literal"><span class="pre">FrameWork</span></tt></a> or standalone. As an example, it is used in <strong class="program">PythonCGISlave</strong>.</p> <p>The <a class="reference internal" href="#module-MiniAEFrame" title="MiniAEFrame: Support to act as an Open Scripting Architecture (OSA) server ("Apple Events"). (Mac)"><tt class="xref py py-mod docutils literal"><span class="pre">MiniAEFrame</span></tt></a> module defines the following classes:</p> <dl class="class"> <dt id="MiniAEFrame.AEServer"> <em class="property">class </em><tt class="descclassname">MiniAEFrame.</tt><tt class="descname">AEServer</tt><a class="headerlink" href="#MiniAEFrame.AEServer" title="Permalink to this definition">¶</a></dt> <dd><p>A class that handles AppleEvent dispatch. Your application should subclass this class together with either <a class="reference internal" href="#MiniAEFrame.MiniApplication" title="MiniAEFrame.MiniApplication"><tt class="xref py py-class docutils literal"><span class="pre">MiniApplication</span></tt></a> or <a class="reference internal" href="framework.html#FrameWork.Application" title="FrameWork.Application"><tt class="xref py py-class docutils literal"><span class="pre">FrameWork.Application</span></tt></a>. Your <a class="reference internal" href="../reference/datamodel.html#object.__init__" title="object.__init__"><tt class="xref py py-meth docutils literal"><span class="pre">__init__()</span></tt></a> method should call the <a class="reference internal" href="../reference/datamodel.html#object.__init__" title="object.__init__"><tt class="xref py py-meth docutils literal"><span class="pre">__init__()</span></tt></a> method for both classes.</p> </dd></dl> <dl class="class"> <dt id="MiniAEFrame.MiniApplication"> <em class="property">class </em><tt class="descclassname">MiniAEFrame.</tt><tt class="descname">MiniApplication</tt><a class="headerlink" href="#MiniAEFrame.MiniApplication" title="Permalink to this definition">¶</a></dt> <dd><p>A class that is more or less compatible with <a class="reference internal" href="framework.html#FrameWork.Application" title="FrameWork.Application"><tt class="xref py py-class docutils literal"><span class="pre">FrameWork.Application</span></tt></a> but with less functionality. Its event loop supports the apple menu, command-dot and AppleEvents; other events are passed on to the Python interpreter and/or Sioux. Useful if your application wants to use <a class="reference internal" href="#MiniAEFrame.AEServer" title="MiniAEFrame.AEServer"><tt class="xref py py-class docutils literal"><span class="pre">AEServer</span></tt></a> but does not provide its own windows, etc.</p> </dd></dl> <div class="section" id="aeserver-objects"> <span id="id1"></span><h2>37.5.1. AEServer Objects<a class="headerlink" href="#aeserver-objects" title="Permalink to this headline">¶</a></h2> <dl class="method"> <dt id="MiniAEFrame.AEServer.installaehandler"> <tt class="descclassname">AEServer.</tt><tt class="descname">installaehandler</tt><big>(</big><em>classe</em>, <em>type</em>, <em>callback</em><big>)</big><a class="headerlink" href="#MiniAEFrame.AEServer.installaehandler" title="Permalink to this definition">¶</a></dt> <dd><p>Installs an AppleEvent handler. <em>classe</em> and <em>type</em> are the four-character OSA Class and Type designators, <tt class="docutils literal"><span class="pre">'****'</span></tt> wildcards are allowed. When a matching AppleEvent is received the parameters are decoded and your callback is invoked.</p> </dd></dl> <dl class="method"> <dt id="MiniAEFrame.AEServer.callback"> <tt class="descclassname">AEServer.</tt><tt class="descname">callback</tt><big>(</big><em>_object</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#MiniAEFrame.AEServer.callback" title="Permalink to this definition">¶</a></dt> <dd><p>Your callback is called with the OSA Direct Object as first positional parameter. The other parameters are passed as keyword arguments, with the 4-character designator as name. Three extra keyword parameters are passed: <tt class="docutils literal"><span class="pre">_class</span></tt> and <tt class="docutils literal"><span class="pre">_type</span></tt> are the Class and Type designators and <tt class="docutils literal"><span class="pre">_attributes</span></tt> is a dictionary with the AppleEvent attributes.</p> <p>The return value of your method is packed with <a class="reference internal" href="aetools.html#aetools.packevent" title="aetools.packevent"><tt class="xref py py-func docutils literal"><span class="pre">aetools.packevent()</span></tt></a> and sent as reply.</p> </dd></dl> <p>Note that there are some serious problems with the current design. AppleEvents which have non-identifier 4-character designators for arguments are not implementable, and it is not possible to return an error to the originator. This will be addressed in a future release.</p> </div> </div> </div> </div> </div> <div class="sphinxsidebar"> <div class="sphinxsidebarwrapper"> <h3><a href="../contents.html">Table Of Contents</a></h3> <ul> <li><a class="reference internal" href="#">37.5. <tt class="docutils literal"><span class="pre">MiniAEFrame</span></tt> — Open Scripting Architecture server support</a><ul> <li><a class="reference internal" href="#aeserver-objects">37.5.1. AEServer Objects</a></li> </ul> </li> </ul> <h4>Previous topic</h4> <p class="topless"><a href="aetypes.html" title="previous chapter">37.4. <tt class="docutils literal"><span class="pre">aetypes</span></tt> — AppleEvent objects</a></p> <h4>Next topic</h4> <p class="topless"><a href="sgi.html" title="next chapter">38. SGI IRIX Specific Services</a></p> <h3>This Page</h3> <ul class="this-page-menu"> <li><a href="../bugs.html">Report a Bug</a></li> <li><a href="../_sources/library/miniaeframe.txt" rel="nofollow">Show Source</a></li> </ul> <div id="searchbox" style="display: none"> <h3>Quick search</h3> <form class="search" action="../search.html" method="get"> <input type="text" name="q" /> <input type="submit" value="Go" /> <input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="area" value="default" /> </form> <p class="searchtip" style="font-size: 90%"> Enter search terms or a module, class or function name. </p> </div> <script type="text/javascript">$('#searchbox').show(0);</script> </div> </div> <div class="clearer"></div> </div> <div class="related"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="../genindex.html" title="General Index" >index</a></li> <li class="right" > <a href="../py-modindex.html" title="Python Module Index" >modules</a> |</li> <li class="right" > <a href="sgi.html" title="38. SGI IRIX Specific Services" >next</a> |</li> <li class="right" > <a href="aetypes.html" title="37.4. aetypes — AppleEvent objects" >previous</a> |</li> <li><img src="../_static/py.png" alt="" style="vertical-align: middle; margin-top: -1px"/></li> <li><a href="http://www.python.org/">Python</a> »</li> <li> <a href="../index.html">Python 2.7.5 documentation</a> » </li> <li><a href="index.html" >The Python Standard Library</a> »</li> <li><a href="macosa.html" >37. MacPython OSA Modules</a> »</li> </ul> </div> <div class="footer"> © <a href="../copyright.html">Copyright</a> 1990-2019, Python Software Foundation. <br /> The Python Software Foundation is a non-profit corporation. <a href="http://www.python.org/psf/donations/">Please donate.</a> <br /> Last updated on Jul 03, 2019. <a href="../bugs.html">Found a bug</a>? <br /> Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3. </div> </body> </html>