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
27
28from __future__ import absolute_import
29
30import sys
31import platform
32
33import twisted
34
35import autobahn
36
37# Twisted specific utilities (these should really be in Twisted, but
38# they aren't, and we use these in example code, so it must be part of
39# the public API)
40from autobahn.twisted.util import sleep
41from autobahn.twisted.choosereactor import install_reactor
42
43# WebSocket protocol support
44from autobahn.twisted.websocket import \
45    WebSocketServerProtocol, \
46    WebSocketClientProtocol, \
47    WebSocketServerFactory, \
48    WebSocketClientFactory
49
50# support for running Twisted stream protocols over WebSocket
51from autobahn.twisted.websocket import WrappingWebSocketServerFactory, \
52    WrappingWebSocketClientFactory
53
54# Twisted Web support - FIXME: these imports trigger import of Twisted reactor!
55# from autobahn.twisted.resource import WebSocketResource, WSGIRootResource
56
57# WAMP support
58from autobahn.twisted.wamp import ApplicationSession
59
60
61__all__ = (
62    # this should really be in Twisted
63    'sleep',
64    'install_reactor',
65
66    # WebSocket
67    'WebSocketServerProtocol',
68    'WebSocketClientProtocol',
69    'WebSocketServerFactory',
70    'WebSocketClientFactory',
71
72    # wrapping stream protocols in WebSocket
73    'WrappingWebSocketServerFactory',
74    'WrappingWebSocketClientFactory',
75
76    # Twisted Web - FIXME: see comment for import above
77    # 'WebSocketResource',
78
79    # this should really be in Twisted - FIXME: see comment for import above
80    # 'WSGIRootResource',
81
82    # WAMP support
83    'ApplicationSession',
84)
85
86__ident__ = u'Autobahn/{}-Twisted/{}-{}/{}'.format(autobahn.__version__, twisted.__version__, platform.python_implementation(), '.'.join([str(x) for x in list(sys.version_info[:3])]))
87"""
88AutobahnPython library implementation (eg. "Autobahn/0.13.0-Twisted/15.5.0-CPython/3.5.1")
89"""
90