예제 #1
0
파일: kind.py 프로젝트: 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
예제 #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
예제 #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)
예제 #4
0
파일: entity.py 프로젝트: 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)
예제 #5
0
파일: mixin.py 프로젝트: 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
예제 #6
0
파일: mixin.py 프로젝트: indigo-dc/ooi
    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
예제 #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