def __init__(self, properties=None):
        """
        Sets up the framework.

        :param properties: The framework properties
        """
        # Framework bundle set up
        Bundle.__init__(
            self, self, 0, self.get_symbolic_name(), sys.modules[__name__]
        )

        # Framework properties
        if not isinstance(properties, dict):
            self.__properties = {}
        else:
            # Use a copy of the properties, to avoid external changes
            self.__properties = properties.copy()

        # Generate and set a framework instance UUID, if needed
        framework_uid = self.__properties.get(FRAMEWORK_UID)
        if not framework_uid:
            framework_uid = str(uuid.uuid4())
        # Normalize the UID: it must be a string
        self.__properties[FRAMEWORK_UID] = str(framework_uid)
        # Also normalize the OSGI_FRAMEWORK_UID: it must be a string
        self.__properties[OSGI_FRAMEWORK_UUID] = str(framework_uid)

        # Properties lock
        self.__properties_lock = threading.Lock()

        # Bundles (start at 1, as 0 is reserved for the framework itself)
        self.__next_bundle_id = 1

        # Bundle ID -> Bundle object
        self.__bundles = {}

        # Bundles lock
        self.__bundles_lock = threading.RLock()

        # Service registry
        self._registry = ServiceRegistry(self)
        self.__unregistering_services = {}

        # Event dispatcher
        self._dispatcher = EventDispatcher(self._registry)

        # The wait_for_stop event (initially stopped)
        self._fw_stop_event = threading.Event()
        self._fw_stop_event.set()
def __init__ ( self , properties = None ) : Bundle . __init__ ( self , self , 0 , self . get_symbolic_name ( ) , sys . modules [ __name__ ] ) if not isinstance ( properties , dict ) : self . __properties = { } else : self . __properties = properties . copy ( ) framework_uid = self . __properties . get ( FRAMEWORK_UID ) if not framework_uid : framework_uid = str ( uuid . uuid4 ( ) ) self . __properties [ FRAMEWORK_UID ] = str ( framework_uid ) self . __properties [ OSGI_FRAMEWORK_UUID ] = str ( framework_uid ) self . __properties_lock = threading . Lock ( ) self . __next_bundle_id = 1 self . __bundles = { } self . __bundles_lock = threading . RLock ( ) self . _registry = ServiceRegistry ( self ) self . __unregistering_services = { } self . _dispatcher = EventDispatcher ( self . _registry ) self . _fw_stop_event = threading . Event ( ) self . _fw_stop_event . set ( )
Sets up the framework.

        :param properties: The framework properties