comparison docs/rendered/pymonkey.html @ 53:2055d853b995

Added docs for pymonkey.Object.
author Atul Varma <varmaa@toolness.com>
date Fri, 10 Jul 2009 17:07:26 -0700
parents fabd3f2271fa
children 234fca1c4b86
comparison
equal deleted inserted replaced
52:427b01954b22 53:2055d853b995
53 exception </em><tt class="descclassname">pymonkey.</tt><tt class="descname">error</tt><a class="headerlink" href="#pymonkey.error" title="Permalink to this definition">¶</a></dt> 53 exception </em><tt class="descclassname">pymonkey.</tt><tt class="descname">error</tt><a class="headerlink" href="#pymonkey.error" title="Permalink to this definition">¶</a></dt>
54 <dd>This is the type of any SpiderMonkey-related errors thrown by this 54 <dd>This is the type of any SpiderMonkey-related errors thrown by this
55 module.</dd></dl> 55 module.</dd></dl>
56 56
57 <dl class="class"> 57 <dl class="class">
58 <dt id="pymonkey.Object">
59 <em class="property">
60 class </em><tt class="descclassname">pymonkey.</tt><tt class="descname">Object</tt><a class="headerlink" href="#pymonkey.Object" title="Permalink to this definition">¶</a></dt>
61 <dd><p>This is the type of JavaScript objects. Such objects can only be
62 created via Pymonkey calls like <tt class="xref docutils literal"><span class="pre">Context.new_object()</span></tt> or
63 through the execution of JS code, but this type object can be used
64 with Python&#8217;s built-in <tt class="xref docutils literal"><span class="pre">isinstance()</span></tt> to verify that an
65 object is a JS object, like so:</p>
66 <div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">obj</span> <span class="o">=</span> <span class="n">pymonkey</span><span class="o">.</span><span class="n">Runtime</span><span class="p">()</span><span class="o">.</span><span class="n">new_context</span><span class="p">()</span><span class="o">.</span><span class="n">new_object</span><span class="p">()</span>
67 <span class="gp">&gt;&gt;&gt; </span><span class="nb">isinstance</span><span class="p">(</span><span class="n">obj</span><span class="p">,</span> <span class="n">pymonkey</span><span class="o">.</span><span class="n">Object</span><span class="p">)</span>
68 <span class="go">True</span>
69 </pre></div>
70 </div>
71 </dd></dl>
72
73 <dl class="class">
58 <dt id="pymonkey.Context"> 74 <dt id="pymonkey.Context">
59 <em class="property"> 75 <em class="property">
60 class </em><tt class="descclassname">pymonkey.</tt><tt class="descname">Context</tt><a class="headerlink" href="#pymonkey.Context" title="Permalink to this definition">¶</a></dt> 76 class </em><tt class="descclassname">pymonkey.</tt><tt class="descname">Context</tt><a class="headerlink" href="#pymonkey.Context" title="Permalink to this definition">¶</a></dt>
61 <dd><p>This is the type of JavaScript context objects. Contexts can only 77 <dd><p>This is the type of JavaScript context objects. Contexts can only
62 be created via a call to <a title="pymonkey.Runtime.new_context" class="reference" href="#pymonkey.Runtime.new_context"><tt class="xref docutils literal"><span class="pre">Runtime.new_context()</span></tt></a>, but this 78 be created via a call to <a title="pymonkey.Runtime.new_context" class="reference" href="#pymonkey.Runtime.new_context"><tt class="xref docutils literal"><span class="pre">Runtime.new_context()</span></tt></a>, but this
71 87
72 <dl class="class"> 88 <dl class="class">
73 <dt id="pymonkey.Runtime"> 89 <dt id="pymonkey.Runtime">
74 <em class="property"> 90 <em class="property">
75 class </em><tt class="descclassname">pymonkey.</tt><tt class="descname">Runtime</tt><a class="headerlink" href="#pymonkey.Runtime" title="Permalink to this definition">¶</a></dt> 91 class </em><tt class="descclassname">pymonkey.</tt><tt class="descname">Runtime</tt><a class="headerlink" href="#pymonkey.Runtime" title="Permalink to this definition">¶</a></dt>
76 <dd><p>Creates a new JavaScript runtime. JS objects created by the 92 <dd><p>Creates a new JavaScript runtime. JS objects created by the runtime
77 runtime may interact with other JS objects of the runtime, but 93 may only interact with other JS objects of the same runtime.</p>
78 they can&#8217;t interact with objects from other runtimes.</p>
79 <dl class="method"> 94 <dl class="method">
80 <dt id="pymonkey.Runtime.new_context"> 95 <dt id="pymonkey.Runtime.new_context">
81 <tt class="descname">new_context</tt><big>(</big><big>)</big><a class="headerlink" href="#pymonkey.Runtime.new_context" title="Permalink to this definition">¶</a></dt> 96 <tt class="descname">new_context</tt><big>(</big><big>)</big><a class="headerlink" href="#pymonkey.Runtime.new_context" title="Permalink to this definition">¶</a></dt>
82 <dd>Creates a new Context object and returns it. Contexts are best 97 <dd>Creates a new Context object and returns it. Contexts are best
83 conceptualized as threads of execution in a JS runtme; each one 98 conceptualized as threads of execution in a JS runtme; each one