Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Remove unnecessary parentheses after keyword #33

Merged
merged 1 commit into from
Oct 5, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/StateMachine.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def __CheckConditions(self, conditions):
all_conditions_satisfied: a boolean that indicates if all conditions are satisfied
"""
all_conditions_satisfied = True
if(conditions is not None):
if conditions is not None:
_conditions = conditions.conditions_list
for condition in _conditions:
module, expression = self.__PrepareExpression(
Expand Down Expand Up @@ -76,7 +76,7 @@ def __ExecActions(self, actions):
all_action_executed: a boolean that indicates if all actions are executed
"""
all_action_executed = True
if(actions is not None):
if actions is not None:
_actions = actions.actions_list
for action in _actions:
module, expression = self.__PrepareExpression(
Expand Down Expand Up @@ -138,7 +138,7 @@ def LoadStateMachine(self):
"""
This Function load state machine configuration
"""
if (self.states is not None):
if self.states is not None:
logging.error("State Machine already loaded")
else:
self.states, self.current_state = ReadStateMachineFile(
Expand Down Expand Up @@ -171,12 +171,12 @@ def InjectEvent(self, event: str):
# Preconditions
all_pre_conditions_satisfied = self.__CheckConditions(
handled_event.pre_conditions)
if(all_pre_conditions_satisfied):
if all_pre_conditions_satisfied:
logging.debug("PreConditions satisfied")
# Preactions
all_pre_actions_executed = self.__ExecActions(
handled_event.pre_actions)
if(all_pre_actions_executed):
if all_pre_actions_executed:
logging.debug("PreActions Executed")
# Transition
logging.debug("Transition %s ------> %s",
Expand All @@ -185,12 +185,12 @@ def InjectEvent(self, event: str):
# Postactions
all_post_actions_executed = self.__ExecActions(
handled_event.post_actions)
if(all_post_actions_executed):
if all_post_actions_executed:
logging.debug("PostActions Executed")
# Postconditions
all_post_conditions_satisfied = self.__CheckConditions(
handled_event.post_conditions)
if(all_post_conditions_satisfied):
if all_post_conditions_satisfied:
logging.debug("PostConditions Satisfied")
else:
logging.error(
Expand Down