| 71 | |
| 72 | |
| 73 | class Bar(Configurable): |
| 74 | enabled = Bool(True, help="Enable bar.").tag(config=True) |
| 75 | mylist = List([1, 2, 3], help="Just a list.").tag(config=True) |
| 76 | |
| 77 | def describe(self): |
| 78 | print("I am Bar with:") |
| 79 | print(" enabled = ", self.enabled) |
| 80 | print(" mylist = ", self.mylist) |
| 81 | self.subconf.describe() |
| 82 | |
| 83 | def __init__(self, **kwargs): |
| 84 | super().__init__(**kwargs) |
| 85 | # here we do not use parent=self, so configuration in the form |
| 86 | # c.Bar.SubConfigurable.subvalue=1 will not work. Only |
| 87 | # c.SubConfigurable.subvalue=1 will work and affect all instances of |
| 88 | # SubConfigurable |
| 89 | self.subconf = SubConfigurable(config=self.config) |
| 90 | |
| 91 | |
| 92 | class MyApp(Application): |