コード例 #1
0
    def __init__(self):
        # type: () -> None
        """

        """
        if PluginBridge._logger is not None:
            return

        PluginBridge._logger = module_logger.getChild(type(self).__name__)
        try:
            PluginBridge._registered_slots = []
            Monitor.register_abort_listener(type(self).on_abort_event)
        except AbortException:
            reraise(*sys.exc_info())
        except Exception as e:
            PluginBridge._logger.exception('')
コード例 #2
0
        """

        :return:
        """
        try:
            if self._file is not None:
                self._file.close()
                self._file = None
                with Playlist._playlist_lock:
                    del Playlist._playlists[self._playlist_name]
        except Exception:
            pass

    @staticmethod
    def shutdown():
        # type: () -> None
        """

        :return:
        """
        try:
            with Playlist._playlist_lock:
                for playlist in Playlist._playlists.copy().values():
                    playlist.close()
        finally:
            with Playlist._playlist_lock:
                Playlist._playlists = {}


Monitor.register_abort_listener(Playlist.shutdown)