Debug
This commit is contained in:
		
							parent
							
								
									e364c7d965
								
							
						
					
					
						commit
						8fa91e5e5f
					
				@ -12,6 +12,7 @@ versionstring='Taurix TellMe server v' + __version__
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
app = Flask(__name__)
 | 
					app = Flask(__name__)
 | 
				
			||||||
lock = threading.Lock()
 | 
					lock = threading.Lock()
 | 
				
			||||||
 | 
					ws = None
 | 
				
			||||||
 | 
					
 | 
				
			||||||
hooks = {}
 | 
					hooks = {}
 | 
				
			||||||
with open(r'/etc/tellme/hooks.yml') as hooksfile:
 | 
					with open(r'/etc/tellme/hooks.yml') as hooksfile:
 | 
				
			||||||
@ -29,8 +30,10 @@ def sendmessage(target, message):
 | 
				
			|||||||
    json_command = json.dumps(command)
 | 
					    json_command = json.dumps(command)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    """ Connects to WebSocket server, sends a message, and returns the response """
 | 
					    """ Connects to WebSocket server, sends a message, and returns the response """
 | 
				
			||||||
    # uri = "ws://localhost:5080"
 | 
					    if ws is None:
 | 
				
			||||||
    # ws = websocket.create_connection(uri)  # Blocking WebSocket connection
 | 
					        uri = "ws://localhost:5080"
 | 
				
			||||||
 | 
					        ws = websocket.create_connection(uri)  # Blocking WebSocket connection
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ws.send(json_command)  # Send message to WebSocket
 | 
					    ws.send(json_command)  # Send message to WebSocket
 | 
				
			||||||
    responsejson = ws.recv()  # Receive response
 | 
					    responsejson = ws.recv()  # Receive response
 | 
				
			||||||
    response = json.loads(responsejson)
 | 
					    response = json.loads(responsejson)
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user