Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > c3732731228538f6126cae930c10ad71 > files > 174

python-pyro4-4.21-3.mga4.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>Pyro4.core — core Pyro logic &mdash; Pyro 4.21 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:     '4.21',
        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>
    <link rel="top" title="Pyro 4.21 documentation" href="../index.html" />
    <link rel="up" title="Pyro4 library API" href="../api.html" />
    <link rel="next" title="Pyro4.naming — Pyro name server" href="naming.html" />
    <link rel="prev" title="Pyro4 — Main API package" href="main.html" /> 
  </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="naming.html" title="Pyro4.naming — Pyro name server"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="main.html" title="Pyro4 — Main API package"
             accesskey="P">previous</a> |</li>
        <li><a href="../index.html">Pyro 4.21 documentation</a> &raquo;</li>
          <li><a href="../api.html" accesskey="U">Pyro4 library API</a> &raquo;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="module-Pyro4.core">
<span id="pyro4-core-core-pyro-logic"></span><h1><a class="reference internal" href="#module-Pyro4.core" title="Pyro4.core"><tt class="xref py py-mod docutils literal"><span class="pre">Pyro4.core</span></tt></a> &#8212; core Pyro logic<a class="headerlink" href="#module-Pyro4.core" title="Permalink to this headline">¶</a></h1>
<p>Core logic (uri, daemon, proxy stuff).</p>
<dl class="class">
<dt id="Pyro4.core.URI">
<em class="property">class </em><tt class="descclassname">Pyro4.core.</tt><tt class="descname">URI</tt><big>(</big><em>uri</em><big>)</big><a class="headerlink" href="#Pyro4.core.URI" title="Permalink to this definition">¶</a></dt>
<dd><p>Pyro object URI (universal resource identifier).
The uri format is like this: <tt class="docutils literal"><span class="pre">PYRO:objectid&#64;location</span></tt> where location is one of:</p>
<ul class="simple">
<li><tt class="docutils literal"><span class="pre">hostname:port</span></tt> (tcp/ip socket on given port)</li>
<li><tt class="docutils literal"><span class="pre">./u:sockname</span></tt> (Unix domain socket on localhost)</li>
</ul>
<dl class="docutils">
<dt>There is also a &#8216;Magic format&#8217; for simple name resolution using Name server:</dt>
<dd><tt class="docutils literal"><span class="pre">PYRONAME:objectname[&#64;location]</span></tt>  (optional name server location, can also omit location port)</dd>
</dl>
<dl class="method">
<dt id="Pyro4.core.URI.asString">
<tt class="descname">asString</tt><big>(</big><big>)</big><a class="headerlink" href="#Pyro4.core.URI.asString" title="Permalink to this definition">¶</a></dt>
<dd><p>the string representation of this object</p>
</dd></dl>

<dl class="staticmethod">
<dt id="Pyro4.core.URI.isUnixsockLocation">
<em class="property">static </em><tt class="descname">isUnixsockLocation</tt><big>(</big><em>location</em><big>)</big><a class="headerlink" href="#Pyro4.core.URI.isUnixsockLocation" title="Permalink to this definition">¶</a></dt>
<dd><p>determine if a location string is for a Unix domain socket</p>
</dd></dl>

<dl class="attribute">
<dt id="Pyro4.core.URI.location">
<tt class="descname">location</tt><a class="headerlink" href="#Pyro4.core.URI.location" title="Permalink to this definition">¶</a></dt>
<dd><p>property containing the location string, for instance <tt class="docutils literal"><span class="pre">&quot;servername.you.com:5555&quot;</span></tt></p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="Pyro4.core.Daemon">
<em class="property">class </em><tt class="descclassname">Pyro4.core.</tt><tt class="descname">Daemon</tt><big>(</big><em>host=None</em>, <em>port=0</em>, <em>unixsocket=None</em>, <em>nathost=None</em>, <em>natport=None</em><big>)</big><a class="headerlink" href="#Pyro4.core.Daemon" title="Permalink to this definition">¶</a></dt>
<dd><p>Pyro daemon. Contains server side logic and dispatches incoming remote method calls
to the appropriate objects.</p>
<dl class="method">
<dt id="Pyro4.core.Daemon.close">
<tt class="descname">close</tt><big>(</big><big>)</big><a class="headerlink" href="#Pyro4.core.Daemon.close" title="Permalink to this definition">¶</a></dt>
<dd><p>Close down the server and release resources</p>
</dd></dl>

<dl class="method">
<dt id="Pyro4.core.Daemon.events">
<tt class="descname">events</tt><big>(</big><em>eventsockets</em><big>)</big><a class="headerlink" href="#Pyro4.core.Daemon.events" title="Permalink to this definition">¶</a></dt>
<dd><p>for use in an external event loop: handle any requests that are pending for this daemon</p>
</dd></dl>

<dl class="method">
<dt id="Pyro4.core.Daemon.handleRequest">
<tt class="descname">handleRequest</tt><big>(</big><em>conn</em><big>)</big><a class="headerlink" href="#Pyro4.core.Daemon.handleRequest" title="Permalink to this definition">¶</a></dt>
<dd><p>Handle incoming Pyro request. Catches any exception that may occur and
wraps it in a reply to the calling side, as to not make this server side loop
terminate due to exceptions caused by remote invocations.</p>
</dd></dl>

<dl class="attribute">
<dt id="Pyro4.core.Daemon.locationStr">
<tt class="descname">locationStr</tt><em class="property"> = None</em><a class="headerlink" href="#Pyro4.core.Daemon.locationStr" title="Permalink to this definition">¶</a></dt>
<dd><p>The location (str of the form <tt class="docutils literal"><span class="pre">host:portnumber</span></tt>) on which the Daemon is listening</p>
</dd></dl>

<dl class="attribute">
<dt id="Pyro4.core.Daemon.natLocationStr">
<tt class="descname">natLocationStr</tt><em class="property"> = None</em><a class="headerlink" href="#Pyro4.core.Daemon.natLocationStr" title="Permalink to this definition">¶</a></dt>
<dd><p>The NAT-location (str of the form <tt class="docutils literal"><span class="pre">nathost:natportnumber</span></tt>) on which the Daemon is exposed for use with NAT-routing</p>
</dd></dl>

<dl class="attribute">
<dt id="Pyro4.core.Daemon.objectsById">
<tt class="descname">objectsById</tt><em class="property"> = None</em><a class="headerlink" href="#Pyro4.core.Daemon.objectsById" title="Permalink to this definition">¶</a></dt>
<dd><p>Dictionary from Pyro object id to the actual Pyro object registered by this id</p>
</dd></dl>

<dl class="method">
<dt id="Pyro4.core.Daemon.register">
<tt class="descname">register</tt><big>(</big><em>obj</em>, <em>objectId=None</em><big>)</big><a class="headerlink" href="#Pyro4.core.Daemon.register" title="Permalink to this definition">¶</a></dt>
<dd><p>Register a Pyro object under the given id. Note that this object is now only
known inside this daemon, it is not automatically available in a name server.
This method returns a URI for the registered object.</p>
</dd></dl>

<dl class="method">
<dt id="Pyro4.core.Daemon.requestLoop">
<tt class="descname">requestLoop</tt><big>(</big><em>loopCondition=&lt;function &lt;lambda&gt; at 0xf6d9d764&gt;</em><big>)</big><a class="headerlink" href="#Pyro4.core.Daemon.requestLoop" title="Permalink to this definition">¶</a></dt>
<dd><p>Goes in a loop to service incoming requests, until someone breaks this
or calls shutdown from another thread.</p>
</dd></dl>

<dl class="staticmethod">
<dt id="Pyro4.core.Daemon.serveSimple">
<em class="property">static </em><tt class="descname">serveSimple</tt><big>(</big><em>objects</em>, <em>host=None</em>, <em>port=0</em>, <em>daemon=None</em>, <em>ns=True</em>, <em>verbose=True</em><big>)</big><a class="headerlink" href="#Pyro4.core.Daemon.serveSimple" title="Permalink to this definition">¶</a></dt>
<dd><p>Very basic method to fire up a daemon (or supply one yourself).
objects is a dict containing objects to register as keys, and
their names (or None) as values. If ns is true they will be registered
in the naming server as well, otherwise they just stay local.</p>
</dd></dl>

<dl class="method">
<dt id="Pyro4.core.Daemon.shutdown">
<tt class="descname">shutdown</tt><big>(</big><big>)</big><a class="headerlink" href="#Pyro4.core.Daemon.shutdown" title="Permalink to this definition">¶</a></dt>
<dd><p>Cleanly terminate a daemon that is running in the requestloop. It must be running
in a different thread, or this method will deadlock.</p>
</dd></dl>

<dl class="method">
<dt id="Pyro4.core.Daemon.unregister">
<tt class="descname">unregister</tt><big>(</big><em>objectOrId</em><big>)</big><a class="headerlink" href="#Pyro4.core.Daemon.unregister" title="Permalink to this definition">¶</a></dt>
<dd><p>Remove an object from the known objects inside this daemon.
You can unregister an object directly or with its id.</p>
</dd></dl>

<dl class="method">
<dt id="Pyro4.core.Daemon.uriFor">
<tt class="descname">uriFor</tt><big>(</big><em>objectOrId=None</em>, <em>nat=True</em><big>)</big><a class="headerlink" href="#Pyro4.core.Daemon.uriFor" title="Permalink to this definition">¶</a></dt>
<dd><p>Get a URI for the given object (or object id) from this daemon.
Only a daemon can hand out proper uris because the access location is
contained in them.
Note that unregistered objects cannot be given an uri, but unregistered
object names can (it&#8217;s just a string we&#8217;re creating in that case).
If nat is set to False, the configured NAT address (if any) is ignored and it will
return an URI for the internal address.</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="Pyro4.core.DaemonObject">
<em class="property">class </em><tt class="descclassname">Pyro4.core.</tt><tt class="descname">DaemonObject</tt><big>(</big><em>daemon</em><big>)</big><a class="headerlink" href="#Pyro4.core.DaemonObject" title="Permalink to this definition">¶</a></dt>
<dd><p>The part of the daemon that is exposed as a Pyro object.</p>
<dl class="method">
<dt id="Pyro4.core.DaemonObject.ping">
<tt class="descname">ping</tt><big>(</big><big>)</big><a class="headerlink" href="#Pyro4.core.DaemonObject.ping" title="Permalink to this definition">¶</a></dt>
<dd><p>a simple do-nothing method for testing purposes</p>
</dd></dl>

<dl class="method">
<dt id="Pyro4.core.DaemonObject.registered">
<tt class="descname">registered</tt><big>(</big><big>)</big><a class="headerlink" href="#Pyro4.core.DaemonObject.registered" title="Permalink to this definition">¶</a></dt>
<dd><p>returns a list of all object names registered in this daemon</p>
</dd></dl>

</dd></dl>

<dl class="function">
<dt id="Pyro4.core.callback">
<tt class="descclassname">Pyro4.core.</tt><tt class="descname">callback</tt><big>(</big><em>object</em><big>)</big><a class="headerlink" href="#Pyro4.core.callback" title="Permalink to this definition">¶</a></dt>
<dd><p>decorator to mark a method to be a &#8216;callback&#8217;. This will make Pyro
raise any errors also on the callback side, and not only on the side
that does the callback call.</p>
</dd></dl>

<dl class="function">
<dt id="Pyro4.core.batch">
<tt class="descclassname">Pyro4.core.</tt><tt class="descname">batch</tt><big>(</big><em>proxy</em><big>)</big><a class="headerlink" href="#Pyro4.core.batch" title="Permalink to this definition">¶</a></dt>
<dd><p>convenience method to get a batch proxy adapter</p>
</dd></dl>

<dl class="function">
<dt id="Pyro4.core.async">
<tt class="descclassname">Pyro4.core.</tt><tt class="descname">async</tt><big>(</big><em>proxy</em><big>)</big><a class="headerlink" href="#Pyro4.core.async" title="Permalink to this definition">¶</a></dt>
<dd><p>convenience method to get an async proxy adapter</p>
</dd></dl>

<dl class="class">
<dt id="Pyro4.core.Proxy">
<em class="property">class </em><tt class="descclassname">Pyro4.core.</tt><tt class="descname">Proxy</tt><big>(</big><em>uri</em><big>)</big><a class="headerlink" href="#Pyro4.core.Proxy" title="Permalink to this definition">¶</a></dt>
<dd><p>Pyro proxy for a remote object. Intercepts method calls and dispatches them to the remote object.</p>
<dl class="method">
<dt id="Pyro4.core.Proxy._pyroBind">
<tt class="descname">_pyroBind</tt><big>(</big><big>)</big><a class="headerlink" href="#Pyro4.core.Proxy._pyroBind" title="Permalink to this definition">¶</a></dt>
<dd><p>Bind this proxy to the exact object from the uri. That means that the proxy&#8217;s uri
will be updated with a direct PYRO uri, if it isn&#8217;t one yet.
If the proxy is already bound, it will not bind again.</p>
</dd></dl>

<dl class="method">
<dt id="Pyro4.core.Proxy._pyroRelease">
<tt class="descname">_pyroRelease</tt><big>(</big><big>)</big><a class="headerlink" href="#Pyro4.core.Proxy._pyroRelease" title="Permalink to this definition">¶</a></dt>
<dd><p>release the connection to the pyro daemon</p>
</dd></dl>

<dl class="method">
<dt id="Pyro4.core.Proxy._pyroReconnect">
<tt class="descname">_pyroReconnect</tt><big>(</big><em>tries=100000000</em><big>)</big><a class="headerlink" href="#Pyro4.core.Proxy._pyroReconnect" title="Permalink to this definition">¶</a></dt>
<dd><p>(re)connect the proxy to the daemon containing the pyro object which the proxy is for</p>
</dd></dl>

<dl class="method">
<dt id="Pyro4.core.Proxy._pyroBatch">
<tt class="descname">_pyroBatch</tt><big>(</big><big>)</big><a class="headerlink" href="#Pyro4.core.Proxy._pyroBatch" title="Permalink to this definition">¶</a></dt>
<dd><p>returns a helper class that lets you create batched method calls on the proxy</p>
</dd></dl>

<dl class="method">
<dt id="Pyro4.core.Proxy._pyroAsync">
<tt class="descname">_pyroAsync</tt><big>(</big><big>)</big><a class="headerlink" href="#Pyro4.core.Proxy._pyroAsync" title="Permalink to this definition">¶</a></dt>
<dd><p>returns a helper class that lets you do asynchronous method calls on the proxy</p>
</dd></dl>

<dl class="attribute">
<dt id="Pyro4.core.Proxy._pyroTimeout">
<tt class="descname">_pyroTimeout</tt><a class="headerlink" href="#Pyro4.core.Proxy._pyroTimeout" title="Permalink to this definition">¶</a></dt>
<dd><p>The timeout in seconds for calls on this proxy. Defaults to <tt class="docutils literal"><span class="pre">None</span></tt>.
If the timeout expires before the remote method call returns,
Pyro will raise a <a class="reference internal" href="errors.html#Pyro4.errors.TimeoutError" title="Pyro4.errors.TimeoutError"><tt class="xref py py-exc docutils literal"><span class="pre">Pyro4.errors.TimeoutError</span></tt></a>.</p>
</dd></dl>

<dl class="attribute">
<dt id="Pyro4.core.Proxy._pyroOneway">
<tt class="descname">_pyroOneway</tt><a class="headerlink" href="#Pyro4.core.Proxy._pyroOneway" title="Permalink to this definition">¶</a></dt>
<dd><p>A set of attribute names to be called as one-way method calls.
This means the client won&#8217;t wait for a response from the server
while it is processing the call. Their return value is always <tt class="docutils literal"><span class="pre">None</span></tt>.</p>
</dd></dl>

</dd></dl>

</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
            <p class="logo"><a href="../index.html">
              <img class="logo" src="../_static/pyro.png" alt="Logo"/>
            </a></p>
  <h4>Previous topic</h4>
  <p class="topless"><a href="main.html"
                        title="previous chapter"><tt class="docutils literal"><span class="pre">Pyro4</span></tt> &#8212; Main API package</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="naming.html"
                        title="next chapter"><tt class="docutils literal"><span class="pre">Pyro4.naming</span></tt> &#8212; Pyro name server</a></p>
<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="naming.html" title="Pyro4.naming — Pyro name server"
             >next</a> |</li>
        <li class="right" >
          <a href="main.html" title="Pyro4 — Main API package"
             >previous</a> |</li>
        <li><a href="../index.html">Pyro 4.21 documentation</a> &raquo;</li>
          <li><a href="../api.html" >Pyro4 library API</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
        &copy; Copyright Irmen de Jong.
      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
    </div>
  </body>
</html>