def __init__(self, package_loader, name, version=None,
                 runtime_version=None, requirements=None, meta=None):
        super(MuranoPackage, self).__init__()
        self._package_loader = weakref.proxy(package_loader)
        self._name = name
        self._version = helpers.parse_version(version)
        self._runtime_version = helpers.parse_version(runtime_version)
        self._requirements = {
            name: semantic_version.Spec('==' + str(self._version.major))
        }
        if name != constants.CORE_LIBRARY:
            self._requirements[constants.CORE_LIBRARY] = \
                semantic_version.Spec('==0')
        self._classes = {}
        self._imported_types = {object, murano_object.MuranoObject}
        for key, value in six.iteritems(requirements or {}):
            self._requirements[key] = helpers.parse_version_spec(value)

        self._load_queue = {}
        self._native_load_queue = {}
        if self.name == constants.CORE_LIBRARY:
            principal_objects.register(self)
        self._package_class = self._create_package_class()
        self._meta = lambda: dslmeta.MetaData(
            meta, dsl_types.MetaTargets.Package, self._package_class)
    def __init__(self,
                 package_loader,
                 name,
                 version=None,
                 runtime_version=None,
                 requirements=None,
                 meta=None):
        super(MuranoPackage, self).__init__()
        self._package_loader = weakref.proxy(package_loader)
        self._name = name
        self._version = helpers.parse_version(version)
        self._runtime_version = helpers.parse_version(runtime_version)
        self._requirements = {
            name: semantic_version.Spec('==' + str(self._version.major))
        }
        if name != constants.CORE_LIBRARY:
            self._requirements[constants.CORE_LIBRARY] = \
                semantic_version.Spec('==0')
        self._classes = {}
        self._imported_types = {object, murano_object.MuranoObject}
        for key, value in six.iteritems(requirements or {}):
            self._requirements[key] = helpers.parse_version_spec(value)

        self._load_queue = {}
        self._native_load_queue = {}
        if self.name == constants.CORE_LIBRARY:
            principal_objects.register(self)
        self._package_class = self._create_package_class()
        self._meta = lambda: dslmeta.MetaData(meta, dsl_types.MetaTargets.
                                              Package, self._package_class)
Beispiel #3
0
 def __init__(self):
     self._loaded_types = {}
     self._packages_cache = {}
     principal_objects.register(self)