change logic of step controller

This commit is contained in:
manuel83 2018-12-07 23:57:32 +01:00
parent 52c89a56a6
commit 617e13a601
5 changed files with 222 additions and 190 deletions

View file

@ -2,10 +2,11 @@
<project version="4"> <project version="4">
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="1a245e6a-2e43-4348-8759-dc1b63a4c9c8" name="Default" comment="Lots of changes"> <list default="true" id="1a245e6a-2e43-4348-8759-dc1b63a4c9c8" name="Default" comment="Lots of changes">
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/craftbeerpi.db" afterPath="$PROJECT_DIR$/craftbeerpi.db" /> <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/core/extension/comp/static/index2.html" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/controller/plugin_controller.py" afterPath="$PROJECT_DIR$/core/controller/plugin_controller.py" /> <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/craftbeerpi.py" afterPath="$PROJECT_DIR$/core/craftbeerpi.py" /> <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/api/step.py" afterPath="$PROJECT_DIR$/core/api/step.py" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/extension/comp/__init__.py" afterPath="$PROJECT_DIR$/core/extension/comp/__init__.py" /> <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/controller/step_controller.py" afterPath="$PROJECT_DIR$/core/controller/step_controller.py" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/extension/dummystep/__init__.py" afterPath="$PROJECT_DIR$/core/extension/dummystep/__init__.py" />
</list> </list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" /> <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="TRACKING_ENABLED" value="true" /> <option name="TRACKING_ENABLED" value="true" />
@ -17,7 +18,7 @@
<component name="CoverageDataManager"> <component name="CoverageDataManager">
<SUITE FILE_PATH="coverage/craftbeerpi4$py_test_in_tests.coverage" NAME="py.test in tests Coverage Results" MODIFIED="1542544313367" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="" /> <SUITE FILE_PATH="coverage/craftbeerpi4$py_test_in_tests.coverage" NAME="py.test in tests Coverage Results" MODIFIED="1542544313367" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="" />
<SUITE FILE_PATH="coverage/craftbeerpi4$test_app.coverage" NAME="test_app Coverage Results" MODIFIED="1542463852422" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/tests" /> <SUITE FILE_PATH="coverage/craftbeerpi4$test_app.coverage" NAME="test_app Coverage Results" MODIFIED="1542463852422" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/tests" />
<SUITE FILE_PATH="coverage/craftbeerpi4$run.coverage" NAME="run Coverage Results" MODIFIED="1544138264445" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" /> <SUITE FILE_PATH="coverage/craftbeerpi4$run.coverage" NAME="run Coverage Results" MODIFIED="1544219966056" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
<SUITE FILE_PATH="coverage/craftbeerpi4$test_kettle.coverage" NAME="test kettle Coverage Results" MODIFIED="1543666720847" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="" /> <SUITE FILE_PATH="coverage/craftbeerpi4$test_kettle.coverage" NAME="test kettle Coverage Results" MODIFIED="1543666720847" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="" />
<SUITE FILE_PATH="coverage/craftbeerpi4$main2.coverage" NAME="main2 Coverage Results" MODIFIED="1543663949310" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" /> <SUITE FILE_PATH="coverage/craftbeerpi4$main2.coverage" NAME="main2 Coverage Results" MODIFIED="1543663949310" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
</component> </component>
@ -75,8 +76,8 @@
<file leaf-file-name="__init__.py" pinned="false" current-in-tab="false"> <file leaf-file-name="__init__.py" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/core/extension/dummystep/__init__.py"> <entry file="file://$PROJECT_DIR$/core/extension/dummystep/__init__.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="465"> <state relative-caret-position="330">
<caret line="31" column="21" lean-forward="false" selection-start-line="31" selection-start-column="21" selection-end-line="31" selection-end-column="21" /> <caret line="22" column="0" lean-forward="false" selection-start-line="22" selection-start-column="0" selection-end-line="22" selection-end-column="0" />
<folding> <folding>
<element signature="e#0#14#0" expanded="true" /> <element signature="e#0#14#0" expanded="true" />
</folding> </folding>
@ -84,33 +85,23 @@
</provider> </provider>
</entry> </entry>
</file> </file>
<file leaf-file-name="actor_controller.py" pinned="false" current-in-tab="false"> <file leaf-file-name="step.py" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/core/controller/actor_controller.py"> <entry file="file://$PROJECT_DIR$/core/api/step.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="150"> <state relative-caret-position="-62">
<caret line="10" column="20" lean-forward="false" selection-start-line="10" selection-start-column="20" selection-end-line="10" selection-end-column="20" /> <caret line="31" column="19" lean-forward="false" selection-start-line="31" selection-start-column="19" selection-end-line="31" selection-end-column="19" />
<folding> <folding>
<element signature="e#0#23#0" expanded="true" /> <element signature="e#0#11#0" expanded="true" />
</folding> </folding>
</state> </state>
</provider> </provider>
</entry> </entry>
</file> </file>
<file leaf-file-name="http_api.py" pinned="false" current-in-tab="false"> <file leaf-file-name="__init__.py" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/core/http_endpoints/http_api.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="45">
<caret line="8" column="13" lean-forward="false" selection-start-line="8" selection-start-column="6" selection-end-line="8" selection-end-column="13" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="__init__.py" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/core/extension/comp/__init__.py"> <entry file="file://$PROJECT_DIR$/core/extension/comp/__init__.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="361"> <state relative-caret-position="465">
<caret line="25" column="53" lean-forward="false" selection-start-line="25" selection-start-column="53" selection-end-line="25" selection-end-column="53" /> <caret line="31" column="0" lean-forward="true" selection-start-line="31" selection-start-column="0" selection-end-line="31" selection-end-column="0" />
<folding> <folding>
<element signature="e#0#23#0" expanded="true" /> <element signature="e#0#23#0" expanded="true" />
</folding> </folding>
@ -118,12 +109,27 @@
</provider> </provider>
</entry> </entry>
</file> </file>
<file leaf-file-name="index.html" pinned="false" current-in-tab="false"> <file leaf-file-name="step_controller.py" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/core/extension/comp/static/index.html"> <entry file="file://$PROJECT_DIR$/core/controller/step_controller.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0"> <state relative-caret-position="296">
<caret line="0" column="16" lean-forward="false" selection-start-line="0" selection-start-column="16" selection-end-line="0" selection-end-column="16" /> <caret line="68" column="11" lean-forward="false" selection-start-line="68" selection-start-column="11" selection-end-line="68" selection-end-column="11" />
<folding /> <folding>
<element signature="e#0#14#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="eventbus.py" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/core/eventbus.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="177">
<caret line="93" column="0" lean-forward="false" selection-start-line="93" selection-start-column="0" selection-end-line="93" selection-end-column="0" />
<folding>
<element signature="e#0#14#0" expanded="true" />
<marker date="1543875480881" expanded="true" signature="2254:3500" ph="..." />
</folding>
</state> </state>
</provider> </provider>
</entry> </entry>
@ -138,21 +144,6 @@
</provider> </provider>
</entry> </entry>
</file> </file>
<file leaf-file-name="main.dummy" pinned="false" current-in-tab="false">
<entry file="dbDummy://dbtable:/a57e2371/5067e7fe-480d-4433-bc40-f2d1c38362a2/main.dummy">
<provider selected="true" editor-type-id="com.intellij.database.editor.DatabaseTableFileEditorProvider">
<state>
<filtering enabled="true" />
</state>
</provider>
<provider editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="orm_framework.py" pinned="false" current-in-tab="false"> <file leaf-file-name="orm_framework.py" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/core/database/orm_framework.py"> <entry file="file://$PROJECT_DIR$/core/database/orm_framework.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
@ -191,7 +182,6 @@
</component> </component>
<component name="FindInProjectRecents"> <component name="FindInProjectRecents">
<findStrings> <findStrings>
<find>0x10d622b380x10d622b38</find>
<find>__init__</find> <find>__init__</find>
<find>0x1048b31d0</find> <find>0x1048b31d0</find>
<find>Content</find> <find>Content</find>
@ -220,6 +210,7 @@
<find>logging</find> <find>logging</find>
<find>dummy</find> <find>dummy</find>
<find>/dumy</find> <find>/dumy</find>
<find>_run</find>
<find>StepBase</find> <find>StepBase</find>
</findStrings> </findStrings>
<replaceStrings> <replaceStrings>
@ -239,7 +230,6 @@
<component name="IdeDocumentHistory"> <component name="IdeDocumentHistory">
<option name="CHANGED_PATHS"> <option name="CHANGED_PATHS">
<list> <list>
<option value="$PROJECT_DIR$/docs_src/copy_docs.sh" />
<option value="$PROJECT_DIR$/docs_src/source/core.rst" /> <option value="$PROJECT_DIR$/docs_src/source/core.rst" />
<option value="$PROJECT_DIR$/requirements.txt" /> <option value="$PROJECT_DIR$/requirements.txt" />
<option value="$PROJECT_DIR$/docs/index.html" /> <option value="$PROJECT_DIR$/docs/index.html" />
@ -281,15 +271,16 @@
<option value="$PROJECT_DIR$/core/extension/dummysensor/__init__.py" /> <option value="$PROJECT_DIR$/core/extension/dummysensor/__init__.py" />
<option value="$PROJECT_DIR$/core/eventbus.py" /> <option value="$PROJECT_DIR$/core/eventbus.py" />
<option value="$PROJECT_DIR$/core/controller/sensor_controller.py" /> <option value="$PROJECT_DIR$/core/controller/sensor_controller.py" />
<option value="$PROJECT_DIR$/core/controller/step_controller.py" />
<option value="$PROJECT_DIR$/core/api/step.py" />
<option value="$PROJECT_DIR$/core/extension/dummystep/__init__.py" />
<option value="$PROJECT_DIR$/core/controller/dummy_controller.py" /> <option value="$PROJECT_DIR$/core/controller/dummy_controller.py" />
<option value="$PROJECT_DIR$/core/sql/create_table_user.sql" /> <option value="$PROJECT_DIR$/core/sql/create_table_user.sql" />
<option value="$PROJECT_DIR$/core/controller/plugin_controller.py" /> <option value="$PROJECT_DIR$/core/controller/plugin_controller.py" />
<option value="$PROJECT_DIR$/core/extension/comp/static/index.html" /> <option value="$PROJECT_DIR$/core/extension/comp/static/index.html" />
<option value="$PROJECT_DIR$/core/craftbeerpi.py" /> <option value="$PROJECT_DIR$/core/craftbeerpi.py" />
<option value="$PROJECT_DIR$/core/extension/comp/__init__.py" /> <option value="$PROJECT_DIR$/core/extension/comp/__init__.py" />
<option value="$PROJECT_DIR$/core/extension/comp/static/index2.html" />
<option value="$PROJECT_DIR$/core/api/step.py" />
<option value="$PROJECT_DIR$/core/extension/dummystep/__init__.py" />
<option value="$PROJECT_DIR$/core/controller/step_controller.py" />
</list> </list>
</option> </option>
</component> </component>
@ -360,11 +351,11 @@
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT> </PATH_ELEMENT>
<PATH_ELEMENT> <PATH_ELEMENT>
<option name="myItemId" value="craftbeerpi.py" /> <option name="myItemId" value="eventbus.py" />
<option name="myItemType" value="com.jetbrains.python.projectView.PyFileNode" /> <option name="myItemType" value="com.jetbrains.python.projectView.PyFileNode" />
</PATH_ELEMENT> </PATH_ELEMENT>
<PATH_ELEMENT> <PATH_ELEMENT>
<option name="myItemId" value="CraftBeerPi" /> <option name="myItemId" value="EventBus" />
<option name="myItemType" value="com.jetbrains.python.projectView.PyElementNode" /> <option name="myItemType" value="com.jetbrains.python.projectView.PyElementNode" />
</PATH_ELEMENT> </PATH_ELEMENT>
</PATH> </PATH>
@ -382,33 +373,11 @@
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT> </PATH_ELEMENT>
<PATH_ELEMENT> <PATH_ELEMENT>
<option name="myItemId" value="http_endpoints" /> <option name="myItemId" value="craftbeerpi.py" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="craftbeerpi4" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="craftbeerpi4" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="core" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="http_endpoints" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="http_api.py" />
<option name="myItemType" value="com.jetbrains.python.projectView.PyFileNode" /> <option name="myItemType" value="com.jetbrains.python.projectView.PyFileNode" />
</PATH_ELEMENT> </PATH_ELEMENT>
<PATH_ELEMENT> <PATH_ELEMENT>
<option name="myItemId" value="HttpAPI" /> <option name="myItemId" value="CraftBeerPi" />
<option name="myItemType" value="com.jetbrains.python.projectView.PyElementNode" /> <option name="myItemType" value="com.jetbrains.python.projectView.PyElementNode" />
</PATH_ELEMENT> </PATH_ELEMENT>
</PATH> </PATH>
@ -478,6 +447,36 @@
<option name="myItemType" value="com.jetbrains.python.projectView.PyFileNode" /> <option name="myItemType" value="com.jetbrains.python.projectView.PyFileNode" />
</PATH_ELEMENT> </PATH_ELEMENT>
</PATH> </PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="craftbeerpi4" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="craftbeerpi4" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="core" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="extension" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="dummystep" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="__init__.py" />
<option name="myItemType" value="com.jetbrains.python.projectView.PyFileNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="CustomStep" />
<option name="myItemType" value="com.jetbrains.python.projectView.PyElementNode" />
</PATH_ELEMENT>
</PATH>
<PATH> <PATH>
<PATH_ELEMENT> <PATH_ELEMENT>
<option name="myItemId" value="craftbeerpi4" /> <option name="myItemId" value="craftbeerpi4" />
@ -556,46 +555,6 @@
<option name="myItemType" value="com.jetbrains.python.projectView.PyElementNode" /> <option name="myItemType" value="com.jetbrains.python.projectView.PyElementNode" />
</PATH_ELEMENT> </PATH_ELEMENT>
</PATH> </PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="craftbeerpi4" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="craftbeerpi4" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="core" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="database" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="craftbeerpi4" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="craftbeerpi4" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="core" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="database" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="model.py" />
<option name="myItemType" value="com.jetbrains.python.projectView.PyFileNode" />
</PATH_ELEMENT>
</PATH>
<PATH> <PATH>
<PATH_ELEMENT> <PATH_ELEMENT>
<option name="myItemId" value="craftbeerpi4" /> <option name="myItemId" value="craftbeerpi4" />
@ -632,14 +591,58 @@
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT> </PATH_ELEMENT>
<PATH_ELEMENT> <PATH_ELEMENT>
<option name="myItemId" value="plugin_controller.py" /> <option name="myItemId" value="step_controller.py" />
<option name="myItemType" value="com.jetbrains.python.projectView.PyFileNode" /> <option name="myItemType" value="com.jetbrains.python.projectView.PyFileNode" />
</PATH_ELEMENT> </PATH_ELEMENT>
<PATH_ELEMENT> <PATH_ELEMENT>
<option name="myItemId" value="PluginController" /> <option name="myItemId" value="StepController" />
<option name="myItemType" value="com.jetbrains.python.projectView.PyElementNode" /> <option name="myItemType" value="com.jetbrains.python.projectView.PyElementNode" />
</PATH_ELEMENT> </PATH_ELEMENT>
</PATH> </PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="craftbeerpi4" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="craftbeerpi4" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="core" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="api" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="step.py" />
<option name="myItemType" value="com.jetbrains.python.projectView.PyFileNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="Step" />
<option name="myItemType" value="com.jetbrains.python.projectView.PyElementNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="craftbeerpi4" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="craftbeerpi4" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="core" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="api" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH> <PATH>
<PATH_ELEMENT> <PATH_ELEMENT>
<option name="myItemId" value="craftbeerpi4" /> <option name="myItemId" value="craftbeerpi4" />
@ -722,11 +725,11 @@
<recent name="$PROJECT_DIR$/core/controller" /> <recent name="$PROJECT_DIR$/core/controller" />
</key> </key>
<key name="CopyFile.RECENT_KEYS"> <key name="CopyFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/core/extension/comp/static" />
<recent name="$PROJECT_DIR$/core/controller" /> <recent name="$PROJECT_DIR$/core/controller" />
<recent name="$PROJECT_DIR$/core/extension/dummystep" /> <recent name="$PROJECT_DIR$/core/extension/dummystep" />
<recent name="$PROJECT_DIR$/docs_src/source" /> <recent name="$PROJECT_DIR$/docs_src/source" />
<recent name="$PROJECT_DIR$/tests" /> <recent name="$PROJECT_DIR$/tests" />
<recent name="$PROJECT_DIR$/core/extension/dummylogic" />
</key> </key>
</component> </component>
<component name="RunDashboard"> <component name="RunDashboard">
@ -1145,13 +1148,13 @@
<layout> <layout>
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3286945" sideWeight="0.5" order="10" side_tool="false" content_ui="tabs" /> <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3286945" sideWeight="0.5" order="10" side_tool="false" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.43208432" sideWeight="0.2720238" order="0" side_tool="true" content_ui="tabs" /> <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.43208432" sideWeight="0.2720238" order="0" side_tool="true" content_ui="tabs" />
<window_info id="Run" active="true" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.39578456" sideWeight="0.7279762" order="6" side_tool="false" content_ui="tabs" /> <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.34543326" sideWeight="0.7279762" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3286945" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3286945" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Python Console" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3290398" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" /> <window_info id="Python Console" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3290398" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.31615925" sideWeight="0.49761903" order="3" side_tool="false" content_ui="tabs" /> <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.31615925" sideWeight="0.49761903" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.27181688" sideWeight="0.5" order="1" side_tool="false" content_ui="combo" /> <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.27181688" sideWeight="0.5" order="1" side_tool="false" content_ui="combo" />
<window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.047210302" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> <window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.047210302" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.327787" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" /> <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3266979" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.24957556" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" /> <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.24957556" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.39812645" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.39812645" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="true" content_ui="tabs" /> <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="true" content_ui="tabs" />
@ -1206,14 +1209,6 @@
</watches-manager> </watches-manager>
</component> </component>
<component name="editorHistoryManager"> <component name="editorHistoryManager">
<entry file="file://$USER_HOME$/cbp42/lib/python3.7/site-packages/aiojobs/aiohttp.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="210">
<caret line="18" column="4" lean-forward="false" selection-start-line="18" selection-start-column="4" selection-end-line="18" selection-end-column="4" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/core/job/aiohttp.py"> <entry file="file://$PROJECT_DIR$/core/job/aiohttp.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="600"> <state relative-caret-position="600">
@ -1507,17 +1502,6 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/core/eventbus.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="269">
<caret line="61" column="8" lean-forward="false" selection-start-line="61" selection-start-column="8" selection-end-line="61" selection-end-column="49" />
<folding>
<element signature="e#0#14#0" expanded="true" />
<marker date="1543875480881" expanded="true" signature="2254:3500" ph="..." />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/core/api/decorator.py"> <entry file="file://$PROJECT_DIR$/core/api/decorator.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="174"> <state relative-caret-position="174">
@ -1526,26 +1510,6 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/core/controller/step_controller.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-148">
<caret line="42" column="53" lean-forward="false" selection-start-line="42" selection-start-column="53" selection-end-line="42" selection-end-column="53" />
<folding>
<element signature="e#0#14#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/core/api/step.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-174">
<caret line="11" column="4" lean-forward="false" selection-start-line="11" selection-start-column="4" selection-end-line="11" selection-end-column="19" />
<folding>
<element signature="e#0#11#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/core/controller/dummy_controller.py"> <entry file="file://$PROJECT_DIR$/core/controller/dummy_controller.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="45"> <state relative-caret-position="45">
@ -1632,16 +1596,6 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/core/extension/dummystep/__init__.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="465">
<caret line="31" column="21" lean-forward="false" selection-start-line="31" selection-start-column="21" selection-end-line="31" selection-end-column="21" />
<folding>
<element signature="e#0#14#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/core/extension/comp/static/index.html"> <entry file="file://$PROJECT_DIR$/core/extension/comp/static/index.html">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0"> <state relative-caret-position="0">
@ -1650,6 +1604,24 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/core/extension/comp/static/index2.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="17" lean-forward="false" selection-start-line="0" selection-start-column="17" selection-end-line="0" selection-end-column="17" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/core/extension/comp/__init__.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="465">
<caret line="31" column="0" lean-forward="true" selection-start-line="31" selection-start-column="0" selection-end-line="31" selection-end-column="0" />
<folding>
<element signature="e#0#23#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/core/craftbeerpi.py"> <entry file="file://$PROJECT_DIR$/core/craftbeerpi.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="348"> <state relative-caret-position="348">
@ -1660,12 +1632,43 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/core/extension/comp/__init__.py"> <entry file="file://$PROJECT_DIR$/core/eventbus.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="361"> <state relative-caret-position="177">
<caret line="25" column="53" lean-forward="false" selection-start-line="25" selection-start-column="53" selection-end-line="25" selection-end-column="53" /> <caret line="93" column="0" lean-forward="false" selection-start-line="93" selection-start-column="0" selection-end-line="93" selection-end-column="0" />
<folding> <folding>
<element signature="e#0#23#0" expanded="true" /> <element signature="e#0#14#0" expanded="true" />
<marker date="1543875480881" expanded="true" signature="2254:3500" ph="..." />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/core/extension/dummystep/__init__.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="330">
<caret line="22" column="0" lean-forward="false" selection-start-line="22" selection-start-column="0" selection-end-line="22" selection-end-column="0" />
<folding>
<element signature="e#0#14#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/core/api/step.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-62">
<caret line="31" column="19" lean-forward="false" selection-start-line="31" selection-start-column="19" selection-end-line="31" selection-end-column="19" />
<folding>
<element signature="e#0#11#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/core/controller/step_controller.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="296">
<caret line="68" column="11" lean-forward="false" selection-start-line="68" selection-start-column="11" selection-end-line="68" selection-end-column="11" />
<folding>
<element signature="e#0#14#0" expanded="true" />
</folding> </folding>
</state> </state>
</provider> </provider>

