Exemple #1
0
def _kwarg_init_constructor(self, **kwargs):
    self.__suspend_mutability_checks__ = True
    try:
        for k in kwargs:
            if not hasattr(type(self), k):
                raise exc.ArtifactInvalidProperty(prop=k)
            setattr(self, k, kwargs[k])
        self._validate_required(self.metadata.attributes.properties)
    finally:
        del self.__suspend_mutability_checks__
Exemple #2
0
def _update(self, values):
    for k in values:
        if hasattr(type(self), k):
            setattr(self, k, values[k])
        else:
            raise exc.ArtifactInvalidProperty(prop=k)
 def get_type_specific_property(self, prop_name):
     try:
         return getattr(self.base, prop_name)
     except AttributeError:
         raise exc.ArtifactInvalidProperty(prop=prop_name)
Exemple #4
0
 def __getattr__(self, name):
     if not hasattr(self, name):
         raise exc.ArtifactInvalidProperty(prop=name)
     return super(ArtifactProxy, self).__getattr__(name)