Mercurial > pymonkey
diff docs/rendered/pymonkey.html @ 85:e9f450d30c0e
Added more documentation.
author | Atul Varma <varmaa@toolness.com> |
---|---|
date | Sun, 09 Aug 2009 15:37:29 -0700 |
parents | 228a56e7e793 |
children | c41f1d2e8f9d |
line wrap: on
line diff
--- a/docs/rendered/pymonkey.html Sun Aug 09 15:18:33 2009 -0700 +++ b/docs/rendered/pymonkey.html Sun Aug 09 15:37:29 2009 -0700 @@ -96,6 +96,13 @@ </dd></dl> <dl class="class"> +<dt id="pymonkey.Function"> +<em class="property"> +class </em><tt class="descclassname">pymonkey.</tt><tt class="descname">Function</tt><a class="headerlink" href="#pymonkey.Function" title="Permalink to this definition">¶</a></dt> +<dd>This is the type of JavaScript functions, which is a subtype of +<a title="pymonkey.Object" class="reference" href="#pymonkey.Object"><tt class="xref docutils literal"><span class="pre">Object</span></tt></a>.</dd></dl> + +<dl class="class"> <dt id="pymonkey.Context"> <em class="property"> 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> @@ -122,16 +129,37 @@ <a title="pymonkey.Context.get_object_private" class="reference" href="#pymonkey.Context.get_object_private"><tt class="xref docutils literal"><span class="pre">get_object_private()</span></tt></a>.</dd></dl> <dl class="method"> +<dt id="pymonkey.Context.new_function"> +<tt class="descname">new_function</tt><big>(</big><em>callable</em>, <em>name</em><big>)</big><a class="headerlink" href="#pymonkey.Context.new_function" title="Permalink to this definition">¶</a></dt> +<dd>Creates a new <a title="pymonkey.Function" class="reference" href="#pymonkey.Function"><tt class="xref docutils literal"><span class="pre">Function</span></tt></a> instance that wraps the +given Python callable. In JS-land, the callable will +have the given name.</dd></dl> + +<dl class="method"> <dt id="pymonkey.Context.get_object_private"> <tt class="descname">get_object_private</tt><big>(</big><em>object</em><big>)</big><a class="headerlink" href="#pymonkey.Context.get_object_private" title="Permalink to this definition">¶</a></dt> <dd><p>Returns the <tt class="docutils literal"><span class="pre">private_obj</span></tt> passed to <a title="pymonkey.Context.new_object" class="reference" href="#pymonkey.Context.new_object"><tt class="xref docutils literal"><span class="pre">new_object()</span></tt></a> when <cite>object</cite> was first created. If it doesn’t exist, <tt class="xref docutils literal"><span class="pre">None</span></tt> is returned.</p> +<p>If <cite>object</cite> was created with <a title="pymonkey.Context.new_function" class="reference" href="#pymonkey.Context.new_function"><tt class="xref docutils literal"><span class="pre">new_function()</span></tt></a>, then this +method returns the Python callable wrapped by <cite>object</cite>.</p> <p>This functionality is useful if you want to represent Python objects in JS-land.</p> </dd></dl> <dl class="method"> +<dt id="pymonkey.Context.clear_object_private"> +<tt class="descname">clear_object_private</tt><big>(</big><em>object</em><big>)</big><a class="headerlink" href="#pymonkey.Context.clear_object_private" title="Permalink to this definition">¶</a></dt> +<dd><p>Clears the <tt class="docutils literal"><span class="pre">private_obj</span></tt> passed to <a title="pymonkey.Context.new_object" class="reference" href="#pymonkey.Context.new_object"><tt class="xref docutils literal"><span class="pre">new_object()</span></tt></a> +when <cite>object</cite> was first created. If it doesn’t exist, this +function returns nothing.</p> +<p>If <cite>object</cite> was created with <a title="pymonkey.Context.new_function" class="reference" href="#pymonkey.Context.new_function"><tt class="xref docutils literal"><span class="pre">new_function()</span></tt></a>, then this +method effectively “unbinds” the Python callable wrapped by +<cite>object</cite>. If <cite>object</cite> is later called, an exception will be +raised.</p> +</dd></dl> + +<dl class="method"> <dt id="pymonkey.Context.init_standard_classes"> <tt class="descname">init_standard_classes</tt><big>(</big><em>object</em><big>)</big><a class="headerlink" href="#pymonkey.Context.init_standard_classes" title="Permalink to this definition">¶</a></dt> <dd>Defines the standard JavaScript classes on the given