View file

@ -9,43 +9,54 @@ class Step(object):
__dirty = False __dirty = False
managed_fields = [] managed_fields = []
_interval = 0.1 _interval = 1
_max_exceptions = 2
_exception_count = 0
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
self.logger = logging.getLogger(__name__) self.logger = logging.getLogger(__name__)
for a in kwargs: for a in kwargs:
super(Step, self).__setattr__(a, kwargs.get(a)) super(Step, self).__setattr__(a, kwargs.get(a))
self.id = kwargs.get("id") self.id = kwargs.get("id")
self.stop = False self.is_stopped = False
self.is_next = False
self.start = time.time() self.start = time.time()
def running(self): def running(self):
if self.stop is False: if self.is_next is True:
return False
if self.is_stopped is True:
return False return False
return True return True
async def _run(self): async def run(self):
i = 0
while i < 20: while self.running():
try: try:
await self.run() await self.run_cycle()
except Exception as e: except Exception as e:
pass logging.exception("Step Error")
#logging.exception("Step Error") self._exception_count = self._exception_count + 1
if self._exception_count == self._max_exceptions:
self.stop()
print("INTER",self._interval) print("INTER",self._interval)
await asyncio.sleep(self._interval) await asyncio.sleep(self._interval)
i = i + 1
if self.is_dirty(): if self.is_dirty():
# Now we have to store the managed props # Now we have to store the managed props
self.reset_dirty() self.reset_dirty()
async def run(self): async def run_cycle(self):
print("NOTING IMPLEMENTED") print("NOTING IMPLEMENTED")
pass pass
def next(self):
self.is_next = True
def stop(self): def stop(self):
pass self.is_stopped = True
def reset(self): def reset(self):
pass pass

