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

        def __bareinit__(self):
            self.y = 0

        def __init__(self, x):
            self.x = x
예제 #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)
예제 #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)
예제 #5
0
 class DummyApp(byoc.App):
     __config__ = [DummyConfig]
     x = byoc.param()
예제 #6
0
 class DummyObj:
     __config__ = [DummyConfig]
     x = byoc.param()
예제 #7
0
 class DummyObj:
     __config__ = [byoc.EnvironmentConfig]
     x = byoc.param()
예제 #8
0
 class DummyObj:
     __config__ = [byoc.YamlConfig]
     x = byoc.param()
예제 #9
0
 class DummyObj:
     __config__ = [DictConfigAB]
     a = byoc.param()
예제 #10
0
 class DummyObj:
     __config__ = [Foreground, Background]
     x = byoc.param()
예제 #11
0
 class DummyObj:
     __config__ = [ForegroundConfig, BackgroundConfig]
     x = byoc.param(dynamic=dynamic)
예제 #12
0
 class DummyObj:
     __config__ = [DummyConfig]
     x = byoc.param(dynamic=dynamic)
예제 #13
0
 class ParentObj:
     x = byoc.param()