Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > 06e1e0ab98898582c876a8be34ecb5e9 > files > 249

capisuite-0.4.5-5mdv2010.0.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>CapiSuite: PythonScript Class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.8 -->
<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Class&nbsp;List</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Class&nbsp;Members</a> | <a class="qindex" href="globals.html">File&nbsp;Members</a></div>
<h1>PythonScript Class Reference</h1>Read a python script and call a function.  
<a href="#_details">More...</a>
<p>
<code>#include &lt;<a class="el" href="pythonscript_8h-source.html">pythonscript.h</a>&gt;</code>
<p>
<p>Inheritance diagram for PythonScript:
<p><center><img src="classPythonScript.png" usemap="#PythonScript_map" border="0" alt=""></center>
<map name="PythonScript_map">
<area href="classIdleScript.html" alt="IdleScript" shape="rect" coords="0,56,95,80">
<area href="classIncomingScript.html" alt="IncomingScript" shape="rect" coords="105,56,200,80">
</map>
<a href="classPythonScript-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classPythonScript.html#a0">PythonScript</a> (ostream &amp;<a class="el" href="classPythonScript.html#p3">debug</a>, unsigned short <a class="el" href="classPythonScript.html#p5">debug_level</a>, ostream &amp;<a class="el" href="classPythonScript.html#p4">error</a>, string <a class="el" href="classPythonScript.html#p0">filename</a>, string <a class="el" href="classPythonScript.html#p1">functionname</a>, PycStringIO_CAPI *<a class="el" href="classPythonScript.html#p6">cStringIO</a>)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Constructor. Create Object.  <a href="#a0"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>virtual&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classPythonScript.html#a1">~PythonScript</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Destructor.  <a href="#a1"></a><br></td></tr>
<tr><td colspan=2><br><h2>Protected Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>virtual void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classPythonScript.html#b0">run</a> ()  throw (ApplicationError)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Reads the given python script and calls the given function.  <a href="#b0"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>virtual void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classPythonScript.html#b1">final</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Called by pscript_cleanup_handler(), will delete the current object.  <a href="#b1"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>string&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classPythonScript.html#b2">prefix</a> (bool verbose=true)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">return a prefix containing this pointer, Python script name and date for log messages  <a href="#b2"></a><br></td></tr>
<tr><td colspan=2><br><h2>Protected Attributes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>string&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classPythonScript.html#p0">filename</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">name of the python script to read  <a href="#p0"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>string&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classPythonScript.html#p1">functionname</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">name of the function to call  <a href="#p1"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>PyObject *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classPythonScript.html#p2">args</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">python tuple containing the args for the called python function  <a href="#p2"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>ostream &amp;&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classPythonScript.html#p3">debug</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">debug stream  <a href="#p3"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>ostream &amp;&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classPythonScript.html#p4">error</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">error stream  <a href="#p4"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>unsigned short&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classPythonScript.html#p5">debug_level</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">debug level  <a href="#p5"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>PycStringIO_CAPI *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classPythonScript.html#p6">cStringIO</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">holds a pointer to the Python cStringIO C API  <a href="#p6"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
Read a python script and call a function. 
<p>
This class reads a given python script which must define one function with given name. This function is called with arbitrary parameters.<p>
<dl compact><dt><b>Author:</b></dt><dd>Gernot Hillier </dd></dl>

<p>
<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" name="a0" doxytag="PythonScript::PythonScript" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> PythonScript::PythonScript           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">ostream &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>debug</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>unsigned short&nbsp;</td>
          <td class="mdname" nowrap> <em>debug_level</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>ostream &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>error</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>string&nbsp;</td>
          <td class="mdname" nowrap> <em>filename</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>string&nbsp;</td>
          <td class="mdname" nowrap> <em>functionname</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>PycStringIO_CAPI *&nbsp;</td>
          <td class="mdname" nowrap> <em>cStringIO</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Constructor. Create Object. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td></td><td valign=top><em>debug</em>&nbsp;</td><td>stream for debugging info </td></tr>
    <tr><td></td><td valign=top><em>debug_level</em>&nbsp;</td><td>verbosity level for debug messages </td></tr>
    <tr><td></td><td valign=top><em>error</em>&nbsp;</td><td>stream for error messages </td></tr>
    <tr><td></td><td valign=top><em>filename</em>&nbsp;</td><td>file name of the python script to read </td></tr>
    <tr><td></td><td valign=top><em>functionname</em>&nbsp;</td><td>name of the function to call </td></tr>
    <tr><td></td><td valign=top><em>cStringIO</em>&nbsp;</td><td>pointer to the Python cStringIO C API</td></tr>
  </table>
