193 lines
8.3 KiB
HTML
193 lines
8.3 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>xml_reader module — APED (API-Documentation) V2.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="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">
|
||
|
||
<div class="section" id="module-xml_reader">
|
||
<span id="xml-reader-module"></span><h1>xml_reader module<a class="headerlink" href="#module-xml_reader" title="Permalink to this headline">¶</a></h1>
|
||
<dl class="class">
|
||
<dt id="xml_reader.Xml_reader">
|
||
<em class="property">class </em><code class="descclassname">xml_reader.</code><code class="descname">Xml_reader</code><span class="sig-paren">(</span><em>xml_path: str</em>, <em>xsd_path: str</em><span class="sig-paren">)</span><a class="headerlink" href="#xml_reader.Xml_reader" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
|
||
<p>reader for the XML configuration</p>
|
||
<dl class="method">
|
||
<dt id="xml_reader.Xml_reader.get_buffer_size">
|
||
<code class="descname">get_buffer_size</code><span class="sig-paren">(</span><em>device_name: str</em><span class="sig-paren">)</span> → int<a class="headerlink" href="#xml_reader.Xml_reader.get_buffer_size" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>method to read the buffer size of a given device from the XML</p>
|
||
<table class="docutils field-list" frame="void" rules="none">
|
||
<col class="field-name" />
|
||
<col class="field-body" />
|
||
<tbody valign="top">
|
||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>device_name</strong> (<em>str</em>) – the name of a device</td>
|
||
</tr>
|
||
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><code class="xref py py-exc docutils literal notranslate"><span class="pre">NameError</span></code> – device_name will be checked against the config XML</td>
|
||
</tr>
|
||
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">the buffer size for the device</td>
|
||
</tr>
|
||
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">int</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="xml_reader.Xml_reader.get_device_names">
|
||
<code class="descname">get_device_names</code><span class="sig-paren">(</span><span class="sig-paren">)</span> → list<a class="headerlink" href="#xml_reader.Xml_reader.get_device_names" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>lists all the device names from the config XML</p>
|
||
<table class="docutils field-list" frame="void" rules="none">
|
||
<col class="field-name" />
|
||
<col class="field-body" />
|
||
<tbody valign="top">
|
||
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">all device names as strings</td>
|
||
</tr>
|
||
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">list</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="xml_reader.Xml_reader.get_port">
|
||
<code class="descname">get_port</code><span class="sig-paren">(</span><em>device_name: str</em><span class="sig-paren">)</span> → dict<a class="headerlink" href="#xml_reader.Xml_reader.get_port" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>returns the information about a port of a given device</p>
|
||
<table class="docutils field-list" frame="void" rules="none">
|
||
<col class="field-name" />
|
||
<col class="field-body" />
|
||
<tbody valign="top">
|
||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>device_name</strong> (<em>str</em>) – the name of a device</td>
|
||
</tr>
|
||
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">{‘protocol’, [list: pins]}</td>
|
||
</tr>
|
||
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">dict</td>
|
||
</tr>
|
||
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><code class="xref py py-exc docutils literal notranslate"><span class="pre">NameError</span></code> – device_name will be checked against the config XML</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="xml_reader.Xml_reader.set_root">
|
||
<code class="descname">set_root</code><span class="sig-paren">(</span><em>xml_path: str</em><span class="sig-paren">)</span><a class="headerlink" href="#xml_reader.Xml_reader.set_root" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>method to read and store the root element from the XML file</p>
|
||
<table class="docutils field-list" frame="void" rules="none">
|
||
<col class="field-name" />
|
||
<col class="field-body" />
|
||
<tbody valign="top">
|
||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>xml_path</strong> (<em>str</em>) – the path to the XML file</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="xml_reader.Xml_reader.validate">
|
||
<code class="descname">validate</code><span class="sig-paren">(</span><em>xml_path: str</em>, <em>xsd_path: str</em><span class="sig-paren">)</span> → bool<a class="headerlink" href="#xml_reader.Xml_reader.validate" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>validates a XML by using a XSD file</p>
|
||
<table class="docutils field-list" frame="void" rules="none">
|
||
<col class="field-name" />
|
||
<col class="field-body" />
|
||
<tbody valign="top">
|
||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
|
||
<li><strong>xml_path</strong> (<em>str</em>) – the path to the XML file</li>
|
||
<li><strong>xsd_path</strong> (<em>str</em>) – the path to the XSD file</li>
|
||
</ul>
|
||
</td>
|
||
</tr>
|
||
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">result of the validation</p>
|
||
</td>
|
||
</tr>
|
||
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">bool</p>
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</dd></dl>
|
||
|
||
</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">APED (API-Documentation)</a></h1>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<h3>Navigation</h3>
|
||
|
||
<div class="relations">
|
||
<h3>Related Topics</h3>
|
||
<ul>
|
||
<li><a href="index.html">Documentation overview</a><ul>
|
||
</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">
|
||
©2021, Paul Lödige.
|
||
|
||
|
|
||
Powered by <a href="http://sphinx-doc.org/">Sphinx 1.8.4</a>
|
||
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
|
||
|
||
|
|
||
<a href="_sources/xml_reader.rst.txt"
|
||
rel="nofollow">Page source</a>
|
||
</div>
|
||
|
||
|
||
|
||
|
||
</body>
|
||
</html> |