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

Added space after # in ReadStateMachine.py #41

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
18 changes: 9 additions & 9 deletions src/ReadStateMachine.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ def ReadStateMachineFile(xml_file: str):
tree = ET.parse(xml_file)
root = tree.getroot()
for states_child in root:
#print(states_child.tag, states_child.attrib)
# print(states_child.tag, states_child.attrib)
# States Element
if states_child.tag == "State":
#print("State element")
# print("State element")
# State Element
state_name = ""
events = {}
for state_child in states_child:
#print(state_child.tag, state_child.attrib)
# print(state_child.tag, state_child.attrib)
if state_child.tag == "Event":
#print("Event element")
# print("Event element")
# State->Event Element
event_name = ""
to_state = ""
Expand All @@ -35,13 +35,13 @@ def ReadStateMachineFile(xml_file: str):

for event_child in state_child:

#print(event_child.tag, event_child.attrib)
# print(event_child.tag, event_child.attrib)
if event_child.tag == "Name":
#print("Name element = ", event_child.text)
# print("Name element = ", event_child.text)
# State->Event->Name Element
event_name = event_child.text
elif event_child.tag == "ToState":
#print("ToState element = ", event_child.text)
# print("ToState element = ", event_child.text)
# State->Event->ToState Element
to_state = event_child.text
elif event_child.tag == "PreConditions":
Expand Down Expand Up @@ -113,14 +113,14 @@ def ReadStateMachineFile(xml_file: str):
event_name, to_state, pre_conditions, post_conditions, pre_actions, post_actions)
# print(event.to_string())
elif state_child.tag == "Name":
#print("Name element = ", state_child.text)
# print("Name element = ", state_child.text)
# State->Name Element
state_name = state_child.text

states[state_name] = State(state_name, events)

elif states_child.tag == "Initial_State":
#print ("Initial_State element = ", states_child.text)
# print ("Initial_State element = ", states_child.text)
# Initial_State Element
initial_state = states_child.text

Expand Down