| Server IP : 107.13.46.68 / Your IP : 216.73.216.232 Web Server : Apache/2.4.58 (Ubuntu) System : Linux mariOS 6.8.0-51-generic #52-Ubuntu SMP PREEMPT_DYNAMIC Thu Dec 5 13:09:44 UTC 2024 x86_64 User : www-data ( 33) PHP Version : 8.3.6 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /usr/share/doc/python3-dialog/html/ |
Upload File : |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
<title>The DialogBackendVersion class — pythondialog 3.5.1 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="_static/classic.css" />
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/sphinx_highlight.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="pythondialog-specific exceptions" href="exceptions.html" />
<link rel="prev" title="The Dialog widgets" href="widgets.html" />
</head><body>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="exceptions.html" title="pythondialog-specific exceptions"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="widgets.html" title="The Dialog widgets"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">pythondialog 3.5.1 documentation</a> »</li>
<li class="nav-item nav-item-this"><a href="">The <code class="xref py py-class docutils literal notranslate"><span class="pre">DialogBackendVersion</span></code> class</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="the-dialogbackendversion-class">
<h1>The <code class="xref py py-class docutils literal notranslate"><span class="pre">DialogBackendVersion</span></code> class<a class="headerlink" href="#the-dialogbackendversion-class" title="Permalink to this heading">¶</a></h1>
<dl class="py class">
<dt class="sig sig-object py" id="dialog.DialogBackendVersion">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">dialog.</span></span><span class="sig-name descname"><span class="pre">DialogBackendVersion</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">dotted_part_or_str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">rest</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">''</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/dialog.html#DialogBackendVersion"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#dialog.DialogBackendVersion" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">BackendVersion</span></code></p>
<p>Class representing possible versions of the <strong class="program">dialog</strong> backend.</p>
<p>The purpose of this class is to make it easy to reliably compare
between versions of the <strong class="program">dialog</strong> backend. It encapsulates
the specific details of the backend versioning scheme to allow
eventual adaptations to changes in this scheme without affecting
external code.</p>
<p>The version is represented by two components in this class: the
<em class="dfn">dotted part</em> and the <em class="dfn">rest</em>. For instance, in the
<code class="docutils literal notranslate"><span class="pre">'1.2'</span></code> version string, the dotted part is <code class="docutils literal notranslate"><span class="pre">[1,</span> <span class="pre">2]</span></code> and the rest
is the empty string. However, in version <code class="docutils literal notranslate"><span class="pre">'1.2-20130902'</span></code>, the
dotted part is still <code class="docutils literal notranslate"><span class="pre">[1,</span> <span class="pre">2]</span></code>, but the rest is the string
<code class="docutils literal notranslate"><span class="pre">'-20130902'</span></code>.</p>
<p>Instances of this class can be created with the constructor by
specifying the dotted part and the rest. Alternatively, an instance
can be created from the corresponding version string (e.g.,
<code class="docutils literal notranslate"><span class="pre">'1.2-20130902'</span></code>) using the <a class="reference internal" href="#dialog.DialogBackendVersion.fromstring" title="dialog.DialogBackendVersion.fromstring"><code class="xref py py-meth docutils literal notranslate"><span class="pre">fromstring()</span></code></a> class method. This
is particularly useful with the result of
<code class="samp docutils literal notranslate"><em><span class="pre">d</span></em><span class="pre">.backend_version()</span></code>, where <em>d</em> is a <a class="reference internal" href="Dialog_class_overview.html#dialog.Dialog" title="dialog.Dialog"><code class="xref py py-class docutils literal notranslate"><span class="pre">Dialog</span></code></a>
instance. Actually, the main constructor detects if its first
argument is a string and calls <code class="xref py py-meth docutils literal notranslate"><span class="pre">fromstring()</span></code> in this case as a
convenience. Therefore, all of the following expressions are valid
to create a DialogBackendVersion instance:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">DialogBackendVersion</span><span class="p">([</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">])</span>
<span class="n">DialogBackendVersion</span><span class="p">([</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">],</span> <span class="s2">"-20130902"</span><span class="p">)</span>
<span class="n">DialogBackendVersion</span><span class="p">(</span><span class="s2">"1.2-20130902"</span><span class="p">)</span>
<span class="n">DialogBackendVersion</span><span class="o">.</span><span class="n">fromstring</span><span class="p">(</span><span class="s2">"1.2-20130902"</span><span class="p">)</span>
</pre></div>
</div>
<p>If <em>bv</em> is a <a class="reference internal" href="#dialog.DialogBackendVersion" title="dialog.DialogBackendVersion"><code class="xref py py-class docutils literal notranslate"><span class="pre">DialogBackendVersion</span></code></a> instance,
<code class="samp docutils literal notranslate"><span class="pre">str(</span><em><span class="pre">bv</span></em><span class="pre">)</span></code> is a string representing the same version (for
instance, <code class="docutils literal notranslate"><span class="pre">"1.2-20130902"</span></code>).</p>
<p>Two <a class="reference internal" href="#dialog.DialogBackendVersion" title="dialog.DialogBackendVersion"><code class="xref py py-class docutils literal notranslate"><span class="pre">DialogBackendVersion</span></code></a> instances can be compared with the
usual comparison operators (<code class="docutils literal notranslate"><span class="pre"><</span></code>, <code class="docutils literal notranslate"><span class="pre"><=</span></code>, <code class="docutils literal notranslate"><span class="pre">==</span></code>, <code class="docutils literal notranslate"><span class="pre">!=</span></code>, <code class="docutils literal notranslate"><span class="pre">>=</span></code>,
<code class="docutils literal notranslate"><span class="pre">></span></code>). The algorithm is designed so that the following order is
respected (after instanciation with <a class="reference internal" href="#dialog.DialogBackendVersion.fromstring" title="dialog.DialogBackendVersion.fromstring"><code class="xref py py-meth docutils literal notranslate"><span class="pre">fromstring()</span></code></a>):</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="mf">1.2</span> <span class="o"><</span> <span class="mf">1.2</span><span class="o">-</span><span class="mi">20130902</span> <span class="o"><</span> <span class="mf">1.2</span><span class="o">-</span><span class="mi">20130903</span> <span class="o"><</span> <span class="mf">1.2.0</span> <span class="o"><</span> <span class="mf">1.2.0</span><span class="o">-</span><span class="mi">20130902</span>
</pre></div>
</div>
<p>among other cases. Actually, the <em>dotted parts</em> are the primary keys
when comparing and <em>rest</em> strings act as secondary keys. <em>Dotted
parts</em> are compared with the standard Python list comparison and
<em>rest</em> strings using the standard Python string comparison.</p>
<dl class="py method">
<dt class="sig sig-object py" id="dialog.DialogBackendVersion.fromstring">
<em class="property"><span class="pre">classmethod</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">fromstring</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">s</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/dialog.html#DialogBackendVersion.fromstring"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#dialog.DialogBackendVersion.fromstring" title="Permalink to this definition">¶</a></dt>
<dd><p>Create a <a class="reference internal" href="#dialog.DialogBackendVersion" title="dialog.DialogBackendVersion"><code class="xref py py-class docutils literal notranslate"><span class="pre">DialogBackendVersion</span></code></a> instance from a <strong class="program">dialog</strong> version string.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>s</strong> (<a class="reference external" href="file:///usr/share/doc/python3/html/library/stdtypes.html#str" title="(in Python v3.11)"><em>str</em></a>) – a <strong class="program">dialog</strong> version string</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>a <a class="reference internal" href="#dialog.DialogBackendVersion" title="dialog.DialogBackendVersion"><code class="xref py py-class docutils literal notranslate"><span class="pre">DialogBackendVersion</span></code></a> instance representing the same
string</p>
</dd>
</dl>
<p>Notable exceptions:</p>
<blockquote>
<div><ul class="simple">
<li><p><a class="reference internal" href="exceptions.html#dialog.UnableToParseDialogBackendVersion" title="dialog.UnableToParseDialogBackendVersion"><code class="xref py py-exc docutils literal notranslate"><span class="pre">UnableToParseDialogBackendVersion</span></code></a></p></li>
<li><p><a class="reference internal" href="exceptions.html#dialog.PythonDialogReModuleError" title="dialog.PythonDialogReModuleError"><code class="xref py py-exc docutils literal notranslate"><span class="pre">PythonDialogReModuleError</span></code></a></p></li>
</ul>
</div></blockquote>
</dd></dl>
</dd></dl>
</section>
<div class="clearer"></div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<div>
<h3><a href="index.html">Table of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">The <code class="xref py py-class docutils literal notranslate"><span class="pre">DialogBackendVersion</span></code> class</a><ul>
<li><a class="reference internal" href="#dialog.DialogBackendVersion"><code class="docutils literal notranslate"><span class="pre">DialogBackendVersion</span></code></a><ul>
<li><a class="reference internal" href="#dialog.DialogBackendVersion.fromstring"><code class="docutils literal notranslate"><span class="pre">DialogBackendVersion.fromstring()</span></code></a></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div>
<h4>Previous topic</h4>
<p class="topless"><a href="widgets.html"
title="previous chapter">The <code class="xref py py-class docutils literal notranslate"><span class="pre">Dialog</span></code> widgets</a></p>
</div>
<div>
<h4>Next topic</h4>
<p class="topless"><a href="exceptions.html"
title="next chapter">pythondialog-specific exceptions</a></p>
</div>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/DialogBackendVersion.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
<input type="submit" value="Go" />
</form>
</div>
</div>
<script>document.getElementById('searchbox').style.display = "block"</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="exceptions.html" title="pythondialog-specific exceptions"
>next</a> |</li>
<li class="right" >
<a href="widgets.html" title="The Dialog widgets"
>previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">pythondialog 3.5.1 documentation</a> »</li>
<li class="nav-item nav-item-this"><a href="">The <code class="xref py py-class docutils literal notranslate"><span class="pre">DialogBackendVersion</span></code> class</a></li>
</ul>
</div>
<div class="footer" role="contentinfo">
© Copyright 2002-2023, Florent Rougon, Thomas Dickey.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 5.3.0.
</div>
</body>
</html>