Mercurial > pymonkey
annotate docs/rendered/pymonkey.html @ 113:e616b4605db0
Added doctest for evaluate_script().
author | Atul Varma <varmaa@toolness.com> |
---|---|
date | Sun, 16 Aug 2009 22:48:50 -0700 |
parents | 2086377c0abe |
children | 87147faa031a |
rev | line source |
---|---|
51
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
3 |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
4 <html xmlns="http://www.w3.org/1999/xhtml"> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
5 <head> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
6 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
7 |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
8 <title>pymonkey — Access SpiderMonkey from Python — Pymonkey v0.0.1 documentation</title> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
9 <link rel="stylesheet" href="_static/default.css" type="text/css" /> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
10 <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
11 <script type="text/javascript"> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
12 var DOCUMENTATION_OPTIONS = { |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
13 URL_ROOT: '', |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
14 VERSION: '0.0.1', |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
15 COLLAPSE_MODINDEX: false, |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
16 FILE_SUFFIX: '.html', |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
17 HAS_SOURCE: true |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
18 }; |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
19 </script> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
20 <script type="text/javascript" src="_static/jquery.js"></script> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
21 <script type="text/javascript" src="_static/doctools.js"></script> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
22 <link rel="top" title="Pymonkey v0.0.1 documentation" href="index.html" /> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
23 <link rel="prev" title="Pymonkey Documentation" href="index.html" /> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
24 </head> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
25 <body> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
26 <div class="related"> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
27 <h3>Navigation</h3> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
28 <ul> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
29 <li class="right" style="margin-right: 10px"> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
30 <a href="genindex.html" title="General Index" |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
31 accesskey="I">index</a></li> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
32 <li class="right" > |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
33 <a href="modindex.html" title="Global Module Index" |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
34 accesskey="M">modules</a> |</li> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
35 <li class="right" > |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
36 <a href="index.html" title="Pymonkey Documentation" |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
37 accesskey="P">previous</a> |</li> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
38 <li><a href="index.html">Pymonkey v0.0.1 documentation</a> »</li> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
39 </ul> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
40 </div> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
41 |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
42 <div class="document"> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
43 <div class="documentwrapper"> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
44 <div class="bodywrapper"> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
45 <div class="body"> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
46 |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
47 <div class="section" id="module-pymonkey"> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
48 <h1><tt class="xref docutils literal"><span class="pre">pymonkey</span></tt> — Access SpiderMonkey from Python<a class="headerlink" href="#module-pymonkey" title="Permalink to this headline">¶</a></h1> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
49 <p>This module offers a low-level interface to the <a class="reference" href="https://developer.mozilla.org/en/SpiderMonkey">Mozilla SpiderMonkey</a> JavaScript engine.</p> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
50 <dl class="exception"> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
51 <dt id="pymonkey.error"> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
52 <em class="property"> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
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> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
54 <dd>This is the type of any SpiderMonkey-related errors thrown by this |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
55 module.</dd></dl> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
56 |
54
234fca1c4b86
Added docs for pymonkey.undefined.
Atul Varma <varmaa@toolness.com>
parents:
53
diff
changeset
|
57 <dl class="data"> |
234fca1c4b86
Added docs for pymonkey.undefined.
Atul Varma <varmaa@toolness.com>
parents:
53
diff
changeset
|
58 <dt id="pymonkey.undefined"> |
234fca1c4b86
Added docs for pymonkey.undefined.
Atul Varma <varmaa@toolness.com>
parents:
53
diff
changeset
|
59 <tt class="descclassname">pymonkey.</tt><tt class="descname">undefined</tt><a class="headerlink" href="#pymonkey.undefined" title="Permalink to this definition">¶</a></dt> |
234fca1c4b86
Added docs for pymonkey.undefined.
Atul Varma <varmaa@toolness.com>
parents:
53
diff
changeset
|
60 <dd><p>This is the singleton that represents the JavaScript value |
234fca1c4b86
Added docs for pymonkey.undefined.
Atul Varma <varmaa@toolness.com>
parents:
53
diff
changeset
|
61 <tt class="docutils literal"><span class="pre">undefined</span></tt>, as Python has no equivalent representation |
234fca1c4b86
Added docs for pymonkey.undefined.
Atul Varma <varmaa@toolness.com>
parents:
53
diff
changeset
|
62 (JavaScript’s <tt class="docutils literal"><span class="pre">null</span></tt> is mapped to Python’s <tt class="xref docutils literal"><span class="pre">None</span></tt> object). |
234fca1c4b86
Added docs for pymonkey.undefined.
Atul Varma <varmaa@toolness.com>
parents:
53
diff
changeset
|
63 For instance:</p> |
234fca1c4b86
Added docs for pymonkey.undefined.
Atul Varma <varmaa@toolness.com>
parents:
53
diff
changeset
|
64 <div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="n">cx</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> |
56
72e84bd75905
Made another doctest easier to read.
Atul Varma <varmaa@toolness.com>
parents:
55
diff
changeset
|
65 <span class="gp">>>> </span><span class="n">cx</span><span class="o">.</span><span class="n">evaluate_script</span><span class="p">(</span><span class="n">cx</span><span class="o">.</span><span class="n">new_object</span><span class="p">(),</span> <span class="s">''</span><span class="p">,</span> <span class="s">'<string>'</span><span class="p">,</span> <span class="mf">1</span><span class="p">)</span> |
57
a2b617731398
pymonkey.undefined now has a 'falsy' value.
Atul Varma <varmaa@toolness.com>
parents:
56
diff
changeset
|
66 <span class="go">pymonkey.undefined</span> |
54
234fca1c4b86
Added docs for pymonkey.undefined.
Atul Varma <varmaa@toolness.com>
parents:
53
diff
changeset
|
67 </pre></div> |
234fca1c4b86
Added docs for pymonkey.undefined.
Atul Varma <varmaa@toolness.com>
parents:
53
diff
changeset
|
68 </div> |
57
a2b617731398
pymonkey.undefined now has a 'falsy' value.
Atul Varma <varmaa@toolness.com>
parents:
56
diff
changeset
|
69 <p>This object also has a “falsy” value:</p> |
a2b617731398
pymonkey.undefined now has a 'falsy' value.
Atul Varma <varmaa@toolness.com>
parents:
56
diff
changeset
|
70 <div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="k">if</span> <span class="ow">not</span> <span class="n">pymonkey</span><span class="o">.</span><span class="n">undefined</span><span class="p">:</span> |
a2b617731398
pymonkey.undefined now has a 'falsy' value.
Atul Varma <varmaa@toolness.com>
parents:
56
diff
changeset
|
71 <span class="gp">... </span> <span class="k">print</span> <span class="s">"See, it's falsy!"</span> |
a2b617731398
pymonkey.undefined now has a 'falsy' value.
Atul Varma <varmaa@toolness.com>
parents:
56
diff
changeset
|
72 <span class="go">See, it's falsy!</span> |
54
234fca1c4b86
Added docs for pymonkey.undefined.
Atul Varma <varmaa@toolness.com>
parents:
53
diff
changeset
|
73 </pre></div> |
234fca1c4b86
Added docs for pymonkey.undefined.
Atul Varma <varmaa@toolness.com>
parents:
53
diff
changeset
|
74 </div> |
234fca1c4b86
Added docs for pymonkey.undefined.
Atul Varma <varmaa@toolness.com>
parents:
53
diff
changeset
|
75 </dd></dl> |
234fca1c4b86
Added docs for pymonkey.undefined.
Atul Varma <varmaa@toolness.com>
parents:
53
diff
changeset
|
76 |
51
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
77 <dl class="class"> |
53
2055d853b995
Added docs for pymonkey.Object.
Atul Varma <varmaa@toolness.com>
parents:
51
diff
changeset
|
78 <dt id="pymonkey.Object"> |
2055d853b995
Added docs for pymonkey.Object.
Atul Varma <varmaa@toolness.com>
parents:
51
diff
changeset
|
79 <em class="property"> |
2055d853b995
Added docs for pymonkey.Object.
Atul Varma <varmaa@toolness.com>
parents:
51
diff
changeset
|
80 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> |
2055d853b995
Added docs for pymonkey.Object.
Atul Varma <varmaa@toolness.com>
parents:
51
diff
changeset
|
81 <dd><p>This is the type of JavaScript objects. Such objects can only be |
58
7a3461ccaf1d
Added documentation for Context methods get_runtime(), new_object(), and init_standard_classes().
Atul Varma <varmaa@toolness.com>
parents:
57
diff
changeset
|
82 created via Pymonkey calls like <a title="pymonkey.Context.new_object" class="reference" href="#pymonkey.Context.new_object"><tt class="xref docutils literal"><span class="pre">Context.new_object()</span></tt></a> or |
53
2055d853b995
Added docs for pymonkey.Object.
Atul Varma <varmaa@toolness.com>
parents:
51
diff
changeset
|
83 through the execution of JS code, but this type object can be used |
2055d853b995
Added docs for pymonkey.Object.
Atul Varma <varmaa@toolness.com>
parents:
51
diff
changeset
|
84 with Python’s built-in <tt class="xref docutils literal"><span class="pre">isinstance()</span></tt> to verify that an |
2055d853b995
Added docs for pymonkey.Object.
Atul Varma <varmaa@toolness.com>
parents:
51
diff
changeset
|
85 object is a JS object, like so:</p> |
2055d853b995
Added docs for pymonkey.Object.
Atul Varma <varmaa@toolness.com>
parents:
51
diff
changeset
|
86 <div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </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> |
2055d853b995
Added docs for pymonkey.Object.
Atul Varma <varmaa@toolness.com>
parents:
51
diff
changeset
|
87 <span class="gp">>>> </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> |
2055d853b995
Added docs for pymonkey.Object.
Atul Varma <varmaa@toolness.com>
parents:
51
diff
changeset
|
88 <span class="go">True</span> |
2055d853b995
Added docs for pymonkey.Object.
Atul Varma <varmaa@toolness.com>
parents:
51
diff
changeset
|
89 </pre></div> |
2055d853b995
Added docs for pymonkey.Object.
Atul Varma <varmaa@toolness.com>
parents:
51
diff
changeset
|
90 </div> |
78
c48b393f6461
Added docs for Object.get_runtime().
Atul Varma <varmaa@toolness.com>
parents:
58
diff
changeset
|
91 <dl class="method"> |
c48b393f6461
Added docs for Object.get_runtime().
Atul Varma <varmaa@toolness.com>
parents:
58
diff
changeset
|
92 <dt id="pymonkey.Object.get_runtime"> |
c48b393f6461
Added docs for Object.get_runtime().
Atul Varma <varmaa@toolness.com>
parents:
58
diff
changeset
|
93 <tt class="descname">get_runtime</tt><big>(</big><big>)</big><a class="headerlink" href="#pymonkey.Object.get_runtime" title="Permalink to this definition">¶</a></dt> |
c48b393f6461
Added docs for Object.get_runtime().
Atul Varma <varmaa@toolness.com>
parents:
58
diff
changeset
|
94 <dd>Returns the <a title="pymonkey.Runtime" class="reference" href="#pymonkey.Runtime"><tt class="xref docutils literal"><span class="pre">Runtime</span></tt></a> that the object belongs to.</dd></dl> |
c48b393f6461
Added docs for Object.get_runtime().
Atul Varma <varmaa@toolness.com>
parents:
58
diff
changeset
|
95 |
53
2055d853b995
Added docs for pymonkey.Object.
Atul Varma <varmaa@toolness.com>
parents:
51
diff
changeset
|
96 </dd></dl> |
2055d853b995
Added docs for pymonkey.Object.
Atul Varma <varmaa@toolness.com>
parents:
51
diff
changeset
|
97 |
2055d853b995
Added docs for pymonkey.Object.
Atul Varma <varmaa@toolness.com>
parents:
51
diff
changeset
|
98 <dl class="class"> |
85 | 99 <dt id="pymonkey.Function"> |
100 <em class="property"> | |
101 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> | |
102 <dd>This is the type of JavaScript functions, which is a subtype of | |
103 <a title="pymonkey.Object" class="reference" href="#pymonkey.Object"><tt class="xref docutils literal"><span class="pre">Object</span></tt></a>.</dd></dl> | |
104 | |
105 <dl class="class"> | |
51
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
106 <dt id="pymonkey.Context"> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
107 <em class="property"> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
108 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> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
109 <dd><p>This is the type of JavaScript context objects. Contexts can only |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
110 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 |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
111 type object can be used with Python’s built-in <tt class="xref docutils literal"><span class="pre">isinstance()</span></tt> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
112 to verify that an object is a context, like so:</p> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
113 <div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="n">cx</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> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
114 <span class="gp">>>> </span><span class="nb">isinstance</span><span class="p">(</span><span class="n">cx</span><span class="p">,</span> <span class="n">pymonkey</span><span class="o">.</span><span class="n">Context</span><span class="p">)</span> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
115 <span class="go">True</span> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
116 </pre></div> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
117 </div> |
58
7a3461ccaf1d
Added documentation for Context methods get_runtime(), new_object(), and init_standard_classes().
Atul Varma <varmaa@toolness.com>
parents:
57
diff
changeset
|
118 <dl class="method"> |
7a3461ccaf1d
Added documentation for Context methods get_runtime(), new_object(), and init_standard_classes().
Atul Varma <varmaa@toolness.com>
parents:
57
diff
changeset
|
119 <dt id="pymonkey.Context.get_runtime"> |
7a3461ccaf1d
Added documentation for Context methods get_runtime(), new_object(), and init_standard_classes().
Atul Varma <varmaa@toolness.com>
parents:
57
diff
changeset
|
120 <tt class="descname">get_runtime</tt><big>(</big><big>)</big><a class="headerlink" href="#pymonkey.Context.get_runtime" title="Permalink to this definition">¶</a></dt> |
7a3461ccaf1d
Added documentation for Context methods get_runtime(), new_object(), and init_standard_classes().
Atul Varma <varmaa@toolness.com>
parents:
57
diff
changeset
|
121 <dd>Returns the <a title="pymonkey.Runtime" class="reference" href="#pymonkey.Runtime"><tt class="xref docutils literal"><span class="pre">Runtime</span></tt></a> that the context belongs to.</dd></dl> |
7a3461ccaf1d
Added documentation for Context methods get_runtime(), new_object(), and init_standard_classes().
Atul Varma <varmaa@toolness.com>
parents:
57
diff
changeset
|
122 |
7a3461ccaf1d
Added documentation for Context methods get_runtime(), new_object(), and init_standard_classes().
Atul Varma <varmaa@toolness.com>
parents:
57
diff
changeset
|
123 <dl class="method"> |
7a3461ccaf1d
Added documentation for Context methods get_runtime(), new_object(), and init_standard_classes().
Atul Varma <varmaa@toolness.com>
parents:
57
diff
changeset
|
124 <dt id="pymonkey.Context.new_object"> |
79
228a56e7e793
Added docs for context.get_object_private().
Atul Varma <varmaa@toolness.com>
parents:
78
diff
changeset
|
125 <tt class="descname">new_object</tt><big>(</big><span class="optional">[</span><em>private_obj</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#pymonkey.Context.new_object" title="Permalink to this definition">¶</a></dt> |
228a56e7e793
Added docs for context.get_object_private().
Atul Varma <varmaa@toolness.com>
parents:
78
diff
changeset
|
126 <dd>Creates a new <a title="pymonkey.Object" class="reference" href="#pymonkey.Object"><tt class="xref docutils literal"><span class="pre">Object</span></tt></a> instance and returns |
228a56e7e793
Added docs for context.get_object_private().
Atul Varma <varmaa@toolness.com>
parents:
78
diff
changeset
|
127 it. <tt class="docutils literal"><span class="pre">private_obj</span></tt> is any Python object that is privately |
228a56e7e793
Added docs for context.get_object_private().
Atul Varma <varmaa@toolness.com>
parents:
78
diff
changeset
|
128 stored within the new JS object; it can be retrieved using |
228a56e7e793
Added docs for context.get_object_private().
Atul Varma <varmaa@toolness.com>
parents:
78
diff
changeset
|
129 <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> |
228a56e7e793
Added docs for context.get_object_private().
Atul Varma <varmaa@toolness.com>
parents:
78
diff
changeset
|
130 |
228a56e7e793
Added docs for context.get_object_private().
Atul Varma <varmaa@toolness.com>
parents:
78
diff
changeset
|
131 <dl class="method"> |
85 | 132 <dt id="pymonkey.Context.new_function"> |
133 <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> | |
90 | 134 <dd><p>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 |
135 given Python callable. In JS-land, the function will | |
136 have the given name.</p> | |
137 <p>When the function is executed from JavaScript, <cite>callable</cite> | |
138 will be passed three positional arguments.</p> | |
139 <p>The first argument is a <a title="pymonkey.Context" class="reference" href="#pymonkey.Context"><tt class="xref docutils literal"><span class="pre">Context</span></tt></a> that represents the | |
140 JS context which is calling the function.</p> | |
141 <p>The second argument is an <a title="pymonkey.Object" class="reference" href="#pymonkey.Object"><tt class="xref docutils literal"><span class="pre">Object</span></tt></a> that represents the | |
142 value of <tt class="docutils literal"><span class="pre">this</span></tt> for the duration of the call.</p> | |
143 <p>The third argument is a tuple containing the arguments | |
144 passed to the function.</p> | |
111 | 145 <p>For instance:</p> |
146 <div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="k">def</span> <span class="nf">add</span><span class="p">(</span><span class="n">cx</span><span class="p">,</span> <span class="n">this</span><span class="p">,</span> <span class="n">args</span><span class="p">):</span> | |
147 <span class="gp">... </span> <span class="k">return</span> <span class="n">args</span><span class="p">[</span><span class="mf">0</span><span class="p">]</span> <span class="o">+</span> <span class="n">args</span><span class="p">[</span><span class="mf">1</span><span class="p">]</span> | |
148 <span class="gp">>>> </span><span class="n">cx</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> | |
149 <span class="gp">>>> </span><span class="n">obj</span> <span class="o">=</span> <span class="n">cx</span><span class="o">.</span><span class="n">new_object</span><span class="p">()</span> | |
150 <span class="gp">>>> </span><span class="n">cx</span><span class="o">.</span><span class="n">define_property</span><span class="p">(</span><span class="n">obj</span><span class="p">,</span> <span class="s">'add'</span><span class="p">,</span> <span class="n">cx</span><span class="o">.</span><span class="n">new_function</span><span class="p">(</span><span class="n">add</span><span class="p">,</span> <span class="s">'add'</span><span class="p">))</span> | |
151 <span class="gp">>>> </span><span class="n">cx</span><span class="o">.</span><span class="n">evaluate_script</span><span class="p">(</span><span class="n">obj</span><span class="p">,</span> <span class="s">'add(1, 1);'</span><span class="p">,</span> <span class="s">'<string>'</span><span class="p">,</span> <span class="mf">1</span><span class="p">)</span> | |
152 <span class="go">2</span> | |
153 </pre></div> | |
154 </div> | |
90 | 155 </dd></dl> |
85 | 156 |
157 <dl class="method"> | |
79
228a56e7e793
Added docs for context.get_object_private().
Atul Varma <varmaa@toolness.com>
parents:
78
diff
changeset
|
158 <dt id="pymonkey.Context.get_object_private"> |
228a56e7e793
Added docs for context.get_object_private().
Atul Varma <varmaa@toolness.com>
parents:
78
diff
changeset
|
159 <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> |
228a56e7e793
Added docs for context.get_object_private().
Atul Varma <varmaa@toolness.com>
parents:
78
diff
changeset
|
160 <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> |
228a56e7e793
Added docs for context.get_object_private().
Atul Varma <varmaa@toolness.com>
parents:
78
diff
changeset
|
161 when <cite>object</cite> was first created. If it doesn’t exist, <tt class="xref docutils literal"><span class="pre">None</span></tt> |
228a56e7e793
Added docs for context.get_object_private().
Atul Varma <varmaa@toolness.com>
parents:
78
diff
changeset
|
162 is returned.</p> |
85 | 163 <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 |
164 method returns the Python callable wrapped by <cite>object</cite>.</p> | |
90 | 165 <p>This functionality is useful if you want to securely represent |
166 Python objects in JS-land.</p> | |
79
228a56e7e793
Added docs for context.get_object_private().
Atul Varma <varmaa@toolness.com>
parents:
78
diff
changeset
|
167 </dd></dl> |
58
7a3461ccaf1d
Added documentation for Context methods get_runtime(), new_object(), and init_standard_classes().
Atul Varma <varmaa@toolness.com>
parents:
57
diff
changeset
|
168 |
7a3461ccaf1d
Added documentation for Context methods get_runtime(), new_object(), and init_standard_classes().
Atul Varma <varmaa@toolness.com>
parents:
57
diff
changeset
|
169 <dl class="method"> |
85 | 170 <dt id="pymonkey.Context.clear_object_private"> |
171 <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> | |
172 <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> | |
173 when <cite>object</cite> was first created. If it doesn’t exist, this | |
174 function returns nothing.</p> | |
175 <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 | |
176 method effectively “unbinds” the Python callable wrapped by | |
177 <cite>object</cite>. If <cite>object</cite> is later called, an exception will be | |
178 raised.</p> | |
179 </dd></dl> | |
180 | |
181 <dl class="method"> | |
90 | 182 <dt id="pymonkey.Context.evaluate_script"> |
183 <tt class="descname">evaluate_script</tt><big>(</big><em>globalobj</em>, <em>code</em>, <em>filename</em>, <em>lineno</em><big>)</big><a class="headerlink" href="#pymonkey.Context.evaluate_script" title="Permalink to this definition">¶</a></dt> | |
184 <dd><p>Evaluates the text <cite>code</cite> using <cite>globalobj</cite> as the global | |
185 object/scope.</p> | |
186 <p>It’s assumed that <cite>code</cite> is coming from the file named by <cite>filename</cite>; | |
187 the first line of <cite>code</cite> is assumed to be line number <cite>lineno</cite> of | |
188 <cite>filename</cite>. This metadata is very useful for debugging stack traces, | |
189 exceptions, and so forth.</p> | |
113
e616b4605db0
Added doctest for evaluate_script().
Atul Varma <varmaa@toolness.com>
parents:
112
diff
changeset
|
190 <p>For example:</p> |
e616b4605db0
Added doctest for evaluate_script().
Atul Varma <varmaa@toolness.com>
parents:
112
diff
changeset
|
191 <div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="n">cx</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> |
e616b4605db0
Added doctest for evaluate_script().
Atul Varma <varmaa@toolness.com>
parents:
112
diff
changeset
|
192 <span class="gp">>>> </span><span class="n">obj</span> <span class="o">=</span> <span class="n">cx</span><span class="o">.</span><span class="n">new_object</span><span class="p">()</span> |
e616b4605db0
Added doctest for evaluate_script().
Atul Varma <varmaa@toolness.com>
parents:
112
diff
changeset
|
193 <span class="gp">>>> </span><span class="n">cx</span><span class="o">.</span><span class="n">init_standard_classes</span><span class="p">(</span><span class="n">obj</span><span class="p">)</span> |
e616b4605db0
Added doctest for evaluate_script().
Atul Varma <varmaa@toolness.com>
parents:
112
diff
changeset
|
194 <span class="gp">>>> </span><span class="n">cx</span><span class="o">.</span><span class="n">evaluate_script</span><span class="p">(</span><span class="n">obj</span><span class="p">,</span> <span class="s">'5 * Math'</span><span class="p">,</span> <span class="s">'<string>'</span><span class="p">,</span> <span class="mf">1</span><span class="p">)</span> |
e616b4605db0
Added doctest for evaluate_script().
Atul Varma <varmaa@toolness.com>
parents:
112
diff
changeset
|
195 <span class="go">nan</span> |
e616b4605db0
Added doctest for evaluate_script().
Atul Varma <varmaa@toolness.com>
parents:
112
diff
changeset
|
196 </pre></div> |
e616b4605db0
Added doctest for evaluate_script().
Atul Varma <varmaa@toolness.com>
parents:
112
diff
changeset
|
197 </div> |
90 | 198 </dd></dl> |
199 | |
200 <dl class="method"> | |
201 <dt id="pymonkey.Context.call_function"> | |
202 <tt class="descname">call_function</tt><big>(</big><em>thisobj</em>, <em>func</em>, <em>args</em><big>)</big><a class="headerlink" href="#pymonkey.Context.call_function" title="Permalink to this definition">¶</a></dt> | |
203 <dd><p>Calls a JavaScript function.</p> | |
204 <p><cite>thisobj</cite> is an <a title="pymonkey.Object" class="reference" href="#pymonkey.Object"><tt class="xref docutils literal"><span class="pre">Object</span></tt></a> that will be used as the value | |
205 of <tt class="docutils literal"><span class="pre">this</span></tt> when the function executes, <cite>func</cite> is the | |
206 <a title="pymonkey.Function" class="reference" href="#pymonkey.Function"><tt class="xref docutils literal"><span class="pre">Function</span></tt></a> to execute, and <cite>args</cite> is a tuple of arguments | |
207 to pass to the function.</p> | |
112
2086377c0abe
Added doctest for call_function().
Atul Varma <varmaa@toolness.com>
parents:
111
diff
changeset
|
208 <p>For instance:</p> |
2086377c0abe
Added doctest for call_function().
Atul Varma <varmaa@toolness.com>
parents:
111
diff
changeset
|
209 <div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="n">cx</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> |
2086377c0abe
Added doctest for call_function().
Atul Varma <varmaa@toolness.com>
parents:
111
diff
changeset
|
210 <span class="gp">>>> </span><span class="n">obj</span> <span class="o">=</span> <span class="n">cx</span><span class="o">.</span><span class="n">new_object</span><span class="p">()</span> |
2086377c0abe
Added doctest for call_function().
Atul Varma <varmaa@toolness.com>
parents:
111
diff
changeset
|
211 <span class="gp">>>> </span><span class="n">cx</span><span class="o">.</span><span class="n">init_standard_classes</span><span class="p">(</span><span class="n">obj</span><span class="p">)</span> |
2086377c0abe
Added doctest for call_function().
Atul Varma <varmaa@toolness.com>
parents:
111
diff
changeset
|
212 <span class="gp">>>> </span><span class="n">Math</span> <span class="o">=</span> <span class="n">cx</span><span class="o">.</span><span class="n">get_property</span><span class="p">(</span><span class="n">obj</span><span class="p">,</span> <span class="s">'Math'</span><span class="p">)</span> |
2086377c0abe
Added doctest for call_function().
Atul Varma <varmaa@toolness.com>
parents:
111
diff
changeset
|
213 <span class="gp">>>> </span><span class="n">floor</span> <span class="o">=</span> <span class="n">cx</span><span class="o">.</span><span class="n">get_property</span><span class="p">(</span><span class="n">Math</span><span class="p">,</span> <span class="s">'floor'</span><span class="p">)</span> |
2086377c0abe
Added doctest for call_function().
Atul Varma <varmaa@toolness.com>
parents:
111
diff
changeset
|
214 <span class="gp">>>> </span><span class="n">cx</span><span class="o">.</span><span class="n">call_function</span><span class="p">(</span><span class="n">Math</span><span class="p">,</span> <span class="n">floor</span><span class="p">,</span> <span class="p">(</span><span class="mf">5.3</span><span class="p">,))</span> |
2086377c0abe
Added doctest for call_function().
Atul Varma <varmaa@toolness.com>
parents:
111
diff
changeset
|
215 <span class="go">5</span> |
2086377c0abe
Added doctest for call_function().
Atul Varma <varmaa@toolness.com>
parents:
111
diff
changeset
|
216 </pre></div> |
2086377c0abe
Added doctest for call_function().
Atul Varma <varmaa@toolness.com>
parents:
111
diff
changeset
|
217 </div> |
90 | 218 </dd></dl> |
219 | |
220 <dl class="method"> | |
58
7a3461ccaf1d
Added documentation for Context methods get_runtime(), new_object(), and init_standard_classes().
Atul Varma <varmaa@toolness.com>
parents:
57
diff
changeset
|
221 <dt id="pymonkey.Context.init_standard_classes"> |
7a3461ccaf1d
Added documentation for Context methods get_runtime(), new_object(), and init_standard_classes().
Atul Varma <varmaa@toolness.com>
parents:
57
diff
changeset
|
222 <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> |
7a3461ccaf1d
Added documentation for Context methods get_runtime(), new_object(), and init_standard_classes().
Atul Varma <varmaa@toolness.com>
parents:
57
diff
changeset
|
223 <dd>Defines the standard JavaScript classes on the given |
7a3461ccaf1d
Added documentation for Context methods get_runtime(), new_object(), and init_standard_classes().
Atul Varma <varmaa@toolness.com>
parents:
57
diff
changeset
|
224 <a title="pymonkey.Object" class="reference" href="#pymonkey.Object"><tt class="xref docutils literal"><span class="pre">Object</span></tt></a>, such as <tt class="docutils literal"><span class="pre">Array</span></tt>, <tt class="docutils literal"><span class="pre">eval</span></tt>, <tt class="docutils literal"><span class="pre">undefined</span></tt>, and |
7a3461ccaf1d
Added documentation for Context methods get_runtime(), new_object(), and init_standard_classes().
Atul Varma <varmaa@toolness.com>
parents:
57
diff
changeset
|
225 so forth. For more information, see the documentation to |
7a3461ccaf1d
Added documentation for Context methods get_runtime(), new_object(), and init_standard_classes().
Atul Varma <varmaa@toolness.com>
parents:
57
diff
changeset
|
226 <a class="reference" href="https://developer.mozilla.org/en/SpiderMonkey/JSAPI_Reference/JS_InitStandardClasses">JS_InitStandardClasses()</a>, |
7a3461ccaf1d
Added documentation for Context methods get_runtime(), new_object(), and init_standard_classes().
Atul Varma <varmaa@toolness.com>
parents:
57
diff
changeset
|
227 which this method wraps.</dd></dl> |
7a3461ccaf1d
Added documentation for Context methods get_runtime(), new_object(), and init_standard_classes().
Atul Varma <varmaa@toolness.com>
parents:
57
diff
changeset
|
228 |
51
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
229 </dd></dl> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
230 |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
231 <dl class="class"> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
232 <dt id="pymonkey.Runtime"> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
233 <em class="property"> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
234 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> |
53
2055d853b995
Added docs for pymonkey.Object.
Atul Varma <varmaa@toolness.com>
parents:
51
diff
changeset
|
235 <dd><p>Creates a new JavaScript runtime. JS objects created by the runtime |
2055d853b995
Added docs for pymonkey.Object.
Atul Varma <varmaa@toolness.com>
parents:
51
diff
changeset
|
236 may only interact with other JS objects of the same runtime.</p> |
51
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
237 <dl class="method"> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
238 <dt id="pymonkey.Runtime.new_context"> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
239 <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> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
240 <dd>Creates a new Context object and returns it. Contexts are best |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
241 conceptualized as threads of execution in a JS runtme; each one |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
242 has a program counter, a current exception state, and so |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
243 forth. JS objects may be freely accessed and changed by contexts |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
244 that are associated with the same JS runtime as the objects.</dd></dl> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
245 |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
246 </dd></dl> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
247 |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
248 </div> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
249 |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
250 |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
251 </div> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
252 </div> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
253 </div> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
254 <div class="sphinxsidebar"> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
255 <div class="sphinxsidebarwrapper"> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
256 <h4>Previous topic</h4> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
257 <p class="topless"><a href="index.html" |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
258 title="previous chapter">Pymonkey Documentation</a></p> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
259 <h3>This Page</h3> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
260 <ul class="this-page-menu"> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
261 <li><a href="_sources/pymonkey.txt" |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
262 rel="nofollow">Show Source</a></li> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
263 </ul> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
264 <div id="searchbox" style="display: none"> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
265 <h3>Quick search</h3> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
266 <form class="search" action="search.html" method="get"> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
267 <input type="text" name="q" size="18" /> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
268 <input type="submit" value="Go" /> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
269 <input type="hidden" name="check_keywords" value="yes" /> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
270 <input type="hidden" name="area" value="default" /> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
271 </form> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
272 <p class="searchtip" style="font-size: 90%"> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
273 Enter search terms or a module, class or function name. |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
274 </p> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
275 </div> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
276 <script type="text/javascript">$('#searchbox').show(0);</script> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
277 </div> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
278 </div> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
279 <div class="clearer"></div> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
280 </div> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
281 <div class="related"> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
282 <h3>Navigation</h3> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
283 <ul> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
284 <li class="right" style="margin-right: 10px"> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
285 <a href="genindex.html" title="General Index" |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
286 >index</a></li> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
287 <li class="right" > |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
288 <a href="modindex.html" title="Global Module Index" |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
289 >modules</a> |</li> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
290 <li class="right" > |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
291 <a href="index.html" title="Pymonkey Documentation" |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
292 >previous</a> |</li> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
293 <li><a href="index.html">Pymonkey v0.0.1 documentation</a> »</li> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
294 </ul> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
295 </div> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
296 <div class="footer"> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
297 © Copyright 2009, Atul Varma. |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
298 Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.6.2. |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
299 </div> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
300 </body> |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
301 </html> |