Welcome to mirror list, hosted at ThFree Co, Russian Federation.

__init__.py « common « meshroom - github.com/alicevision/meshroom.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 3331e9c680d484ebb5888d2ee0dcf63914109dbe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import meshroom

DictModel = None
ListModel = None
Slot = None
Signal = None
Property = None
BaseObject = None
Variant = None
VariantList = None
JSValue = None

if meshroom.backend == meshroom.Backend.PYSIDE:
    # PySide types
    from .qt import DictModel, ListModel, Slot, Signal, Property, BaseObject, Variant, VariantList, JSValue
elif meshroom.backend == meshroom.Backend.STANDALONE:
    # Core types
    from .core import DictModel, ListModel, Slot, Signal, Property, BaseObject, Variant, VariantList, JSValue


class _BaseModel:
    """ Common API for model implementation """

    def __init__(self, keyAttrName="name", **kwargs):
        """
        :param keyAttrName: name of the attribute containing the unique key for an object
        """
        pass

    @property
    def objects(self):
        """ Return a dictionary with {unique_key: object} mapping"""
        return None

    def get(self, key):
        """ Get the object with the unique key 'key' """
        pass

    def add(self, obj):
        """ Add given object using its 'keyAttrName' as unique key """
        pass

    def pop(self, key):
        """ Remove 'item' with unique key 'key' from the model """
        pass

    def remove(self, obj):
        """ Remove 'obj' from the model """
        pass

    def clear(self):
        """ Remove all internal objects """
        pass

    def update(self, d):
        """ Combine dict 'd' with self """
        pass

    def reset(self, d):
        """ Reset model with given values """
        pass