File: value.html

package info (click to toggle)
pyelemental 1.2.0-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 344 kB
  • ctags: 244
  • sloc: cpp: 1,847; xml: 613; python: 46; makefile: 28; sh: 11
file content (3 lines) | stat: -rw-r--r-- 14,588 bytes parent folder | download | duplicates (2)
1
2
3
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!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="Content-Type" content="text/html; charset=utf-8" /><title>Basic classes and data</title><meta name="generator" content="DocBook XSL Stylesheets V1.70.1" /><link rel="start" href="index.html" title="pyElemental reference" /><link rel="up" href="index.html" title="pyElemental reference" /><link rel="prev" href="index.html" title="pyElemental reference" /><link rel="next" href="value-types.html" title="Value types" /><link rel="copyright" href="ln-legalnotice.html" title="Legal Notice" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Basic classes and data</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="index.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="value-types.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="value"></a>Basic classes and data</h2></div></div></div><p>This attribute is available at the module level:</p><div class="variablelist"><dl><dt><span class="term"><code xmlns="" class="fieldsynopsis"><span class="type">float </span><strong class="varname">STANDARD_TEMPERATURE</strong></code> — <em xmlns="">read-only</em></span></dt><dd><p>The standard temperature, in Kelvin, as defined by IUPAC.</p></dd></dl></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="qualifiers"></a>Qualifiers</h3></div></div></div><p>A qualifier is a qualification of the meaning of a value. These read-only <span class="type">int</span> attributes at the module level are valid as qualifiers:</p><div class="variablelist"><table border="0"><col align="left" valign="top" /><tbody><tr><td><span class="term"><code class="varname">Q_NEUTRAL</code></span></td><td>Indicates a presumably valid value.</td></tr><tr><td><span class="term"><code class="varname">Q_UNK</code></span></td><td>Indicates that a value is unknown or unavailable.</td></tr><tr><td><span class="term"><code class="varname">Q_NA</code></span></td><td>Indicates that a value is not applicable for an element.</td></tr><tr><td><span class="term"><code class="varname">Q_EST</code></span></td><td>Indicates that a value is estimated or calculated.</td></tr><tr><td><span class="term"><code class="varname">Q_CA</code></span></td><td>Indicates that a value is approximate.</td></tr><tr><td><span class="term"><code class="varname">Q_ISO</code></span></td><td>Indicates a value for the most stable isotope of an element.</td></tr></tbody></table></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="class-color"></a>class <code class="classname">color</code></h3></div></div></div><p>A color description.</p><div class="variablelist"><dl><dt><span class="term"><code xmlns="" class="constructorsynopsis"><strong class="methodname">color</strong> ([<span class="methodparam"><span class="type">float </span><var class="parameter">red</var><span class="initializer">=0.0</span></span>, <span class="methodparam"><span class="type">float </span><var class="parameter">green</var><span class="initializer">=0.0</span></span>, <span class="methodparam"><span class="type">float </span><var class="parameter">blue</var><span class="initializer">=0.0</span></span>])</code></span></dt><dd><p>Initializes a color with optional red, green, and blue component percentages.</p></dd><dt><span class="term"><code xmlns="" class="fieldsynopsis"><span class="type">float </span><strong class="varname">red</strong></code><br /></span><span class="term"><code xmlns="" class="fieldsynopsis"><span class="type">float </span><strong class="varname">green</strong></code><br /></span><span class="term"><code xmlns="" class="fieldsynopsis"><span class="type">float </span><strong class="varname">blue</strong></code></span></dt><dd><p>The red, green, and blue components of the color in the RGB space, each between 0.0 and 1.0.</p></dd><dt><span class="term"><code xmlns="" class="fieldsynopsis"><span class="type">float </span><strong class="varname">luminance</strong></code> — <em xmlns="">read-only</em></span></dt><dd><p>The luminous intensity of the color, between 0.0 and 1.0.</p></dd><dt><span class="term"><code xmlns="" class="fieldsynopsis"><span class="type">color </span><strong class="varname">compliment</strong></code> — <em xmlns="">read-only</em></span></dt><dd><p>A grayscale color complimentary in luminance to this color.</p></dd><dt><span class="term"><code xmlns="" class="fieldsynopsis"><span class="type">str </span><strong class="varname">hex_spec</strong></code> — <em xmlns="">read-only</em></span></dt><dd><p>A hexadecimal specification of the color ("#rrggbb" format).</p></dd><dt><span class="term"><code xmlns="" class="methodsynopsis"><span class="type">color </span><strong class="methodname">composite</strong> (<span class="methodparam"><span class="type">color </span><var class="parameter">other</var></span>, <span class="methodparam"><span class="type">float </span><var class="parameter">alpha</var></span>)</code></span></dt><dd><p>Returns a composite of this color and another.</p><div class="variablelist"><table border="0"><col align="left" valign="top" /><tbody><tr><td><span class="term"><em class="parameter"><code>other</code></em></span></td><td>A color with which this color will be composited.</td></tr><tr><td><span class="term"><em class="parameter"><code>alpha</code></em></span></td><td>The level of the other color in the composite, between 0.0 and 1.0.</td></tr></tbody></table></div></dd></dl></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="class-EntriesView"></a>class <code class="classname">EntriesView</code></h3></div></div></div><p>An interface for the display of value entries.</p><p>Instances of this class cannot be created directly. For basic text output, use an <code class="classname"><a href="value.html#class-EntriesStream">EntriesStream</a></code>. For other needs, define a subclass of this class with <code class="methodname">header</code> and <code class="methodname">entry</code> methods.</p><div class="variablelist"><dl><dt><span class="term"><code xmlns="" class="methodsynopsis"><span class="void">null </span><strong class="methodname">header</strong> (<span class="methodparam"><span class="type">unicode </span><var class="parameter">category</var></span>)</code></span></dt><dd><p>Displays a category header. Raises <code class="exceptionname">NotImplementedError</code>; must be implemented in subclasses.</p><div class="variablelist"><table border="0"><col align="left" valign="top" /><tbody><tr><td><span class="term"><em class="parameter"><code>category</code></em></span></td><td>The name of the category.</td></tr></tbody></table></div></dd><dt><span class="term"><code xmlns="" class="methodsynopsis"><span class="void">null </span><strong class="methodname">entry</strong> (<span class="methodparam"><span class="type">unicode </span><var class="parameter">name</var></span>, <span class="methodparam"><span class="type">unicode </span><var class="parameter">value</var></span>[, <span class="methodparam"><span class="type">unicode </span><var class="parameter">tip</var></span>])</code></span></dt><dd><p>Displays a single value entry. Raises <code class="exceptionname">NotImplementedError</code>; must be implemented in subclasses.</p><div class="variablelist"><table border="0"><col align="left" valign="top" /><tbody><tr><td><span class="term"><em class="parameter"><code>name</code></em></span></td><td>The name of the entry.</td></tr><tr><td><span class="term"><em class="parameter"><code>value</code></em></span></td><td>A localized string representation of the value of the entry.</td></tr><tr><td><span class="term"><em class="parameter"><code>tip</code></em></span></td><td>Qualifying information, if any, to be displayed as a tip.</td></tr></tbody></table></div></dd></dl></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="class-EntriesStream"></a>class <code class="classname">EntriesStream</code></h3></div></div></div><p>An adapter for the display of value entries on an output stream.</p><div class="variablelist"><dl><dt><span class="term"><code xmlns="" class="constructorsynopsis"><strong class="methodname">EntriesStream</strong> (<span class="methodparam"><span class="type">file </span><var class="parameter">file</var></span>)</code></span></dt><dd><p>Initializes an EntriesStream with a file or file-like object such as <code class="varname">sys.stdout</code>.</p></dd><dt><span class="term"><code xmlns="" class="methodsynopsis"><span class="void">null </span><strong class="methodname">header</strong> (<span class="methodparam"><span class="type">unicode </span><var class="parameter">category</var></span>)</code></span></dt><dd><p>Implemented here; see <code class="classname"><a href="value.html#class-EntriesView">EntriesView</a></code>.</p></dd><dt><span class="term"><code xmlns="" class="methodsynopsis"><span class="void">null </span><strong class="methodname">entry</strong> (<span class="methodparam"><span class="type">unicode </span><var class="parameter">name</var></span>, <span class="methodparam"><span class="type">unicode </span><var class="parameter">value</var></span>[, <span class="methodparam"><span class="type">unicode </span><var class="parameter">tip</var></span>])</code></span></dt><dd><p>Implemented here; see <code class="classname"><a href="value.html#class-EntriesView">EntriesView</a></code>.</p></dd></dl></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="class-value_base"></a>class <code class="classname">value_base</code></h3></div></div></div><p>A base class for qualified values.</p><p>Instances of this class cannot be created directly. This class and its subclasses support the <code class="methodname">str</code> and <code class="methodname">cmp</code> functions.</p><div class="variablelist"><dl><dt><span class="term"><code xmlns="" class="fieldsynopsis"><span class="type">int </span><strong class="varname">qualifier</strong></code></span></dt><dd><p>The qualification of the value's meaning. Must be equal to one of the <a href="value.html#qualifiers" title="Qualifiers">qualifier constants</a>.</p></dd><dt><span class="term"><code xmlns="" class="fieldsynopsis"><span class="type">bool </span><strong class="varname">has_value</strong></code> — <em xmlns="">read-only</em></span></dt><dd><p>Whether the value is defined.</p></dd><dt><span class="term"><code xmlns="" class="methodsynopsis"><span class="type">unicode </span><strong class="methodname">get_string</strong> ([<span class="methodparam"><span class="type">unicode </span><var class="parameter">format</var></span>])</code></span></dt><dd><p>Returns a localized text representation of the value.</p><div class="variablelist"><table border="0"><col align="left" valign="top" /><tbody><tr><td><span class="term"><em class="parameter"><code>format</code></em></span></td><td>An optional compose-style format string with which to output the value. If not otherwise specified, the value is argument reference "%1".</td></tr></tbody></table></div></dd><dt><span class="term"><code xmlns="" class="fieldsynopsis"><span class="type">unicode </span><strong class="varname">tip</strong></code> — <em xmlns="">read-only</em></span></dt><dd><p>A localized message to be displayed as a tooltip.</p></dd><dt><span class="term"><code xmlns="" class="methodsynopsis"><span class="void">null </span><strong class="methodname">make_entry</strong> (<span class="methodparam"><span class="type">EntriesView </span><var class="parameter">view</var></span>, <span class="methodparam"><span class="type">unicode </span><var class="parameter">name</var></span>[, <span class="methodparam"><span class="type">unicode </span><var class="parameter">format</var></span>])</code></span></dt><dd><p>Possibly adds the result of <code class="methodname">get_string</code> to an <a href="value.html#class-EntriesView" title="class EntriesView"><code class="classname">EntriesView</code></a>. An entry will only be made if the value is defined or belongs to an always-output class.</p><div class="variablelist"><table border="0"><col align="left" valign="top" /><tbody><tr><td><span class="term"><em class="parameter"><code>view</code></em></span></td><td>The <code class="classname">EntriesView</code> to be populated.</td></tr><tr><td><span class="term"><em class="parameter"><code>name</code></em></span></td><td>The name of the value to be passed.</td></tr><tr><td><span class="term"><em class="parameter"><code>format</code></em></span></td><td>An optional compose-style format for <code class="methodname">get_string</code>.</td></tr></tbody></table></div></dd></dl></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="class-color_value_base"></a>class <code class="classname">color_value_base</code></h3></div></div></div><p>A base class for qualified values which have representative colors. Inherits from <code class="classname"><a href="value.html#class-value_base">value_base</a></code>.</p><div class="variablelist"><dl><dt><span class="term"><code xmlns="" class="fieldsynopsis"><span class="type">color </span><strong class="varname">color</strong></code> — <em xmlns="">read-only</em></span></dt><dd><p>A <code class="classname"><a href="value.html#class-color">color</a></code> representing the value.</p></dd></dl></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="index.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="value-types.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">pyElemental reference </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Value types</td></tr></table></div></body></html>