Python Library State Machine
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6. <title>Welcome to state_machine’s documentation! &#8212; state_machine documentation</title>
  7. <link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
  8. <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
  9. <script type="text/javascript">
  10. var DOCUMENTATION_OPTIONS = {
  11. URL_ROOT: './',
  12. VERSION: '',
  13. COLLAPSE_INDEX: false,
  14. FILE_SUFFIX: '.html',
  15. HAS_SOURCE: true,
  16. SOURCELINK_SUFFIX: '.txt'
  17. };
  18. </script>
  19. <script type="text/javascript" src="_static/jquery.js"></script>
  20. <script type="text/javascript" src="_static/underscore.js"></script>
  21. <script type="text/javascript" src="_static/doctools.js"></script>
  22. <link rel="index" title="Index" href="genindex.html" />
  23. <link rel="search" title="Search" href="search.html" />
  24. <link rel="stylesheet" href="_static/custom.css" type="text/css" />
  25. <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
  26. </head>
  27. <body>
  28. <div class="document">
  29. <div class="documentwrapper">
  30. <div class="bodywrapper">
  31. <div class="body" role="main">
  32. <div class="section" id="module-state_machine">
  33. <span id="welcome-to-state-machine-s-documentation"></span><h1>Welcome to state_machine’s documentation!<a class="headerlink" href="#module-state_machine" title="Permalink to this headline">¶</a></h1>
  34. <div class="section" id="state-machine-state-machine">
  35. <h2>state_machine (State Machine)<a class="headerlink" href="#state-machine-state-machine" title="Permalink to this headline">¶</a></h2>
  36. <p><strong>Author:</strong></p>
  37. <ul class="simple">
  38. <li>Dirk Alders &lt;<a class="reference external" href="mailto:sudo-dirk&#37;&#52;&#48;mount-mockery&#46;de">sudo-dirk<span>&#64;</span>mount-mockery<span>&#46;</span>de</a>&gt;</li>
  39. </ul>
  40. <p><strong>Description:</strong></p>
  41. <blockquote>
  42. <div>This Module helps implementing state machines.</div></blockquote>
  43. <p><strong>Submodules:</strong></p>
  44. <ul class="simple">
  45. <li><a class="reference internal" href="#state_machine.state_machine" title="state_machine.state_machine"><code class="xref py py-class docutils literal"><span class="pre">state_machine.state_machine</span></code></a></li>
  46. </ul>
  47. <p><strong>Unittest:</strong></p>
  48. <blockquote>
  49. <div>See also the <a class="reference download internal" href="_downloads/unittest.pdf" download=""><code class="xref download docutils literal"><span class="pre">unittest</span></code></a> documentation.</div></blockquote>
  50. <p><strong>Module Documentation:</strong></p>
  51. <dl class="class">
  52. <dt id="state_machine.state_machine">
  53. <em class="property">class </em><code class="descclassname">state_machine.</code><code class="descname">state_machine</code><span class="sig-paren">(</span><em>default_state</em>, <em>log_lvl</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#state_machine.state_machine" title="Permalink to this definition">¶</a></dt>
  54. <dd><table class="docutils field-list" frame="void" rules="none">
  55. <col class="field-name" />
  56. <col class="field-body" />
  57. <tbody valign="top">
  58. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
  59. <li><strong>default_state</strong> – The default state which is set on initialisation.</li>
  60. <li><strong>log_lvl</strong> – The log level, this Module logs to (see Loging-Levels of Module <code class="xref py py-mod docutils literal"><span class="pre">logging</span></code>)</li>
  61. </ul>
  62. </td>
  63. </tr>
  64. </tbody>
  65. </table>
  66. <div class="admonition note">
  67. <p class="first admonition-title">Note</p>
  68. <p class="last">Additional keyword parameters well be stored as varibles of the instance (e.g. to give variables or methods for transition condition calculation).</p>
  69. </div>
  70. <p>A state machine class can be created by deriving it from this class. The transitions are defined by overriding the variable <cite>TRANSITIONS</cite>.
  71. This Variable is a dictionary, where the key is the start-state and the content is a tuple or list of transitions. Each transition is a tuple or list
  72. including the following information: (condition-method (str), transition-time (number), target_state (str)).</p>
  73. <div class="admonition note">
  74. <p class="first admonition-title">Note</p>
  75. <p class="last">The condition-method needs to be implemented as part of the new class.</p>
  76. </div>
  77. <div class="admonition note">
  78. <p class="first admonition-title">Note</p>
  79. <p class="last">It is usefull to define the states as variables of this class.</p>
  80. </div>
  81. <p><strong>Example:</strong></p>
  82. <div class="highlight-default"><div class="highlight"><pre><span></span><span class="ch">#!/usr/bin/env python</span>
  83. <span class="c1"># -*- coding: UTF-8 -*-</span>
  84. <span class="kn">import</span> <span class="nn">logging</span>
  85. <span class="kn">import</span> <span class="nn">os</span>
  86. <span class="kn">import</span> <span class="nn">sys</span>
  87. <span class="kn">import</span> <span class="nn">report</span>
  88. <span class="kn">import</span> <span class="nn">state_machine</span>
  89. <span class="n">logger</span> <span class="o">=</span> <span class="n">logging</span><span class="o">.</span><span class="n">getLogger</span><span class="p">(</span><span class="s1">&#39;__example__&#39;</span><span class="p">)</span>
  90. <span class="n">report</span><span class="o">.</span><span class="n">consoleLoggingConfigure</span><span class="p">(</span><span class="n">loggers</span><span class="o">=</span><span class="p">[</span><span class="n">state_machine</span><span class="o">.</span><span class="n">logger_name</span><span class="p">,</span> <span class="s1">&#39;__example__&#39;</span><span class="p">,</span> <span class="p">],</span> <span class="n">level</span><span class="o">=</span><span class="s1">&#39;DEBUG&#39;</span><span class="p">)</span>
  91. <span class="k">class</span> <span class="nc">trafic_lights</span><span class="p">(</span><span class="n">state_machine</span><span class="o">.</span><span class="n">state_machine</span><span class="p">):</span>
  92. <span class="n">LOG_PREFIX</span> <span class="o">=</span> <span class="s1">&#39;TraficLights:&#39;</span>
  93. <span class="n">STATE_RED</span> <span class="o">=</span> <span class="s1">&#39;state_red&#39;</span>
  94. <span class="n">STATE_GREEN</span> <span class="o">=</span> <span class="s1">&#39;state_green&#39;</span>
  95. <span class="n">CONDITION_TRUE</span> <span class="o">=</span> <span class="s1">&#39;condition_true&#39;</span>
  96. <span class="n">CONDITION_PEDASTRIAN_REQUEST</span> <span class="o">=</span> <span class="s1">&#39;condition_pedastrian_request&#39;</span>
  97. <span class="n">TRANSITIONS</span> <span class="o">=</span> <span class="p">{</span>
  98. <span class="n">STATE_RED</span><span class="p">:</span> <span class="p">(</span>
  99. <span class="p">(</span><span class="n">CONDITION_PEDASTRIAN_REQUEST</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="n">STATE_GREEN</span><span class="p">),</span>
  100. <span class="p">),</span>
  101. <span class="n">STATE_GREEN</span><span class="p">:</span> <span class="p">(</span>
  102. <span class="p">(</span><span class="n">CONDITION_TRUE</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="n">STATE_RED</span><span class="p">),</span>
  103. <span class="p">)</span>
  104. <span class="p">}</span>
  105. <span class="k">def</span> <span class="nf">condition_true</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
  106. <span class="k">return</span> <span class="kc">True</span>
  107. <span class="k">def</span> <span class="nf">set_padestrian_request</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
  108. <span class="n">logger</span><span class="o">.</span><span class="n">log</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">__log_lvl__</span><span class="p">,</span> <span class="s1">&#39;</span><span class="si">%s</span><span class="s1"> Pedestrian gave state change request.&#39;</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">LOG_PREFIX</span><span class="p">)</span>
  109. <span class="bp">self</span><span class="o">.</span><span class="n">pedastrian_request</span> <span class="o">=</span> <span class="kc">True</span>
  110. <span class="k">def</span> <span class="nf">condition_pedastrian_request</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
  111. <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">pedastrian_request</span>
  112. <span class="n">sm</span> <span class="o">=</span> <span class="n">trafic_lights</span><span class="p">(</span><span class="n">trafic_lights</span><span class="o">.</span><span class="n">STATE_RED</span><span class="p">,</span> <span class="n">logging</span><span class="o">.</span><span class="n">INFO</span><span class="p">,</span> <span class="n">pedastrian_request</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
  113. <span class="n">sm</span><span class="o">.</span><span class="n">register_state_change_callback</span><span class="p">(</span><span class="n">sm</span><span class="o">.</span><span class="n">STATE_GREEN</span><span class="p">,</span> <span class="n">sm</span><span class="o">.</span><span class="n">CONDITION_PEDASTRIAN_REQUEST</span><span class="p">,</span> <span class="n">logger</span><span class="o">.</span><span class="n">info</span><span class="p">,</span> <span class="s1">&#39;Callback information: Traffic light had been changed to green caused by pedastrian request&#39;</span><span class="p">)</span>
  114. <span class="k">while</span> <span class="ow">not</span> <span class="n">sm</span><span class="o">.</span><span class="n">previous_state_was</span><span class="p">(</span><span class="n">sm</span><span class="o">.</span><span class="n">STATE_GREEN</span><span class="p">):</span>
  115. <span class="k">if</span> <span class="n">sm</span><span class="o">.</span><span class="n">this_state_is</span><span class="p">(</span><span class="n">sm</span><span class="o">.</span><span class="n">STATE_RED</span><span class="p">)</span> <span class="ow">and</span> <span class="n">sm</span><span class="o">.</span><span class="n">this_state_duration</span><span class="p">()</span> <span class="o">&gt;</span> <span class="mf">0.2</span> <span class="ow">and</span> <span class="ow">not</span> <span class="n">sm</span><span class="o">.</span><span class="n">condition_pedastrian_request</span><span class="p">():</span>
  116. <span class="n">sm</span><span class="o">.</span><span class="n">set_padestrian_request</span><span class="p">()</span>
  117. <span class="n">sm</span><span class="o">.</span><span class="n">work</span><span class="p">()</span>
  118. </pre></div>
  119. </div>
  120. <div class="highlight-default"><div class="highlight"><pre><span></span><span class="mi">2019</span><span class="o">-</span><span class="mi">12</span><span class="o">-</span><span class="mi">26</span> <span class="mi">13</span><span class="p">:</span><span class="mi">40</span><span class="p">:</span><span class="mi">44</span><span class="p">,</span><span class="mi">154</span><span class="p">:</span> <span class="n">INFO</span> <span class="o">-</span> <span class="n">TraficLights</span><span class="p">:</span> <span class="n">State</span> <span class="n">change</span> <span class="p">(</span><span class="s1">&#39;__init__&#39;</span><span class="p">):</span> <span class="kc">None</span> <span class="o">-&gt;</span> <span class="s1">&#39;state_red&#39;</span>
  121. <span class="mi">2019</span><span class="o">-</span><span class="mi">12</span><span class="o">-</span><span class="mi">26</span> <span class="mi">13</span><span class="p">:</span><span class="mi">40</span><span class="p">:</span><span class="mi">44</span><span class="p">,</span><span class="mi">354</span><span class="p">:</span> <span class="n">INFO</span> <span class="o">-</span> <span class="n">TraficLights</span><span class="p">:</span> <span class="n">Pedestrian</span> <span class="n">gave</span> <span class="n">state</span> <span class="n">change</span> <span class="n">request</span><span class="o">.</span>
  122. <span class="mi">2019</span><span class="o">-</span><span class="mi">12</span><span class="o">-</span><span class="mi">26</span> <span class="mi">13</span><span class="p">:</span><span class="mi">40</span><span class="p">:</span><span class="mi">45</span><span class="p">,</span><span class="mi">354</span><span class="p">:</span> <span class="n">INFO</span> <span class="o">-</span> <span class="n">TraficLights</span><span class="p">:</span> <span class="n">State</span> <span class="n">change</span> <span class="p">(</span><span class="s1">&#39;condition_pedastrian_request&#39;</span><span class="p">):</span> <span class="s1">&#39;state_red&#39;</span> <span class="o">-&gt;</span> <span class="s1">&#39;state_green&#39;</span>
  123. <span class="mi">2019</span><span class="o">-</span><span class="mi">12</span><span class="o">-</span><span class="mi">26</span> <span class="mi">13</span><span class="p">:</span><span class="mi">40</span><span class="p">:</span><span class="mi">45</span><span class="p">,</span><span class="mi">354</span><span class="p">:</span> <span class="n">INFO</span> <span class="o">-</span> <span class="n">Callback</span> <span class="n">information</span><span class="p">:</span> <span class="n">Traffic</span> <span class="n">light</span> <span class="n">had</span> <span class="n">been</span> <span class="n">changed</span> <span class="n">to</span> <span class="n">green</span> <span class="n">caused</span> <span class="n">by</span> <span class="n">pedastrian</span> <span class="n">request</span>
  124. <span class="mi">2019</span><span class="o">-</span><span class="mi">12</span><span class="o">-</span><span class="mi">26</span> <span class="mi">13</span><span class="p">:</span><span class="mi">40</span><span class="p">:</span><span class="mi">48</span><span class="p">,</span><span class="mi">355</span><span class="p">:</span> <span class="n">INFO</span> <span class="o">-</span> <span class="n">TraficLights</span><span class="p">:</span> <span class="n">State</span> <span class="n">change</span> <span class="p">(</span><span class="s1">&#39;condition_true&#39;</span><span class="p">):</span> <span class="s1">&#39;state_green&#39;</span> <span class="o">-&gt;</span> <span class="s1">&#39;state_red&#39;</span>
  125. </pre></div>
  126. </div>
  127. <dl class="method">
  128. <dt id="state_machine.state_machine.last_transition_condition">
  129. <code class="descname">last_transition_condition</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#state_machine.state_machine.last_transition_condition" title="Permalink to this definition">¶</a></dt>
  130. <dd><table class="docutils field-list" frame="void" rules="none">
  131. <col class="field-name" />
  132. <col class="field-body" />
  133. <tbody valign="top">
  134. <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The last transition condition.</td>
  135. </tr>
  136. <tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">str</td>
  137. </tr>
  138. </tbody>
  139. </table>
  140. <p>This method returns the last transition condition.</p>
  141. </dd></dl>
  142. <dl class="method">
  143. <dt id="state_machine.state_machine.last_transition_condition_was">
  144. <code class="descname">last_transition_condition_was</code><span class="sig-paren">(</span><em>condition</em><span class="sig-paren">)</span><a class="headerlink" href="#state_machine.state_machine.last_transition_condition_was" title="Permalink to this definition">¶</a></dt>
  145. <dd><table class="docutils field-list" frame="void" rules="none">
  146. <col class="field-name" />
  147. <col class="field-body" />
  148. <tbody valign="top">
  149. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>condition</strong> (<em>str</em>) – The condition to be checked</td>
  150. </tr>
  151. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">True if the given condition was the last transition condition, else False.</td>
  152. </tr>
  153. <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">bool</td>
  154. </tr>
  155. </tbody>
  156. </table>
  157. <p>This methods returns the boolean information if the last transition condition is equivalent to the given condition.</p>
  158. </dd></dl>
  159. <dl class="method">
  160. <dt id="state_machine.state_machine.previous_state">
  161. <code class="descname">previous_state</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#state_machine.state_machine.previous_state" title="Permalink to this definition">¶</a></dt>
  162. <dd><table class="docutils field-list" frame="void" rules="none">
  163. <col class="field-name" />
  164. <col class="field-body" />
  165. <tbody valign="top">
  166. <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The previous state.</td>
  167. </tr>
  168. <tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">str</td>
  169. </tr>
  170. </tbody>
  171. </table>
  172. <p>This method returns the previous state of the state machine.</p>
  173. </dd></dl>
  174. <dl class="method">
  175. <dt id="state_machine.state_machine.previous_state_duration">
  176. <code class="descname">previous_state_duration</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#state_machine.state_machine.previous_state_duration" title="Permalink to this definition">¶</a></dt>
  177. <dd><table class="docutils field-list" frame="void" rules="none">
  178. <col class="field-name" />
  179. <col class="field-body" />
  180. <tbody valign="top">
  181. <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The time how long the previous state was active.</td>
  182. </tr>
  183. <tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">float</td>
  184. </tr>
  185. </tbody>
  186. </table>
  187. <p>This method returns the time how long the previous state was active.</p>
  188. </dd></dl>
  189. <dl class="method">
  190. <dt id="state_machine.state_machine.previous_state_was">
  191. <code class="descname">previous_state_was</code><span class="sig-paren">(</span><em>state</em><span class="sig-paren">)</span><a class="headerlink" href="#state_machine.state_machine.previous_state_was" title="Permalink to this definition">¶</a></dt>
  192. <dd><table class="docutils field-list" frame="void" rules="none">
  193. <col class="field-name" />
  194. <col class="field-body" />
  195. <tbody valign="top">
  196. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>state</strong> (<em>str</em>) – The state to be checked</td>
  197. </tr>
  198. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">True if the given state was previously active, else False.</td>
  199. </tr>
  200. <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">bool</td>
  201. </tr>
  202. </tbody>
  203. </table>
  204. <p>This methods returns the boolean information if the state machine was previously in the given state.</p>
  205. </dd></dl>
  206. <dl class="method">
  207. <dt id="state_machine.state_machine.register_state_change_callback">
  208. <code class="descname">register_state_change_callback</code><span class="sig-paren">(</span><em>state</em>, <em>condition</em>, <em>callback</em>, <em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#state_machine.state_machine.register_state_change_callback" title="Permalink to this definition">¶</a></dt>
  209. <dd><table class="docutils field-list" frame="void" rules="none">
  210. <col class="field-name" />
  211. <col class="field-body" />
  212. <tbody valign="top">
  213. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
  214. <li><strong>state</strong> (<em>str</em>) – The target state. The callback will be executed, if the state machine changes to this state. None means all states.</li>
  215. <li><strong>condition</strong> (<em>str</em>) – The transition condition. The callback will be executed, if this condition is responsible for the state change. None means all conditions.</li>
  216. <li><strong>callback</strong> – The callback to be executed.</li>
  217. </ul>
  218. </td>
  219. </tr>
  220. </tbody>
  221. </table>
  222. <div class="admonition note">
  223. <p class="first admonition-title">Note</p>
  224. <p class="last">Additional arguments and keyword parameters are supported. These arguments and parameters will be used as arguments and parameters for the callback execution.</p>
  225. </div>
  226. <p>This methods allows to register callbacks which will be executed on state changes.</p>
  227. </dd></dl>
  228. <dl class="method">
  229. <dt id="state_machine.state_machine.this_state">
  230. <code class="descname">this_state</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#state_machine.state_machine.this_state" title="Permalink to this definition">¶</a></dt>
  231. <dd><table class="docutils field-list" frame="void" rules="none">
  232. <col class="field-name" />
  233. <col class="field-body" />
  234. <tbody valign="top">
  235. <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The current state.</td>
  236. </tr>
  237. </tbody>
  238. </table>
  239. <p>This method returns the current state of the state machine.</p>
  240. </dd></dl>
  241. <dl class="method">
  242. <dt id="state_machine.state_machine.this_state_duration">
  243. <code class="descname">this_state_duration</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#state_machine.state_machine.this_state_duration" title="Permalink to this definition">¶</a></dt>
  244. <dd><table class="docutils field-list" frame="void" rules="none">
  245. <col class="field-name" />
  246. <col class="field-body" />
  247. <tbody valign="top">
  248. <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The time how long the current state is active.</td>
  249. </tr>
  250. <tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">float</td>
  251. </tr>
  252. </tbody>
  253. </table>
  254. <p>This method returns the time how long the current state is active.</p>
  255. </dd></dl>
  256. <dl class="method">
  257. <dt id="state_machine.state_machine.this_state_is">
  258. <code class="descname">this_state_is</code><span class="sig-paren">(</span><em>state</em><span class="sig-paren">)</span><a class="headerlink" href="#state_machine.state_machine.this_state_is" title="Permalink to this definition">¶</a></dt>
  259. <dd><table class="docutils field-list" frame="void" rules="none">
  260. <col class="field-name" />
  261. <col class="field-body" />
  262. <tbody valign="top">
  263. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>state</strong> (<em>str</em>) – The state to be checked</td>
  264. </tr>
  265. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">True if the given state is currently active, else False.</td>
  266. </tr>
  267. <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">bool</td>
  268. </tr>
  269. </tbody>
  270. </table>
  271. <p>This methods returns the boolean information if the state machine is currently in the given state.</p>
  272. </dd></dl>
  273. <dl class="method">
  274. <dt id="state_machine.state_machine.work">
  275. <code class="descname">work</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#state_machine.state_machine.work" title="Permalink to this definition">¶</a></dt>
  276. <dd><p>This Method needs to be executed cyclicly to enable the state machine.</p>
  277. </dd></dl>
  278. </dd></dl>
  279. </div>
  280. <div class="toctree-wrapper compound">
  281. </div>
  282. </div>
  283. <div class="section" id="indices-and-tables">
  284. <h1>Indices and tables<a class="headerlink" href="#indices-and-tables" title="Permalink to this headline">¶</a></h1>
  285. <ul class="simple">
  286. <li><a class="reference internal" href="genindex.html"><span class="std std-ref">Index</span></a></li>
  287. <li><a class="reference internal" href="py-modindex.html"><span class="std std-ref">Module Index</span></a></li>
  288. <li><a class="reference internal" href="search.html"><span class="std std-ref">Search Page</span></a></li>
  289. </ul>
  290. </div>
  291. </div>
  292. </div>
  293. </div>
  294. <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
  295. <div class="sphinxsidebarwrapper"><div class="relations">
  296. <h3>Related Topics</h3>
  297. <ul>
  298. <li><a href="#">Documentation overview</a><ul>
  299. </ul></li>
  300. </ul>
  301. </div>
  302. <div id="searchbox" style="display: none" role="search">
  303. <h3>Quick search</h3>
  304. <form class="search" action="search.html" method="get">
  305. <div><input type="text" name="q" /></div>
  306. <div><input type="submit" value="Go" /></div>
  307. <input type="hidden" name="check_keywords" value="yes" />
  308. <input type="hidden" name="area" value="default" />
  309. </form>
  310. </div>
  311. <script type="text/javascript">$('#searchbox').show(0);</script>
  312. </div>
  313. </div>
  314. <div class="clearer"></div>
  315. </div>
  316. <div class="footer">
  317. &copy;2019, Dirk Alders.
  318. |
  319. Powered by <a href="http://sphinx-doc.org/">Sphinx 1.6.7</a>
  320. &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
  321. |
  322. <a href="_sources/index.rst.txt"
  323. rel="nofollow">Page source</a>
  324. </div>
  325. </body>
  326. </html>