Event override test
This commit is contained in:
parent
24848c9afb
commit
e228c2ac53
|
@ -2,8 +2,19 @@ from bottle import route, get, static_file, run
|
|||
from bottle.ext.websocket import GeventWebSocketServer
|
||||
from bottle.ext.websocket import websocket
|
||||
from os.path import join as pathjoin
|
||||
from statemachine import DialingState
|
||||
import threading
|
||||
|
||||
class WebDialingState(DialingState):
|
||||
def __init__(self, controller):
|
||||
super().__init__(controller)
|
||||
|
||||
def on_nummernschalter_input(self, num):
|
||||
print("calling super method")
|
||||
super().on_nummernschalter_input(num)
|
||||
print("local method got num: " + str(num))
|
||||
|
||||
|
||||
class FeTapWeb():
|
||||
def __init__(self, config, statemachine_controller):
|
||||
self.config = config
|
||||
|
@ -19,6 +30,9 @@ class FeTapWeb():
|
|||
return "<h1>Hello world!</h1>"
|
||||
|
||||
def publish_status(self):
|
||||
if isinstance(self.controller.state, DialingState):
|
||||
self.controller.state = WebDialingState(self.controller)
|
||||
print("dialing")
|
||||
for ws in self.websockets:
|
||||
ws.send("this is a message triggered from the server")
|
||||
return "ok"
|
||||
|
|
Loading…
Reference in a new issue