class protocol(pyre.protocol): """a protocol""" # properties p1 = pyre.property() p2 = pyre.property() # behavior @pyre.provides def do(self): """behave"""
class component(pyre.component, family="test", implements=protocol): """a component""" # traits p1 = pyre.property() p1.default = "p1" p2 = pyre.property() p2.default = "p2" @pyre.export def do(self): """behave""" return "component"
class protocol(pyre.protocol): """a simple protocol""" # properties name = pyre.property() name.default = "my name" @pyre.provides def say(self): """say my name"""
class implicit(pyre.component, family="tests.implicit"): """a simple component""" # properties name = pyre.property() name.default = "whatever" @pyre.export def say(self): """say my name""" return self.name
class derived(base): """a derived one, so automatically compatible""" extra = pyre.property()
class derived(a1, a2): """the derived one""" common = pyre.property() extra = pyre.property()
class base(pyre.protocol): """the base protocol""" common = pyre.property()
class a1(base): a1 = pyre.property()
class a2(base): a2 = pyre.property()
class derived(base): """the derived one""" common = pyre.property()
class component(pyre.component): """a trivial component""" p = pyre.property()
class ok(pyre.protocol): """one that doesn't derive but has the right public protocol""" common = pyre.property()
class base(pyre.component): """the base component""" common = pyre.property() common.default = "base.common"
class derived(base): """the derived one""" extra = pyre.property() extra.default = "derived.extra"
class derived(base): """the derived one""" extra = pyre.property()
class notok(pyre.component): """one that doesn't provide the right public component""" what = pyre.property()
class ok(pyre.component): """one that doesn't derive but has the right public component""" common = pyre.property()
class protocol(pyre.protocol): """a trivial protocol""" p = pyre.property()
class notok(pyre.protocol): """one that doesn't provide the right public protocol""" what = pyre.property()
class base(pyre.component): """the base component""" common = pyre.property()