Пример #1
0
    def cleanUp(self):
        if self.is_cleaned():
            return

        if self._modules:
            for _, types_dict in self._modules.items():
                for type_name in types_dict:
                    Type.removeType(type_name)

        self._modules = None
        self._inst_dict = None

        MacroServerManager.cleanUp(self)
Пример #2
0
    def cleanUp(self):
        if self.is_cleaned():
            return

        if self._modules:
            for _, types_dict in self._modules.items():
                for type_name in types_dict:
                    Type.removeType(type_name)

        self._modules = None
        self._inst_dict = None

        MacroServerManager.cleanUp(self)
Пример #3
0
    def addType(self, type_obj):
        type_name = type_obj.getName()
        type_class = type_obj.__class__
        module_name = type_obj.__module__

        mod_types = self._modules[module_name]

        #action = (((type_name in mod_types) and "Updating") \
        #          or "Adding")
        action = "Updating"
        self.debug("%s type %s", action, type_name)
        mod_types[type_name] = type_class
        self._inst_dict[type_name] = type_obj

        Type.addType(type_name)
Пример #4
0
    def addType(self, type_obj):
        type_name = type_obj.getName()
        type_class = type_obj.__class__
        module_name = type_obj.__module__

        mod_types = self._modules[module_name]

        #action = (((type_name in mod_types) and "Updating") \
        #          or "Adding")
        action = "Updating"
        self.debug("%s type %s", action, type_name)
        mod_types[type_name] = type_class
        self._inst_dict[type_name] = type_obj

        Type.addType(type_name)