</dl>
    </td>
  </tr>
</table>
<a class="anchor" name="a1" doxytag="PythonScript::~PythonScript" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> PythonScript::~<a class="el" href="classPythonScript.html">PythonScript</a>           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap><code> [virtual]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Destructor. 
<p>
    </td>
  </tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="b1" doxytag="PythonScript::final" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> void PythonScript::final           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap><code> [protected, virtual]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Called by pscript_cleanup_handler(), will delete the current object. 
<p>
    </td>
  </tr>
</table>
<a class="anchor" name="b2" doxytag="PythonScript::prefix" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> string PythonScript::prefix           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">bool&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>verbose</em> = <code>true</code>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap><code> [protected]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
return a prefix containing this pointer, Python script name and date for log messages 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td></td><td valign=top><em>verbose</em>&nbsp;</td><td>controls verbosity, default is true which means to log filename etc., false means only this pointer</td></tr>
  </table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>constructed prefix as stringstream</dd></dl>
    </td>
  </tr>
</table>
<a class="anchor" name="b0" doxytag="PythonScript::run" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> void PythonScript::run           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap>  throw (<a class="el" href="classApplicationError.html">ApplicationError</a>)<code> [protected, virtual]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Reads the given python script and calls the given function. 
<p>
The arguments for the function must be given in the constructor.<p>
<dl compact><dt><b>Exceptions:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td></td><td valign=top><em>ApplicationError</em>&nbsp;</td><td>Thrown when script can't be executed for any reason.</td></tr>
  </table>
</dl>

<p>
Reimplemented in <a class="el" href="classIdleScript.html#d0">IdleScript</a>, and <a class="el" href="classIncomingScript.html#d0">IncomingScript</a>.
<p>
    </td>
  </tr>
</table>
<hr><h2>Member Data Documentation</h2>
<a class="anchor" name="p2" doxytag="PythonScript::args" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> PyObject* <a class="el" href="classPythonScript.html#p2">PythonScript::args</a><code> [protected]</code>          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
python tuple containing the args for the called python function 
<p>
    </td>
  </tr>
</table>
<a class="anchor" name="p6" doxytag="PythonScript::cStringIO" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> PycStringIO_CAPI* <a class="el" href="classPythonScript.html#p6">PythonScript::cStringIO</a><code> [protected]</code>          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
holds a pointer to the Python cStringIO C API 
<p>
    </td>
  </tr>
</table>
<a class="anchor" name="p3" doxytag="PythonScript::debug" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> ostream&amp; <a class="el" href="classPythonScript.html#p3">PythonScript::debug</a><code> [protected]</code>          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
debug stream 
<p>
    </td>
  </tr>
</table>
<a class="anchor" name="p5" doxytag="PythonScript::debug_level" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> unsigned short <a class="el" href="classPythonScript.html#p5">PythonScript::debug_level</a><code> [protected]</code>          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
debug level 
<p>
    </td>
  </tr>
</table>
<a class="anchor" name="p4" doxytag="PythonScript::error" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> ostream &amp; <a class="el" href="classPythonScript.html#p4">PythonScript::error</a><code> [protected]</code>          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
error stream 
<p>
    </td>
  </tr>
</table>
<a class="anchor" name="p0" doxytag="PythonScript::filename" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> string <a class="el" href="classPythonScript.html#p0">PythonScript::filename</a><code> [protected]</code>          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
name of the python script to read 
<p>
    </td>
  </tr>
</table>
<a class="anchor" name="p1" doxytag="PythonScript::functionname" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> string <a class="el" href="classPythonScript.html#p1">PythonScript::functionname</a><code> [protected]</code>          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
name of the function to call 
<p>
    </td>
  </tr>
</table>
<hr>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="pythonscript_8h-source.html">pythonscript.h</a><li>pythonscript.cpp</ul>
<hr size="1"><address style="align: right;"><small>Generated on Sun Nov 28 14:37:45 2004 for CapiSuite by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 ></a> 1.3.8 </small></address>
</body>
</html>