Commit 7153e1e8 authored by Olof Svensson's avatar Olof Svensson
Browse files

Renamed 'parent' to 'errorHandler'

parent 3cbe74f2
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/pypushflow" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
......
......@@ -2,14 +2,11 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" id="c576ef19-b019-42bf-aa79-4f42108f323d" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/.idea/dictionaries/svensson.xml" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/misc.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/misc.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/pypushflow.iml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/pypushflow.iml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pypushflow/PythonActor.py" beforeDir="false" afterPath="$PROJECT_DIR$/pypushflow/PythonActor.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pypushflow/SubModel.py" beforeDir="false" afterPath="$PROJECT_DIR$/pypushflow/Submodel.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pypushflow/test/TestWorkflow.py" beforeDir="false" afterPath="$PROJECT_DIR$/pypushflow/test/TestWorkflow.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pypushflow/test/test_Workflows.py" beforeDir="false" afterPath="$PROJECT_DIR$/pypushflow/test/test_Workflows.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pypushflow/RouterActor.py" beforeDir="false" afterPath="$PROJECT_DIR$/pypushflow/RouterActor.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pypushflow/StopActor.py" beforeDir="false" afterPath="$PROJECT_DIR$/pypushflow/StopActor.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pypushflow/Submodel.py" beforeDir="false" afterPath="$PROJECT_DIR$/pypushflow/Submodel.py" afterDir="false" />
</list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="SHOW_DIALOG" value="false" />
......@@ -20,19 +17,15 @@
<component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/pypushflow/AbstractActor.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="90">
<caret line="6" column="82" selection-start-line="6" selection-start-column="82" selection-end-line="6" selection-end-column="82" />
</state>
</provider>
<entry file="file://$PROJECT_DIR$/pypushflow/test/pythonActor1.py">
<provider selected="true" editor-type-id="text-editor" />
</entry>
</file>
<file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/pypushflow/test/TestWorkflow.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="180">
<caret line="43" column="57" selection-start-line="43" selection-start-column="57" selection-end-line="43" selection-end-column="57" />
<state relative-caret-position="273">
<caret line="24" lean-forward="true" selection-start-line="24" selection-end-line="24" />
<folding>
<element signature="e#1198#1238#0" expanded="true" />
</folding>
......@@ -40,50 +33,11 @@
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/pypushflow/Submodel.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="90">
<caret line="56" column="10" selection-start-line="56" selection-start-column="10" selection-end-line="56" selection-end-column="10" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/pypushflow/test/test_Actors.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="195">
<caret line="73" column="47" lean-forward="true" selection-start-line="73" selection-end-line="74" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/pypushflow/Workflow.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="299">
<caret line="46" lean-forward="true" selection-start-line="46" selection-end-line="46" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/pypushflow/PythonActor.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="2455">
<caret line="173" column="13" selection-start-line="173" selection-start-column="13" selection-end-line="173" selection-end-column="13" />
<folding>
<element signature="e#1198#1207#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/pypushflow/test/test_Workflows.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="329">
<caret line="51" selection-start-line="51" selection-end-line="51" />
<state relative-caret-position="534">
<caret line="63" column="31" selection-start-line="63" selection-start-column="31" selection-end-line="63" selection-end-column="31" />
<folding>
<element signature="e#1198#1212#0" expanded="true" />
</folding>
......@@ -100,6 +54,9 @@
<replaceStrings>
<replace>errorHandler</replace>
</replaceStrings>
<dirStrings>
<dir>$PROJECT_DIR$</dir>
</dirStrings>
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
......@@ -108,17 +65,17 @@
<option name="CHANGED_PATHS">
<list>
<option value="$PROJECT_DIR$/pypushflow/PythonActor.py" />
<option value="$PROJECT_DIR$/pypushflow/test/test_Workflows.py" />
<option value="$PROJECT_DIR$/pypushflow/Submodel.py" />
<option value="$PROJECT_DIR$/pypushflow/test/TestWorkflow.py" />
<option value="$PROJECT_DIR$/pypushflow/test/test_Workflows.py" />
</list>
</option>
</component>
<component name="ProjectFrameBounds" extendedState="6">
<option name="x" value="-3" />
<option name="y" value="31" />
<option name="y" value="49" />
<option name="width" value="1372" />
<option name="height" value="691" />
<option name="height" value="589" />
</component>
<component name="ProjectLevelVcsManager" settingsEditedManually="true" />
<component name="ProjectView">
......@@ -153,7 +110,8 @@
</component>
<component name="PropertiesComponent">
<property name="SHARE_PROJECT_CONFIGURATION_FILES" value="true" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/../edna2" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/../pybes" />
<property name="settings.editor.selected.configurable" value="com.jetbrains.python.configuration.PythonContentEntriesConfigurable" />
</component>
<component name="RunDashboard">
<option name="ruleStates">
......@@ -167,7 +125,7 @@
</list>
</option>
</component>
<component name="RunManager" selected="Python tests.Unittests in test_Workflows.py">
<component name="RunManager" selected="Python tests.Unittests in test">
<configuration name="System" type="PythonConfigurationType" factoryName="Python">
<module name="pypushflow" />
<option name="INTERPRETER_OPTIONS" value="" />
......@@ -193,11 +151,12 @@
<module name="pypushflow" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<option name="SDK_HOME" value="" />
<option name="SDK_HOME" value="$USER_HOME$/miniconda3/bin/python" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/pypushflow/test" />
<option name="IS_MODULE_SDK" value="true" />
<option name="IS_MODULE_SDK" value="false" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<option name="_new_pattern" value="&quot;&quot;" />
<option name="_new_additionalArguments" value="&quot;&quot;" />
<option name="_new_target" value="&quot;$PROJECT_DIR$/pypushflow/test&quot;" />
<option name="_new_targetType" value="&quot;PATH&quot;" />
......@@ -239,8 +198,8 @@
</list>
<recent_temporary>
<list>
<item itemvalue="Python tests.Unittests in test_Workflows.py" />
<item itemvalue="Python tests.Unittests in test" />
<item itemvalue="Python tests.Unittests in test_Workflows.py" />
<item itemvalue="Python tests.Unittests in test_Actors.py" />
</list>
</recent_temporary>
......@@ -259,49 +218,52 @@
<servers />
</component>
<component name="TestHistory">
<history-entry file="Unittests_in_test_Actors_py - 2019.06.22 at 15h 22m 44s.xml">
<configuration name="Unittests in test_Actors.py" configurationId="tests" />
<history-entry file="Unittests_in_test - 2019.06.24 at 09h 35m 30s.xml">
<configuration name="Unittests in test" configurationId="tests" />
</history-entry>
<history-entry file="Unittests_in_test_Workflows_py - 2019.06.22 at 15h 22m 55s.xml">
<configuration name="Unittests in test_Workflows.py" configurationId="tests" />
<history-entry file="Unittests_in_test - 2019.06.24 at 09h 38m 39s.xml">
<configuration name="Unittests in test" configurationId="tests" />
</history-entry>
<history-entry file="Unittests_in_test_Workflows_py - 2019.06.22 at 15h 23m 22s.xml">
<configuration name="Unittests in test_Workflows.py" configurationId="tests" />
<history-entry file="Unittests_in_test - 2019.06.24 at 09h 38m 42s.xml">
<configuration name="Unittests in test" configurationId="tests" />
</history-entry>
<history-entry file="Unittests_in_test - 2019.06.22 at 15h 39m 01s.xml">
<history-entry file="Unittests_in_test - 2019.06.24 at 09h 39m 26s.xml">
<configuration name="Unittests in test" configurationId="tests" />
</history-entry>
<history-entry file="Unittests_in_test_Workflows_py - 2019.06.23 at 09h 44m 30s.xml">
<configuration name="Unittests in test_Workflows.py" configurationId="tests" />
<history-entry file="Unittests_in_test - 2019.06.24 at 09h 41m 31s.xml">
<configuration name="Unittests in test" configurationId="tests" />
</history-entry>
<history-entry file="Unittests_in_test_Workflows_py - 2019.06.23 at 09h 44m 56s.xml">
<configuration name="Unittests in test_Workflows.py" configurationId="tests" />
<history-entry file="Unittests_in_test - 2019.06.24 at 09h 41m 44s.xml">
<configuration name="Unittests in test" configurationId="tests" />
</history-entry>
<history-entry file="Unittests_in_test_Workflows_py - 2019.06.23 at 09h 45m 20s.xml">
<configuration name="Unittests in test_Workflows.py" configurationId="tests" />
<history-entry file="Unittests_in_test - 2019.06.24 at 09h 42m 37s.xml">
<configuration name="Unittests in test" configurationId="tests" />
</history-entry>
<history-entry file="Unittests_in_test_Workflows_py - 2019.06.23 at 09h 48m 57s.xml">
<configuration name="Unittests in test_Workflows.py" configurationId="tests" />
<history-entry file="Unittests_in_test - 2019.06.24 at 09h 42m 51s.xml">
<configuration name="Unittests in test" configurationId="tests" />
</history-entry>
<history-entry file="Unittests_in_test - 2019.06.24 at 09h 46m 08s.xml">
<configuration name="Unittests in test" configurationId="tests" />
</history-entry>
<history-entry file="Unittests_in_test_Workflows_py - 2019.06.23 at 09h 50m 20s.xml">
<configuration name="Unittests in test_Workflows.py" configurationId="tests" />
<history-entry file="Unittests_in_test - 2019.06.24 at 10h 23m 37s.xml">
<configuration name="Unittests in test" configurationId="tests" />
</history-entry>
</component>
<component name="ToolWindowManager">
<frame x="-3" y="31" width="1372" height="691" extended-state="6" />
<frame x="46" y="31" width="1877" height="1172" extended-state="6" />
<editor active="true" />
<layout>
<window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.24460967" />
<window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.24432433" />
<window_info id="Structure" order="1" side_tool="true" weight="0.25" />
<window_info id="Favorites" order="2" side_tool="true" />
<window_info anchor="bottom" id="Message" order="0" />
<window_info anchor="bottom" id="Find" order="1" />
<window_info anchor="bottom" id="Run" order="2" visible="true" weight="0.32920355" />
<window_info active="true" anchor="bottom" id="Run" order="2" visible="true" weight="0.3288719" />
<window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
<window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
<window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
<window_info anchor="bottom" id="TODO" order="6" />
<window_info anchor="bottom" id="Version Control" order="7" />
<window_info anchor="bottom" id="Version Control" order="7" weight="0.3298279" />
<window_info anchor="bottom" id="Terminal" order="8" />
<window_info anchor="bottom" id="Event Log" order="9" side_tool="true" />
<window_info anchor="bottom" id="Python Console" order="10" />
......@@ -329,9 +291,23 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/pypushflow/test/test_Actors.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="960">
<caret line="73" column="47" selection-start-line="73" selection-end-line="74" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/pypushflow/Workflow.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="675">
<caret line="46" selection-start-line="46" selection-end-line="46" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/pypushflow/PythonActor.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="2455">
<state relative-caret-position="2460">
<caret line="173" column="13" selection-start-line="173" selection-start-column="13" selection-end-line="173" selection-end-column="13" />
<folding>
<element signature="e#1198#1207#0" expanded="true" />
......@@ -339,41 +315,37 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/pypushflow/Workflow.py">
<entry file="file://$PROJECT_DIR$/pypushflow/test/pythonErrorHandlerTest.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="299">
<caret line="46" lean-forward="true" selection-start-line="46" selection-end-line="46" />
<state relative-caret-position="450">
<caret line="30" selection-start-line="30" selection-end-line="30" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/pypushflow/test/test_Actors.py">
<entry file="file://$PROJECT_DIR$/pypushflow/Submodel.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="195">
<caret line="73" column="47" lean-forward="true" selection-start-line="73" selection-end-line="74" />
<state relative-caret-position="219">
<caret line="56" column="6" selection-start-line="56" selection-start-column="6" selection-end-line="56" selection-end-column="6" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/pypushflow/test/pythonActor1.py">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/pypushflow/test/test_Workflows.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="329">
<caret line="51" selection-start-line="51" selection-end-line="51" />
<state relative-caret-position="534">
<caret line="63" column="31" selection-start-line="63" selection-start-column="31" selection-end-line="63" selection-end-column="31" />
<folding>
<element signature="e#1198#1212#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/pypushflow/Submodel.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="90">
<caret line="56" column="10" selection-start-line="56" selection-start-column="10" selection-end-line="56" selection-end-column="10" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/pypushflow/test/TestWorkflow.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="180">
<caret line="43" column="57" selection-start-line="43" selection-start-column="57" selection-end-line="43" selection-end-column="57" />
<state relative-caret-position="273">
<caret line="24" lean-forward="true" selection-start-line="24" selection-end-line="24" />
<folding>
<element signature="e#1198#1238#0" expanded="true" />
</folding>
......
......@@ -31,9 +31,9 @@ logger = logging.getLogger('pypushflow')
class RouterActor(AbstractActor):
def __init__(self, parent=None, name='Router', itemName=None, listPort=[]):
def __init__(self, errorHandler=None, name='Router', itemName=None, listPort=[]):
AbstractActor.__init__(self, name)
self.parent=parent
self.errorHandler=errorHandler
self.name = name
self.itemName = itemName
self.listPort = listPort
......
......@@ -31,17 +31,17 @@ logger = logging.getLogger('pypushflow')
class StopActor(object):
def __init__(self, parent=None, name='Stop actor'):
self.parent=parent
def __init__(self, errorHandler=None, name='Stop actor'):
self.errorHandler=errorHandler
self.name = name
self.lock = multiprocessing.Lock()
self.lock.acquire()
self.outData = None
def trigger(self, inData):
logger.debug('In trigger {0}, parent = {1}'.format(self.name, self.parent))
if self.parent is not None:
self.parent.parent.stopActor.trigger(inData)
logger.debug('In trigger {0}, errorHandler = {1}'.format(self.name, self.errorHandler))
if self.errorHandler is not None:
self.errorHandler.errorHandler.stopActor.trigger(inData)
else:
self.outData = inData
self.lock.release()
......
......@@ -30,9 +30,9 @@ logger = logging.getLogger('pypushflow')
class Port(object):
def __init__(self, parent, name):
self.name = parent.name + '.' + name
self.parent = parent
def __init__(self, errorHandler, name):
self.name = errorHandler.name + '.' + name
self.errorHandler = errorHandler
self.listActor = []
self.inPortTrigger = None
......@@ -47,18 +47,18 @@ class Port(object):
logger.debug("In {0} trigger".format(self.name))
if len(self.listActor) > 0:
for actor in self.listActor:
logger.debug("In trigger {0} -> actorName {1}".format(self.parent.name, actor.name))
logger.debug("In trigger {0} -> actorName {1}".format(self.errorHandler.name, actor.name))
actor.trigger(*args, **kwargs)
if self.inPortTrigger is not None:
logger.debug("In {0} trigger, trigger = {1}".format(self.parent.name, self.inPortTrigger))
logger.debug("In {0} trigger, trigger = {1}".format(self.errorHandler.name, self.inPortTrigger))
self.inPortTrigger(*args, **kwargs)
class Submodel(object):
def __init__(self, parent=None, name=None, portNames=['In', 'Out']):
def __init__(self, errorHandler=None, name=None, portNames=['In', 'Out']):
self.name = name
self.parent = parent
self.errorHandler = errorHandler
self.dictPort = {}
self.listOnErrorActor = []
for portName in portNames:
......@@ -80,5 +80,5 @@ class Submodel(object):
for onErrorActor in self.listOnErrorActor:
logger.debug("In triggerOnError in subModule {0}, trigger actor {1}, inData = {2}".format(self.name, onErrorActor.name, args[0]))
onErrorActor.trigger(*args, **kwargs)
if self.parent is not None:
self.parent.triggerOnError(*args, **kwargs)
\ No newline at end of file
if self.errorHandler is not None:
self.errorHandler.triggerOnError(*args, **kwargs)
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment