AFischer1985 commited on
Commit
c34d1b1
·
1 Parent(s): eda175a

Update run.py

Browse files
Files changed (1) hide show
  1. run.py +2 -2
run.py CHANGED
@@ -28,8 +28,6 @@ def respond(state, chat_history, visible_elemIDs):
28
  global internal_state
29
  previous_state = internal_state
30
  internal_state = state
31
- visible_elemIDs= [e for e in visible_elemIDs
32
- if ((str(e) != str(internal_state))|(str(e)=="1"))] # delete some buttons
33
  if(str(state) in [str(e) for e in visible_elemIDs]): # react to Buttons
34
  bot_message = f"I was in state \"{previous_state}\" and am now in state \"{internal_state}\". please click another button."
35
  print("respond to button!")
@@ -40,6 +38,8 @@ def respond(state, chat_history, visible_elemIDs):
40
  state="0"
41
  print("respond to text!")
42
  chat_history.append((state, bot_message))
 
 
43
  if(len(visible_elemIDs)==0): # if visible_elemIDs has zero length, reset
44
  print("restore visibility to "+str(defaultElemIDs))
45
  visible_elemIDs=defaultElemIDs
 
28
  global internal_state
29
  previous_state = internal_state
30
  internal_state = state
 
 
31
  if(str(state) in [str(e) for e in visible_elemIDs]): # react to Buttons
32
  bot_message = f"I was in state \"{previous_state}\" and am now in state \"{internal_state}\". please click another button."
33
  print("respond to button!")
 
38
  state="0"
39
  print("respond to text!")
40
  chat_history.append((state, bot_message))
41
+ visible_elemIDs= [e for e in visible_elemIDs
42
+ if ((str(e) != str(internal_state))|(str(e)=="1")|(str(e)=="0"))] # delete some buttons
43
  if(len(visible_elemIDs)==0): # if visible_elemIDs has zero length, reset
44
  print("restore visibility to "+str(defaultElemIDs))
45
  visible_elemIDs=defaultElemIDs