mirror of
https://github.com/avatao-content/test-tutorial-framework
synced 2024-11-14 16:17:17 +00:00
Fix pipe_io_auxlib
This commit is contained in:
parent
9faafa7f49
commit
6e8fc588f1
@ -30,7 +30,7 @@ class SignMessagePipeIOEventHandler(PipeIOEventHandlerBase):
|
||||
message = loads(message_bytes)
|
||||
sign_message(self.auth_key, message)
|
||||
if self.forwarding:
|
||||
self.server_connector.send(message)
|
||||
self.server_connector.send_message(message)
|
||||
self.pipe_io.send_message(dumps(message).encode())
|
||||
|
||||
|
||||
@ -77,7 +77,7 @@ class BotPipeIOEventHandler(PipeIOEventHandlerBase):
|
||||
def handle_pipe_event(self, message_bytes):
|
||||
if message_bytes == b"":
|
||||
if self.queue:
|
||||
self.server_connector.send({
|
||||
self.server_connector.send_message({
|
||||
'key': 'queueMessages',
|
||||
'data': {
|
||||
'messages': self.queue
|
||||
@ -137,9 +137,9 @@ class DeployPipeIOEventHandler(PipeIOEventHandlerBase):
|
||||
|
||||
self.expected = False
|
||||
if message_bytes == b'true':
|
||||
self.server_connector.send(self.onsuccess)
|
||||
self.server_connector.send_message(self.onsuccess)
|
||||
elif message_bytes == b'false':
|
||||
self.server_connector.send(self.onerror)
|
||||
self.server_connector.send_message(self.onerror)
|
||||
else:
|
||||
raise ValueError(
|
||||
f'{self.pipe_io.in_pipe}: Expected "true" or "false".'
|
||||
@ -178,7 +178,7 @@ class IdePipeIOEventHandler(PipeIOEventHandlerBase):
|
||||
|
||||
def handle_pipe_event(self, message_bytes):
|
||||
if not self.selected:
|
||||
self.server_connector.send({
|
||||
self.server_connector.send_message({
|
||||
'key': 'mirror',
|
||||
'data': {
|
||||
'key': 'ide',
|
||||
@ -189,7 +189,7 @@ class IdePipeIOEventHandler(PipeIOEventHandlerBase):
|
||||
}
|
||||
})
|
||||
|
||||
self.server_connector.send({
|
||||
self.server_connector.send_message({
|
||||
'key': 'mirror',
|
||||
'data': {
|
||||
'key': 'ide',
|
||||
@ -199,7 +199,7 @@ class IdePipeIOEventHandler(PipeIOEventHandlerBase):
|
||||
}
|
||||
}
|
||||
})
|
||||
self.server_connector.send({
|
||||
self.server_connector.send_message({
|
||||
'key': 'mirror',
|
||||
'data': {
|
||||
'key': 'ide',
|
||||
@ -229,7 +229,7 @@ class FSMPipeIOEventHandler(PipeIOEventHandlerBase):
|
||||
self.pipe_io.send_message(message['data']['current_state'].encode())
|
||||
|
||||
def handle_pipe_event(self, message_bytes):
|
||||
self.server_connector.send({
|
||||
self.server_connector.send_message({
|
||||
'key': '',
|
||||
'trigger': message_bytes.decode()
|
||||
})
|
||||
|
@ -31,8 +31,7 @@ if __name__ == '__main__':
|
||||
json_pipe = PipeIOEventHandler(
|
||||
'',
|
||||
'/tmp/tfw_json_send',
|
||||
'/tmp/tfw_json_recv',
|
||||
permissions=0o666
|
||||
'/tmp/tfw_json_recv'
|
||||
)
|
||||
|
||||
sign_pipe = SignMessagePipeIOEventHandler(
|
||||
@ -48,7 +47,8 @@ if __name__ == '__main__':
|
||||
|
||||
bot_pipe = BotPipeIOEventHandler(
|
||||
'/tmp/tfw_bot_send',
|
||||
'/tmp/tfw_bot_recv'
|
||||
'/tmp/tfw_bot_recv',
|
||||
permissions=0o666
|
||||
)
|
||||
|
||||
deploy_pipe = DeployPipeIOEventHandler(
|
||||
|
@ -11,14 +11,8 @@ class UserOps:
|
||||
self.username = username
|
||||
self.password = password
|
||||
self.db_session = db_session
|
||||
self.pipe = PipeWriter('/tmp/tfw_json_send')
|
||||
self.log = lambda message: self.pipe.send_message(dumps({
|
||||
'key': 'message',
|
||||
'data': {
|
||||
'originator': 'Authenticator',
|
||||
'message': message
|
||||
}
|
||||
}).encode())
|
||||
self.pipe = PipeWriter('/tmp/tfw_bot_send')
|
||||
self.log = lambda message: self.pipe.send_message(message.encode()+b"\n")
|
||||
|
||||
def authenticate(self):
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user