Esempio n. 1
0
    class Component:
        """
        Simple class with a measure
        """

        # declare a measure
        attr = measure()
Esempio n. 2
0
    class Shadow(Derived):
        """
        A component that redeclares ancestor traits
        """

        bm = measure()
        bm.default = "a value"
        bm.tip = 'a shadowing value'
Esempio n. 3
0
    class Base(Component):
        """
        A simple component
        """

        bm = measure()
        bm.default = 1
        bm.tip = 'a simple value'
Esempio n. 4
0
    class Derived(Base):
        """
        A derived component
        """

        # a simple measure
        dm = measure()
        dm.default = True
        dm.tip = 'another simple value'
Esempio n. 5
0
 class NotOK(Component):
     """
     Incompatible
     """
     missing = measure()
Esempio n. 6
0
 class OK(Component):
     """
     Unrelated but compatible
     """
     # because it defines the correct trait
     common = measure()
Esempio n. 7
0
 class Derived(Base):
     """
     A derived component
     """
     # with an extra trait
     extra = measure()
Esempio n. 8
0
 class Base(Component):
     """
     A component
     """
     # with a trait
     common = measure()