Skip to content

Commit 672a6d4

Browse files
committed
Merge pull request Lawouach#118 from husio/master
base example documentation fix
2 parents 123bed4 + b4d47c6 commit 672a6d4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/sources/basics.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ The :class:`WebSocket <ws4py.websocket.WebSocket>` class should be sub-classed b
1212
For instance a straightforward echo application would look like this:
1313

1414
.. code-block:: python
15-
15+
1616
class EchoWebSocket(WebSocket):
1717
def received_message(self, message):
1818
self.send(message.data, message.is_binary)
19-
19+
2020
Other useful methods to implement are:
2121

2222
* :func:`opened() <ws4py.websocket.WebSocket.opened>` which is called whenever the WebSocket handshake is done.
@@ -30,11 +30,11 @@ necessarily a connected socket, in fact, you don't even need a socket at all.
3030

3131
.. code-block:: python
3232
33-
>>> from ws4py.templating import TextMessage
33+
>>> from ws4py.messaging import TextMessage
3434
>>> def data_source():
3535
>>> yield TextMessage(u'hello world')
3636
3737
>>> from mock import MagicMock
38-
>>> source = MagicMock(side_effect=source)
38+
>>> source = MagicMock(side_effect=data_source)
3939
>>> ws = EchoWebSocket(sock=source)
4040
>>> ws.send(u'hello there')

0 commit comments

Comments
 (0)