You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

__init__.py 3.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. ###############################################################################
  2. #
  3. # The MIT License (MIT)
  4. #
  5. # Copyright (c) Crossbar.io Technologies GmbH
  6. #
  7. # Permission is hereby granted, free of charge, to any person obtaining a copy
  8. # of this software and associated documentation files (the "Software"), to deal
  9. # in the Software without restriction, including without limitation the rights
  10. # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  11. # copies of the Software, and to permit persons to whom the Software is
  12. # furnished to do so, subject to the following conditions:
  13. #
  14. # The above copyright notice and this permission notice shall be included in
  15. # all copies or substantial portions of the Software.
  16. #
  17. # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  18. # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  19. # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  20. # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  21. # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  22. # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  23. # THE SOFTWARE.
  24. #
  25. ###############################################################################
  26. from __future__ import absolute_import
  27. import sys
  28. import platform
  29. import twisted
  30. import autobahn
  31. # Twisted specific utilities (these should really be in Twisted, but
  32. # they aren't, and we use these in example code, so it must be part of
  33. # the public API)
  34. from autobahn.twisted.util import sleep
  35. from autobahn.twisted.choosereactor import install_reactor
  36. # WebSocket protocol support
  37. from autobahn.twisted.websocket import \
  38. WebSocketServerProtocol, \
  39. WebSocketClientProtocol, \
  40. WebSocketServerFactory, \
  41. WebSocketClientFactory
  42. # support for running Twisted stream protocols over WebSocket
  43. from autobahn.twisted.websocket import WrappingWebSocketServerFactory, \
  44. WrappingWebSocketClientFactory
  45. # Twisted Web support - FIXME: these imports trigger import of Twisted reactor!
  46. # from autobahn.twisted.resource import WebSocketResource, WSGIRootResource
  47. # WAMP support
  48. from autobahn.twisted.wamp import ApplicationSession
  49. __all__ = (
  50. # this should really be in Twisted
  51. 'sleep',
  52. 'install_reactor',
  53. # WebSocket
  54. 'WebSocketServerProtocol',
  55. 'WebSocketClientProtocol',
  56. 'WebSocketServerFactory',
  57. 'WebSocketClientFactory',
  58. # wrapping stream protocols in WebSocket
  59. 'WrappingWebSocketServerFactory',
  60. 'WrappingWebSocketClientFactory',
  61. # Twisted Web - FIXME: see comment for import above
  62. # 'WebSocketResource',
  63. # this should really be in Twisted - FIXME: see comment for import above
  64. # 'WSGIRootResource',
  65. # WAMP support
  66. 'ApplicationSession',
  67. )
  68. __ident__ = u'Autobahn/{}-Twisted/{}-{}/{}'.format(autobahn.__version__, twisted.__version__, platform.python_implementation(), '.'.join([str(x) for x in list(sys.version_info[:3])]))
  69. """
  70. AutobahnPython library implementation (eg. "Autobahn/0.13.0-Twisted/15.5.0-CPython/3.5.1")
  71. """