180 lines
9.2 KiB
HTML
180 lines
9.2 KiB
HTML
|
|
<!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="X-UA-Compatible" content="IE=Edge" />
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
<title>Main Module — Joy VUI 0.1 documentation</title>
|
|
<link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
|
|
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
|
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></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>
|
|
<script type="text/javascript" src="_static/language_data.js"></script>
|
|
<link rel="index" title="Index" href="genindex.html" />
|
|
<link rel="search" title="Search" href="search.html" />
|
|
<link rel="next" title="Display" href="display.html" />
|
|
<link rel="prev" title="Core" href="core.html" />
|
|
|
|
<link rel="stylesheet" href="_static/custom.css" type="text/css" />
|
|
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
|
|
|
|
</head><body>
|
|
|
|
|
|
<div class="document">
|
|
<div class="documentwrapper">
|
|
<div class="bodywrapper">
|
|
<div class="body" role="main">
|
|
|
|
<span class="target" id="module-joy.vui.main"></span><div class="section" id="main-module">
|
|
<h1>Main Module<a class="headerlink" href="#main-module" title="Permalink to this headline">¶</a></h1>
|
|
<p>Pulls everything together.</p>
|
|
<dl class="class">
|
|
<dt id="joy.vui.main.FileFaker">
|
|
<em class="property">class </em><code class="descclassname">joy.vui.main.</code><code class="descname">FileFaker</code><span class="sig-paren">(</span><em>log</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/joy/vui/main.html#FileFaker"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#joy.vui.main.FileFaker" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Pretends to be a file object but writes to log instead.</p>
|
|
<dl class="method">
|
|
<dt id="joy.vui.main.FileFaker.write">
|
|
<code class="descname">write</code><span class="sig-paren">(</span><em>text</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/joy/vui/main.html#FileFaker.write"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#joy.vui.main.FileFaker.write" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Write text to log.</p>
|
|
</dd></dl>
|
|
|
|
</dd></dl>
|
|
|
|
<dl class="function">
|
|
<dt id="joy.vui.main.error_guard">
|
|
<code class="descclassname">joy.vui.main.</code><code class="descname">error_guard</code><span class="sig-paren">(</span><em>loop</em>, <em>n=10</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/joy/vui/main.html#error_guard"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#joy.vui.main.error_guard" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Run a loop function, retry for <code class="docutils literal notranslate"><span class="pre">n</span></code> exceptions.
|
|
Prints tracebacks on <code class="docutils literal notranslate"><span class="pre">sys.stderr</span></code>.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="function">
|
|
<dt id="joy.vui.main.init">
|
|
<code class="descclassname">joy.vui.main.</code><code class="descname">init</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/joy/vui/main.html#init"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#joy.vui.main.init" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Initialize the system.</p>
|
|
<ul class="simple">
|
|
<li>Init PyGame</li>
|
|
<li>Create main window</li>
|
|
<li>Start the PyGame clock</li>
|
|
<li>Set the event mask</li>
|
|
<li>Create the PersistTask</li>
|
|
</ul>
|
|
</dd></dl>
|
|
|
|
<dl class="function">
|
|
<dt id="joy.vui.main.init_context">
|
|
<code class="descclassname">joy.vui.main.</code><code class="descname">init_context</code><span class="sig-paren">(</span><em>screen</em>, <em>clock</em>, <em>pt</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/joy/vui/main.html#init_context"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#joy.vui.main.init_context" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>More initialization</p>
|
|
<ul class="simple">
|
|
<li>Create the Joy dictionary</li>
|
|
<li>Create the Display</li>
|
|
<li>Open the log, menu, and scratch text viewers, and the stack pickle</li>
|
|
<li>Start the main loop</li>
|
|
<li>Create the World object</li>
|
|
<li>Register PersistTask and World message handlers with the Display</li>
|
|
<li>Load user function definitions.</li>
|
|
</ul>
|
|
</dd></dl>
|
|
|
|
<dl class="function">
|
|
<dt id="joy.vui.main.load_definitions">
|
|
<code class="descclassname">joy.vui.main.</code><code class="descname">load_definitions</code><span class="sig-paren">(</span><em>pt</em>, <em>dictionary</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/joy/vui/main.html#load_definitions"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#joy.vui.main.load_definitions" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Load definitions from <code class="docutils literal notranslate"><span class="pre">definitions.txt</span></code>.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="function">
|
|
<dt id="joy.vui.main.load_primitives">
|
|
<code class="descclassname">joy.vui.main.</code><code class="descname">load_primitives</code><span class="sig-paren">(</span><em>home</em>, <em>name_space</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/joy/vui/main.html#load_primitives"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#joy.vui.main.load_primitives" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Load primitives from <code class="docutils literal notranslate"><span class="pre">library.py</span></code>.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="function">
|
|
<dt id="joy.vui.main.main">
|
|
<code class="descclassname">joy.vui.main.</code><code class="descname">main</code><span class="sig-paren">(</span><em>screen</em>, <em>clock</em>, <em>pt</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/joy/vui/main.html#main"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#joy.vui.main.main" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Main function.</p>
|
|
<ul class="simple">
|
|
<li>Call <code class="docutils literal notranslate"><span class="pre">init_context()</span></code></li>
|
|
<li>Load primitives</li>
|
|
<li>Create an <code class="docutils literal notranslate"><span class="pre">evaluate</span></code> function that lets you just eval some Python code</li>
|
|
<li>Redirect <code class="docutils literal notranslate"><span class="pre">stdout</span></code> to the log using a <code class="docutils literal notranslate"><span class="pre">FileFaker</span></code> object, and…</li>
|
|
<li>Start the main loop.</li>
|
|
</ul>
|
|
</dd></dl>
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
|
|
<div class="sphinxsidebarwrapper">
|
|
<h1 class="logo"><a href="index.html">Joy VUI</a></h1>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h3>Navigation</h3>
|
|
<p class="caption"><span class="caption-text">Contents:</span></p>
|
|
<ul class="current">
|
|
<li class="toctree-l1"><a class="reference internal" href="core.html">Core</a></li>
|
|
<li class="toctree-l1 current"><a class="current reference internal" href="#">Main Module</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="display.html">Display</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="viewer.html">Viewer</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="text_viewer.html">Text Viewer</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="stack_viewer.html">Stack Viewer</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="persist_task.html">Persist Task</a></li>
|
|
</ul>
|
|
|
|
<div class="relations">
|
|
<h3>Related Topics</h3>
|
|
<ul>
|
|
<li><a href="index.html">Documentation overview</a><ul>
|
|
<li>Previous: <a href="core.html" title="previous chapter">Core</a></li>
|
|
<li>Next: <a href="display.html" title="next chapter">Display</a></li>
|
|
</ul></li>
|
|
</ul>
|
|
</div>
|
|
<div id="searchbox" style="display: none" role="search">
|
|
<h3>Quick search</h3>
|
|
<div class="searchformwrapper">
|
|
<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>
|
|
</div>
|
|
</div>
|
|
<script type="text/javascript">$('#searchbox').show(0);</script>
|
|
</div>
|
|
</div>
|
|
<div class="clearer"></div>
|
|
</div>
|
|
<div class="footer">
|
|
©2019, Simon Forman.
|
|
|
|
|
|
|
Powered by <a href="http://sphinx-doc.org/">Sphinx 1.8.5</a>
|
|
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.9</a>
|
|
|
|
|
|
|
<a href="_sources/main.rst.txt"
|
|
rel="nofollow">Page source</a>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</body>
|
|
</html> |