diff --git a/README.rst b/README.rst index 2f9a67f..853cf00 100644 --- a/README.rst +++ b/README.rst @@ -22,7 +22,7 @@ Installation source $VIRTUAL_ENV/bin/activate # Install package - easy_install -U socketIOClient + easy_install -U socketIO-client Usage @@ -34,14 +34,14 @@ Activate isolated environment. :: Emit. :: - from socketIOClient import SocketIO + from socketIO_client import SocketIO socketIO = SocketIO('localhost', 8000) socketIO.emit('aaa', {'bbb': 'ccc'}) Emit with callback. :: - from socketIOClient import SocketIO + from socketIO_client import SocketIO def on_response(arg1, arg2, arg3, arg4): print arg1, arg2, arg3, arg4 @@ -52,7 +52,7 @@ Emit with callback. :: Define events. :: - from socketIOClient import SocketIO + from socketIO_client import SocketIO def on_ddd(arg1, arg2, arg3, arg4): print arg1, arg2, arg3, arg4 @@ -62,7 +62,7 @@ Define events. :: Define events in a namespace. :: - from socketIOClient import SocketIO, BaseNamespace + from socketIO_client import SocketIO, BaseNamespace class Namespace(BaseNamespace): @@ -73,7 +73,7 @@ Define events in a namespace. :: Define standard events. :: - from socketIOClient import SocketIO, BaseNamespace + from socketIO_client import SocketIO, BaseNamespace class Namespace(BaseNamespace): diff --git a/setup.py b/setup.py index 0581540..1938d55 100755 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ import os from setuptools import setup, find_packages -from socketIOClient import __version__ +from socketIO_client import __version__ here = os.path.abspath(os.path.dirname(__file__)) diff --git a/socketIOClient/__init__.py b/socketIO_client/__init__.py similarity index 97% rename from socketIOClient/__init__.py rename to socketIO_client/__init__.py index ce102d8..5d7a013 100644 --- a/socketIOClient/__init__.py +++ b/socketIO_client/__init__.py @@ -105,14 +105,11 @@ class SocketIO(object): return int(code), packetID, channelName, data def _send_packet(self, code, channelName='', data='', callback=None): - try: - self.connection.send(':'.join([ - str(code), - self.set_callback(callback) if callback else '', - channelName, - data])) - except Exception, e: - pass + self.connection.send(':'.join([ + str(code), + self.set_callback(callback) if callback else '', + channelName, + data])) def disconnect(self, channelName=''): self._send_packet(0, channelName) diff --git a/socketIOClient/tests.py b/socketIO_client/tests.py similarity index 96% rename from socketIOClient/tests.py rename to socketIO_client/tests.py index 409e9bb..241d37e 100644 --- a/socketIOClient/tests.py +++ b/socketIO_client/tests.py @@ -1,4 +1,4 @@ -from socketIOClient import SocketIO, BaseNamespace +from socketIO_client import SocketIO, BaseNamespace from time import sleep from unittest import TestCase