Exemplo n.º 1
0
Arquivo: kind.py Projeto: A1ve5/ooi
    def __init__(self, scheme, term, title, attributes=None, location=None,
                 parent=None, actions=[]):
        super(Kind, self).__init__(scheme, term, title, attributes=attributes,
                                   location=location)

        helpers.check_single_type(parent, Kind)
        helpers.check_type(actions, action.Action)

        self.parent = parent
        self.actions = actions
Exemplo n.º 2
0
    def __init__(self, scheme, term, title, attributes=None, location=None,
                 related=[], actions=[]):
        super(Kind, self).__init__(scheme, term, title, attributes=attributes,
                                   location=location)

        helpers.check_type(related, Kind)
        helpers.check_type(actions, action.Action)

        self.related = related
        self.actions = actions
Exemplo n.º 3
0
    def __init__(self, title, mixins, id=None):
        helpers.check_type(mixins, mixin.Mixin)
        self.mixins = mixins

        # NOTE(aloga): we need a copy of the attributes, otherwise we will be
        # using the class ones instead of the object ones.
        self.attributes = self.attributes.copy()

        # damn, we're shading a builtin
        if id is None:
            id = uuid.uuid4().hex

        self.attributes["occi.core.id"] = attribute.InmutableAttribute(
            "occi.core.id", id)
        self.attributes["occi.core.title"] = attribute.MutableAttribute(
            "occi.core.title", title)
Exemplo n.º 4
0
Arquivo: entity.py Projeto: tdviet/ooi
    def __init__(self, title, mixins, id=None):
        helpers.check_type(mixins, mixin.Mixin)
        self.mixins = mixins

        # NOTE(aloga): we need a copy of the attributes, otherwise we will be
        # using the class ones instead of the object ones.
        self.attributes = self.attributes.copy()

        # damn, we're shading a builtin
        if id is None:
            id = uuid.uuid4().hex

        self.attributes["occi.core.id"] = attribute.InmutableAttribute(
            "occi.core.id", id)
        self.attributes["occi.core.title"] = attribute.MutableAttribute(
            "occi.core.title", title)
Exemplo n.º 5
0
Arquivo: mixin.py Projeto: tdviet/ooi
    def __init__(self,
                 scheme,
                 term,
                 title,
                 attributes=None,
                 location=None,
                 related=[],
                 actions=[]):
        super(Mixin, self).__init__(scheme,
                                    term,
                                    title,
                                    attributes=attributes,
                                    location=location)

        helpers.check_type(related, Mixin)
        helpers.check_type(actions, action.Action)

        self.related = related
        self.actions = actions
Exemplo n.º 6
0
    def __init__(self, scheme, term, title, attributes=None, location=None,
                 depends=[], applies=[], actions=[]):
        super(Mixin, self).__init__(scheme, term, title, attributes=attributes,
                                    location=location)

        helpers.check_type(depends, Mixin)
        helpers.check_type(actions, action.Action)
        helpers.check_type(applies, kind.Kind)

        self.depends = depends
        self.actions = actions
        self.applies = applies
Exemplo n.º 7
0
    def __init__(self,
                 scheme,
                 term,
                 title,
                 attributes=None,
                 location=None,
                 depends=[],
                 applies=[],
                 actions=[]):
        super(Mixin, self).__init__(scheme,
                                    term,
                                    title,
                                    attributes=attributes,
                                    location=location)

        helpers.check_type(depends, Mixin)
        helpers.check_type(actions, action.Action)
        helpers.check_type(applies, kind.Kind)

        self.depends = depends
        self.actions = actions
        self.applies = applies