platypush/plugins/media/kodi/__init__.py
def _websocket_thread(self):
        """
        Initialize the websocket JSON RPC interface, if available, to receive player notifications
        """

        def thread_hndl():
            try:
                import websocket
            except ImportError:
                self.logger.warning('websocket-client is not installed, Kodi events will be disabled')
                return

            if not self._ws:
                self._ws = websocket.WebSocketApp(self.websocket_url,
                                                  on_message=self._on_ws_msg(),
                                                  on_error=self._on_ws_error(),
                                                  on_close=self._on_ws_close())

                self.logger.info('Kodi websocket interface for events started')
                self._ws.run_forever()

        return thread_hndl

        Initialize the websocket JSON RPC interface, if available, to receive player notifications
        
Initialize the websocket JSON RPC interface, if available, to receive player notifications
Initialize the websocket JSON RPC interface if available to receive player notifications
def _websocket_thread(self):
        def thread_hndl():
            try:
                import websocket
            except ImportError:
                self.logger.warning('websocket-client is not installed, Kodi events will be disabled')
                return
            if not self._ws:
                self._ws = websocket.WebSocketApp(self.websocket_url,
                                                  on_message=self._on_ws_msg(),
                                                  on_error=self._on_ws_error(),
                                                  on_close=self._on_ws_close())
                self.logger.info('Kodi websocket interface for events started')
                self._ws.run_forever()
        return thread_hndl
def _websocket_thread ( self ) : def thread_hndl ( ) : try : import websocket except ImportError : self . logger . warning ( 'websocket-client is not installed, Kodi events will be disabled' ) return if not self . _ws : self . _ws = websocket . WebSocketApp ( self . websocket_url , on_message = self . _on_ws_msg ( ) , on_error = self . _on_ws_error ( ) , on_close = self . _on_ws_close ( ) ) self . logger . info ( 'Kodi websocket interface for events started' ) self . _ws . run_forever ( ) return thread_hndl
Initialize the websocket JSON RPC interface, if available, to receive player notifications
Initialize the websocket JSON RPC interface if available to receive player notifications
"""
        Initialize the websocket JSON RPC interface, if available, to receive player notifications
        """
self