View file

@ -36,6 +36,11 @@ class StepController():
self.cbpi.bus.fire("step/reset") self.cbpi.bus.fire("step/reset")
return web.Response(text="OK") return web.Response(text="OK")
@request_mapping(path="/next", auth_required=False)
async def http_reset(self, request):
self.cbpi.bus.fire("step/next")
return web.Response(text="OK")
@on_event("step/action") @on_event("step/action")
def handle_action(self, topic, action, **kwargs): def handle_action(self, topic, action, **kwargs):
print("process action") print("process action")
@ -43,6 +48,14 @@ class StepController():
self.current_step.__getattribute__(action)() self.current_step.__getattribute__(action)()
pass pass
@on_event("step/next")
def handle_next(self, **kwargs):
print("process action")
if self.current_step is not None:
self.current_step.next()
pass
@on_event("step/start") @on_event("step/start")
def handle_start(self, topic, **kwargs): def handle_start(self, topic, **kwargs):
@ -53,7 +66,7 @@ class StepController():
if self.current_step is not None: if self.current_step is not None:
self.current_task.cancel() self.current_task.cancel()
self.current_step.reset() self.current_step.reset()
print("rESeT", self.current_step.id, self.steps)
self.steps[self.current_step.id]["state"] = None self.steps[self.current_step.id]["state"] = None
self.current_step = None self.current_step = None
self.current_task = None self.current_task = None
@ -102,7 +115,7 @@ class StepController():
print("----------") print("----------")
config = dict(cbpi = self.cbpi, id=key, name="Manuel", managed_fields=self.get_manged_fields_as_array(step_type)) config = dict(cbpi = self.cbpi, id=key, name="Manuel", managed_fields=self.get_manged_fields_as_array(step_type))
self.current_step = step_type["class"](**config) self.current_step = step_type["class"](**config)
self.current_task = loop.create_task(self.current_step._run()) self.current_task = loop.create_task(self.current_step.run())
self.current_task.add_done_callback(self._step_done) self.current_task.add_done_callback(self._step_done)
open_step = True open_step = True
break break

View file

@ -1 +1 @@
HALLO WELT INDEX HALLO WELT INDEX2

View file

@ -8,14 +8,19 @@ class CustomStep(Step):
name = Property.Number(label="Test") name = Property.Number(label="Test")
_interval = 1 _interval = 1
i = 0
@action(key="name", parameters=None) @action(key="name", parameters=None)
def test(self, **kwargs): def test(self, **kwargs):
self.name="WOOHOO" self.name="WOOHOO"
async def run(self): async def run_cycle(self):
#await asyncio.sleep(1) #await asyncio.sleep(1)
self.i = self.i + 1
print("RUN STEP", self.id, self.name, self.__dict__) print("RUN STEP", self.id, self.name, self.__dict__)