1
0
mirror of https://github.com/avatao-content/test-tutorial-framework synced 2024-11-14 21:57:17 +00:00

Merge pull request #4 from avatao-content/networking_refactor

Comply new TFWServerConnector API
This commit is contained in:
Bokros Bálint 2018-04-16 13:06:46 +02:00 committed by GitHub
commit 7905f51922
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,19 +17,19 @@ def cenator(history):
class TestCommands(TerminalCommands): class TestCommands(TerminalCommands):
def command_selectdir(self, *args): def command_selectdir(self, *args):
TFWServerConnector().send_to_eventhandler('webide', TFWServerConnector().send_to_eventhandler({'key': 'webide',
{'data': {'command': 'selectdir', 'data': {'command': 'selectdir',
'directory': args[0]}}) 'directory': args[0]}})
def command_trigger(self, *args): def command_trigger(self, *args):
TFWServerConnector().send('selectdir_needs_no_key', TFWServerConnector().send({'key': '',
{'trigger': args[0]}) 'trigger': args[0]})
def command_togglenext(self, *args): def command_togglenext(self, *args):
if not hasattr(self, 'togglenext_visible'): if not hasattr(self, 'togglenext_visible'):
self.togglenext_visible = True self.togglenext_visible = True
TFWServerConnector().send('messagecontrol', TFWServerConnector().send({'key': 'messagecontrol',
{'data': {'command': 'showbutton', 'data': {'command': 'showbutton',
'next_visibility': self.togglenext_visible}}) 'next_visibility': self.togglenext_visible}})
self.togglenext_visible = not self.togglenext_visible self.togglenext_visible = not self.togglenext_visible