# Path: ebu_tt_live/strings.py
# ERR_WS_INVALID_ACTION = gettext('Invalid action: {action}')
# 
# ERR_WS_NOT_CONSUMER = gettext('This socket does not belong to a consumer')
# 
# ERR_WS_NOT_PRODUCER = gettext('This socket does not belong to a producer.')
# 
# ERR_WS_RECEIVE_VIA_PRODUCER = gettext('Producer socket cannot be used to receive data')
# 
# ERR_WS_SEND_VIA_CONSUMER = gettext('Consumer socket cannot be used to send data')
# 
# Path: ebu_tt_live/errors.py
# class UnexpectedSequenceIdentifierError(Exception):
#     pass


from autobahn.twisted.websocket import WebSocketClientProtocol, WebSocketServerFactory, WebSocketServerProtocol, \
    listenWS, WebSocketClientFactory, connectWS
from twisted.internet import interfaces, reactor
from hyperlink import URL
from zope.interface import implementer
from logging import getLogger
from ebu_tt_live.strings import ERR_WS_INVALID_ACTION, ERR_WS_NOT_CONSUMER, ERR_WS_NOT_PRODUCER, \
    ERR_WS_RECEIVE_VIA_PRODUCER, ERR_WS_SEND_VIA_CONSUMER
from ebu_tt_live.errors import UnexpectedSequenceIdentifierError
from .base import IBroadcaster
import json
import six





log = getLogger(__name__)

class UserInputServerProtocol(WebSocketServerProtocol):
    def onOpen(self):

# Path: ebu_tt_live/strings.py
# ERR_WS_INVALID_ACTION = gettext('Invalid action: {action}')
# 
# ERR_WS_NOT_CONSUMER = gettext('This socket does not belong to a consumer')
# 
# ERR_WS_NOT_PRODUCER = gettext('This socket does not belong to a producer.')
# 
# ERR_WS_RECEIVE_VIA_PRODUCER = gettext('Producer socket cannot be used to receive data')
# 
# ERR_WS_SEND_VIA_CONSUMER = gettext('Consumer socket cannot be used to send data')
# 
# Path: ebu_tt_live/errors.py
# class UnexpectedSequenceIdentifierError(Exception):
#     pass


# Path: ebu_tt_live/twisted/websocket.py
from autobahn.twisted.websocket import WebSocketClientProtocol, WebSocketServerFactory, WebSocketServerProtocol, \
    listenWS, WebSocketClientFactory, connectWS
from twisted.internet import interfaces, reactor
from hyperlink import URL
from zope.interface import implementer
from logging import getLogger
from ebu_tt_live.strings import ERR_WS_INVALID_ACTION, ERR_WS_NOT_CONSUMER, ERR_WS_NOT_PRODUCER, \
    ERR_WS_RECEIVE_VIA_PRODUCER, ERR_WS_SEND_VIA_CONSUMER
from ebu_tt_live.errors import UnexpectedSequenceIdentifierError
from .base import IBroadcaster
import json
import six






log = getLogger(__name__)

class UserInputServerProtocol(WebSocketServerProtocol):
    def onOpen(self):

        self.factory.register(self)