PyPI does not like unfamiliar RST syntax
This commit is contained in:
parent
00dcbde6ac
commit
5d97fa7f79
2 changed files with 21 additions and 37 deletions
56
README.rst
56
README.rst
|
|
@ -2,27 +2,12 @@ socketIO-client
|
|||
===============
|
||||
Here is a socket.io_ client library for Python. You can use it to write test code for your socket.io_ server.
|
||||
|
||||
.. _socket.io: http://socket.io
|
||||
|
||||
Thanks to rod_ for the `StackOverflow question and answer`__ on which this code is based.
|
||||
|
||||
.. _rod: http://stackoverflow.com/users/370115/rod
|
||||
.. _StackOverflowQA: http://stackoverflow.com/questions/6692908/formatting-messages-to-send-to-socket-io-node-js-server-from-python-client
|
||||
__ StackOverflowQA_
|
||||
|
||||
Thanks to liris_ for websocket-client_ and to guille_ for the `socket.io specification`_.
|
||||
|
||||
.. _liris: https://github.com/liris
|
||||
.. _websocket-client: https://github.com/liris/websocket-client
|
||||
.. _guille: https://github.com/guille
|
||||
.. _socket.io specification: https://github.com/LearnBoost/socket.io-spec
|
||||
|
||||
Thanks to `Paul Kienzle`_, `Josh VanderLinden`_, `Ian Fitzpatrick`_ for submitting code to expand support of the socket.io protocol.
|
||||
|
||||
.. _Paul Kienzle: https://github.com/pkienzle
|
||||
.. _Josh VanderLinden: https://github.com/codekoala
|
||||
.. _Ian Fitzpatrick: https://github.com/GraphEffect
|
||||
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
|
@ -42,25 +27,19 @@ Installation
|
|||
|
||||
Usage
|
||||
-----
|
||||
Activate isolated environment.
|
||||
|
||||
.. code-block:: bash
|
||||
Activate isolated environment. ::
|
||||
|
||||
VIRTUAL_ENV=$HOME/.virtualenv
|
||||
source $VIRTUAL_ENV/bin/activate
|
||||
|
||||
Emit.
|
||||
|
||||
.. code-block:: python
|
||||
Emit. ::
|
||||
|
||||
from socketIOClient import SocketIO
|
||||
|
||||
socketIO = SocketIO('localhost', 8000)
|
||||
socketIO.emit('aaa', {'bbb': 'ccc'})
|
||||
|
||||
Emit with callback.
|
||||
|
||||
.. code-block:: python
|
||||
Emit with callback. ::
|
||||
|
||||
from socketIOClient import SocketIO
|
||||
|
||||
|
|
@ -71,9 +50,7 @@ Emit with callback.
|
|||
socketIO.emit('aaa', {'bbb': 'ccc'}, on_response)
|
||||
socketIO.wait()
|
||||
|
||||
Define events.
|
||||
|
||||
.. code-block:: python
|
||||
Define events. ::
|
||||
|
||||
from socketIOClient import SocketIO
|
||||
|
||||
|
|
@ -83,9 +60,7 @@ Define events.
|
|||
socketIO = SocketIO('localhost', 8000)
|
||||
socketIO.on('ddd', on_ddd)
|
||||
|
||||
Define events in a namespace.
|
||||
|
||||
.. code-block:: python
|
||||
Define events in a namespace. ::
|
||||
|
||||
from socketIOClient import SocketIO, BaseNamespace
|
||||
|
||||
|
|
@ -96,9 +71,7 @@ Define events in a namespace.
|
|||
|
||||
socketIO = SocketIO('localhost', 8000, Namespace)
|
||||
|
||||
Define standard events.
|
||||
|
||||
.. code-block:: python
|
||||
Define standard events. ::
|
||||
|
||||
from socketIOClient import SocketIO, BaseNamespace
|
||||
|
||||
|
|
@ -118,9 +91,7 @@ Define standard events.
|
|||
|
||||
socketIO = SocketIO('localhost', 8000, Namespace)
|
||||
|
||||
Define different behavior for different channels on a single socket.
|
||||
|
||||
.. code-block:: python
|
||||
Define different behavior for different channels on a single socket. ::
|
||||
|
||||
mainSocket = SocketIO('localhost', 8000, MainNamespace())
|
||||
chatSocket = mainSocket.connect('/chat', ChatNamespace())
|
||||
|
|
@ -130,3 +101,16 @@ Define different behavior for different channels on a single socket.
|
|||
License
|
||||
-------
|
||||
This software is available under the MIT License.
|
||||
|
||||
|
||||
.. _socket.io: http://socket.io
|
||||
.. _rod: http://stackoverflow.com/users/370115/rod
|
||||
.. _StackOverflowQA: http://stackoverflow.com/questions/6692908/formatting-messages-to-send-to-socket-io-node-js-server-from-python-client
|
||||
__ StackOverflowQA_
|
||||
.. _liris: https://github.com/liris
|
||||
.. _websocket-client: https://github.com/liris/websocket-client
|
||||
.. _guille: https://github.com/guille
|
||||
.. _socket.io specification: https://github.com/LearnBoost/socket.io-spec
|
||||
.. _Paul Kienzle: https://github.com/pkienzle
|
||||
.. _Josh VanderLinden: https://github.com/codekoala
|
||||
.. _Ian Fitzpatrick: https://github.com/GraphEffect
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ from threading import Thread, Event
|
|||
from urllib import urlopen
|
||||
|
||||
|
||||
__version__ = '0.1.2'
|
||||
__version__ = '0.2'
|
||||
|
||||
|
||||
PROTOCOL = 1 # SocketIO protocol version
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue