mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
1555725117
commit
87d16a3f74
@ -5,7 +5,7 @@
|
|||||||
from __future__ import (unicode_literals, division, absolute_import,
|
from __future__ import (unicode_literals, division, absolute_import,
|
||||||
print_function)
|
print_function)
|
||||||
|
|
||||||
import codecs, httplib, struct, os, weakref, repr as reprlib, socket
|
import codecs, httplib, struct, os, weakref, socket
|
||||||
from base64 import standard_b64encode
|
from base64 import standard_b64encode
|
||||||
from collections import deque
|
from collections import deque
|
||||||
from functools import partial
|
from functools import partial
|
||||||
@ -454,6 +454,10 @@ class DummyHandler(object):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
# Testing {{{
|
# Testing {{{
|
||||||
|
|
||||||
|
# Run this file with calibre-debug and use wstest to run the Autobahn test
|
||||||
|
# suite
|
||||||
|
|
||||||
class EchoClientHandler(object):
|
class EchoClientHandler(object):
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
@ -477,7 +481,7 @@ class EchoClientHandler(object):
|
|||||||
j = '' if isinstance(self.msg_buf[0], type('')) else b''
|
j = '' if isinstance(self.msg_buf[0], type('')) else b''
|
||||||
msg = j.join(self.msg_buf)
|
msg = j.join(self.msg_buf)
|
||||||
self.msg_buf = []
|
self.msg_buf = []
|
||||||
print('Received message from client:', reprlib.repr(msg))
|
# print('Received message from client:', reprlib.repr(msg))
|
||||||
self.conn(connection_id).send_websocket_message(msg)
|
self.conn(connection_id).send_websocket_message(msg)
|
||||||
|
|
||||||
def handle_websocket_close(self, connection_id):
|
def handle_websocket_close(self, connection_id):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user