Esempio n. 1
0
 class DummyObj:
     __config__ = [
         DictConfigAB,
         DictConfigAC,
     ]
     a = byoc.param()
     b = byoc.param()
     c = byoc.param()
Esempio 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
Esempio 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)
Esempio 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)
Esempio n. 5
0
 class DummyApp(byoc.App):
     __config__ = [DummyConfig]
     x = byoc.param()
Esempio n. 6
0
 class DummyObj:
     __config__ = [DummyConfig]
     x = byoc.param()
Esempio n. 7
0
 class DummyObj:
     __config__ = [byoc.EnvironmentConfig]
     x = byoc.param()
Esempio n. 8
0
 class DummyObj:
     __config__ = [byoc.YamlConfig]
     x = byoc.param()
Esempio n. 9
0
 class DummyObj:
     __config__ = [DictConfigAB]
     a = byoc.param()
Esempio n. 10
0
 class DummyObj:
     __config__ = [Foreground, Background]
     x = byoc.param()
Esempio n. 11
0
 class DummyObj:
     __config__ = [ForegroundConfig, BackgroundConfig]
     x = byoc.param(dynamic=dynamic)
Esempio n. 12
0
 class DummyObj:
     __config__ = [DummyConfig]
     x = byoc.param(dynamic=dynamic)
Esempio n. 13
0
 class ParentObj:
     x = byoc.param()