def delete_framework(cls, framework=None):
        # type: (Optional[Framework]) -> bool
        # pylint: disable=W0212
        """
        Removes the framework singleton

        :return: True on success, else False
        """
        if framework is None:
            framework = cls.__singleton

        if framework is cls.__singleton:
            # Stop the framework
            try:
                framework.stop()
            except:
                _logger.exception("Error stopping the framework")

            # Uninstall its bundles
            bundles = framework.get_bundles()
            for bundle in bundles:
                try:
                    bundle.uninstall()
                except:
                    _logger.exception(
                        "Error uninstalling bundle %s",
                        bundle.get_symbolic_name(),
                    )

            # Clear the event dispatcher
            framework._dispatcher.clear()

            # Clear the singleton
            cls.__singleton = None
            return True

        return False
def delete_framework ( cls , framework = None ) : if framework is None : framework = cls . __singleton if framework is cls . __singleton : try : framework . stop ( ) except : _logger . exception ( "Error stopping the framework" ) bundles = framework . get_bundles ( ) for bundle in bundles : try : bundle . uninstall ( ) except : _logger . exception ( "Error uninstalling bundle %s" , bundle . get_symbolic_name ( ) , ) framework . _dispatcher . clear ( ) cls . __singleton = None return True return False
Removes the framework singleton

        :return: True on success, else False