Sophie

Sophie

distrib > Mageia > 6 > armv5tl > by-pkgid > cd0177250baee0d27d6edc1f6af440ec > files > 852

python-docs-2.7.15-1.2.mga6.noarch.rpm

<!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>38.5. MiniAEFrame — Open Scripting Architecture server support &#8212; Python 2.7.15 documentation</title>
    
    <link rel="stylesheet" href="../_static/classic.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.15',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true,
        SOURCELINK_SUFFIX: '.txt'
      };
    </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.15 documentation"
          href="../_static/opensearch.xml"/>
    <link rel="author" title="About these documents" href="../about.html" />
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="copyright" title="Copyright" href="../copyright.html" />
    <link rel="next" title="39. SGI IRIX Specific Services" href="sgi.html" />
    <link rel="prev" title="38.4. aetypes — AppleEvent objects" href="aetypes.html" />
    <link rel="shortcut icon" type="image/png" href="../_static/py.png" />
    <link rel="canonical" href="https://docs.python.org/2/library/miniaeframe.html" />
    <script type="text/javascript" src="../_static/copybutton.js"></script>
    
 
    

  </head>
  <body role="document">  
    <div class="related" role="navigation" aria-label="related navigation">
      <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="39. SGI IRIX Specific Services"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="aetypes.html" title="38.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="https://www.python.org/">Python</a> &#187;</li>
        <li>
          <a href="../index.html">Python 2.7.15 documentation</a> &#187;
        </li>

          <li class="nav-item nav-item-1"><a href="index.html" >The Python Standard Library</a> &#187;</li>
          <li class="nav-item nav-item-2"><a href="macosa.html" accesskey="U">38. MacPython OSA Modules</a> &#187;</li> 
      </ul>
    </div>    

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <div class="section" id="module-MiniAEFrame">
<span id="miniaeframe-open-scripting-architecture-server-support"></span><h1>38.5. <a class="reference internal" href="#module-MiniAEFrame" title="MiniAEFrame: Support to act as an Open Scripting Architecture (OSA) server (&quot;Apple Events&quot;). (Mac)"><code class="xref py py-mod docutils literal"><span class="pre">MiniAEFrame</span></code></a> &#8212; 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 (&quot;Apple Events&quot;). (Mac)"><code class="xref py py-mod docutils literal"><span class="pre">MiniAEFrame</span></code></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)"><code class="xref py py-mod docutils literal"><span class="pre">FrameWork</span></code></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 (&quot;Apple Events&quot;). (Mac)"><code class="xref py py-mod docutils literal"><span class="pre">MiniAEFrame</span></code></a> module defines the following classes:</p>
<dl class="class">
<dt id="MiniAEFrame.AEServer">
<em class="property">class </em><code class="descclassname">MiniAEFrame.</code><code class="descname">AEServer</code><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"><code class="xref py py-class docutils literal"><span class="pre">MiniApplication</span></code></a> or
<a class="reference internal" href="framework.html#FrameWork.Application" title="FrameWork.Application"><code class="xref py py-class docutils literal"><span class="pre">FrameWork.Application</span></code></a>. Your <a class="reference internal" href="../reference/datamodel.html#object.__init__" title="object.__init__"><code class="xref py py-meth docutils literal"><span class="pre">__init__()</span></code></a> method should call the
<a class="reference internal" href="../reference/datamodel.html#object.__init__" title="object.__init__"><code class="xref py py-meth docutils literal"><span class="pre">__init__()</span></code></a> method for both classes.</p>
</dd></dl>

<dl class="class">
<dt id="MiniAEFrame.MiniApplication">
<em class="property">class </em><code class="descclassname">MiniAEFrame.</code><code class="descname">MiniApplication</code><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"><code class="xref py py-class docutils literal"><span class="pre">FrameWork.Application</span></code></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"><code class="xref py py-class docutils literal"><span class="pre">AEServer</span></code></a> but does not provide
its own windows, etc.</p>
</dd></dl>

<div class="section" id="aeserver-objects">
<span id="id1"></span><h2>38.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">
<code class="descclassname">AEServer.</code><code class="descname">installaehandler</code><span class="sig-paren">(</span><em>classe</em>, <em>type</em>, <em>callback</em><span class="sig-paren">)</span><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, <code class="docutils literal"><span class="pre">'****'</span></code> 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">
<code class="descclassname">AEServer.</code><code class="descname">callback</code><span class="sig-paren">(</span><em>_object</em>, <em>**kwargs</em><span class="sig-paren">)</span><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:
<code class="docutils literal"><span class="pre">_class</span></code> and <code class="docutils literal"><span class="pre">_type</span></code> are the Class and Type designators and <code class="docutils literal"><span class="pre">_attributes</span></code>
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"><code class="xref py py-func docutils literal"><span class="pre">aetools.packevent()</span></code></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" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
  <h3><a href="../contents.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">38.5. <code class="docutils literal"><span class="pre">MiniAEFrame</span></code> &#8212; Open Scripting Architecture server support</a><ul>
<li><a class="reference internal" href="#aeserver-objects">38.5.1. AEServer Objects</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="aetypes.html"
                        title="previous chapter">38.4. <code class="docutils literal"><span class="pre">aetypes</span></code> &#8212; AppleEvent objects</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="sgi.html"
                        title="next chapter">39. 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="https://github.com/python/cpython/blob/2.7/Doc/library/miniaeframe.rst"
         rel="nofollow">Show Source</a>
  </li>
</ul>

<div id="searchbox" style="display: none" role="search">
  <h3>Quick search</h3>
    <form class="search" action="../search.html" method="get">
      <div><input type="text" name="q" /></div>
      <div><input type="submit" value="Go" /></div>
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>  
    <div class="related" role="navigation" aria-label="related navigation">
      <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="39. SGI IRIX Specific Services"
             >next</a> |</li>
        <li class="right" >
          <a href="aetypes.html" title="38.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="https://www.python.org/">Python</a> &#187;</li>
        <li>
          <a href="../index.html">Python 2.7.15 documentation</a> &#187;
        </li>

          <li class="nav-item nav-item-1"><a href="index.html" >The Python Standard Library</a> &#187;</li>
          <li class="nav-item nav-item-2"><a href="macosa.html" >38. MacPython OSA Modules</a> &#187;</li> 
      </ul>
    </div>  
    <div class="footer">
    &copy; <a href="../copyright.html">Copyright</a> 1990-2018, Python Software Foundation.
    <br />
    The Python Software Foundation is a non-profit corporation.
    <a href="https://www.python.org/psf/donations/">Please donate.</a>
    <br />
    Last updated on Apr 29, 2018.
    <a href="../bugs.html">Found a bug</a>?
    <br />
    Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.5.6.
    </div>

  </body>
</html>