コード例 #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