Exemple #1
0
    def get_attr(self, this, context, name, default=None, owner=None):
        if owner is None:
            owner = helpers.get_type(helpers.get_caller_context(context))

        attribute_store = helpers.get_attribute_store(context)

        result = attribute_store.get(this.object, owner, name)
        return default if result is None else result
Exemple #2
0
    def setAttr(self, _context, name, value, owner=None):
        if owner is None:
            owner = helpers.get_type(helpers.get_caller_context(_context))
        if not isinstance(owner, murano_class.MuranoClass):
            raise TypeError()

        attribute_store = helpers.get_attribute_store(_context)
        attribute_store.set(self, owner, name, value)
Exemple #3
0
    def getAttr(self, _context, name, default=None, owner=None):
        if owner is None:
            owner = helpers.get_type(helpers.get_caller_context(_context))
        if not isinstance(owner, murano_class.MuranoClass):
            raise TypeError()

        attribute_store = helpers.get_attribute_store(_context)

        result = attribute_store.get(self, owner, name)
        return default if result is None else result
Exemple #4
0
    def set_attr(self, this, context, name, value, owner=None):
        if owner is None:
            owner = helpers.get_type(helpers.get_caller_context(context))

        attribute_store = helpers.get_attribute_store(context)
        attribute_store.set(this.object, owner, name, value)