Exemplo n.º 1
0
 class DummyObj:
     __config__ = [
         DictConfigAB,
         DictConfigAC,
     ]
     a = byoc.param()
     b = byoc.param()
     c = byoc.param()
Exemplo n.º 2
0
    class DummyApp(byoc.App):
        __config__ = [DummyConfig]
        x = byoc.param()

        def __bareinit__(self):
            self.y = 0

        def __init__(self, x):
            self.x = x
Exemplo n.º 3
0
def find_param(obj, name=None):
    from more_itertools import only
    class_attrs = obj.__class__.__dict__

    if name:
        return class_attrs[name]
    else:
        params = (x for x in class_attrs.values() if isinstance(x, byoc.param))
        default = byoc.param()
        default.__set_name__(obj.__class__, '')
        return only(params, default)
Exemplo n.º 4
0
    class DummyObj:
        __config__ = [DummyConfig]

        def __init__(self):
            self.y = 0

        def _update_y(self, x):
            self.y += 1
            return x

        x = byoc.param(get=_update_y)
Exemplo n.º 5
0
 class DummyApp(byoc.App):
     __config__ = [DummyConfig]
     x = byoc.param()
Exemplo n.º 6
0
 class DummyObj:
     __config__ = [DummyConfig]
     x = byoc.param()
Exemplo n.º 7
0
 class DummyObj:
     __config__ = [byoc.EnvironmentConfig]
     x = byoc.param()
Exemplo n.º 8
0
 class DummyObj:
     __config__ = [byoc.YamlConfig]
     x = byoc.param()
Exemplo n.º 9
0
 class DummyObj:
     __config__ = [DictConfigAB]
     a = byoc.param()
Exemplo n.º 10
0
 class DummyObj:
     __config__ = [Foreground, Background]
     x = byoc.param()
Exemplo n.º 11
0
 class DummyObj:
     __config__ = [ForegroundConfig, BackgroundConfig]
     x = byoc.param(dynamic=dynamic)
Exemplo n.º 12
0
 class DummyObj:
     __config__ = [DummyConfig]
     x = byoc.param(dynamic=dynamic)
Exemplo n.º 13
0
 class ParentObj:
     x = byoc.param()