def on_message(self, message): print(message) dbc.setStatusForComponentInDB(message) dbc.writeComponentsToJsonFile() for client in cl: client.write_message(decodejson())
def open(self): if self not in cl: cl.append(self) print("Connection accepted from:" + repr(self.request.remote_ip)) dbc.writeComponentsToJsonFile() self.write_message(decodejson())