Commits

Jeffrey Gelens committed 28914d5

Wamp fixes

Comments (0)

Files changed (2)

geventwebsocket/__init__.py

 VERSION = (0, 4, 0, 'alpha', 0)
 
+__all__ = [
+    'WebSocketApplication',
+    'Resource',
+    'WebSocketServer',
+    'WebSocketError',
+    'get_version'
+]
+
 
 def get_version(*args, **kwargs):
     from .utils import get_version
     return get_version(*args, **kwargs)
 
-
-from .resource import WebSocketApplication, Resource
-from .server import WebSocketServer
-from .exceptions import WebSocketError
-
-__all__ = [WebSocketApplication, Resource, WebSocketServer, WebSocketError,
-           get_version]
+try:
+    from .resource import WebSocketApplication, Resource
+    from .server import WebSocketServer
+    from .exceptions import WebSocketError
+except ImportError:
+    pass

geventwebsocket/protocols/wamp.py

 
         self.server.channels.create(*args, **kwargs)
 
-    def send_welcome(self):
+    def do_handshake(self):
         from geventwebsocket import get_version
 
         welcome = [
 
     def on_open(self):
         self.app.on_open()
+        self.do_handshake()
 
     def on_message(self, message):
         data = json.loads(message)