Show More
@@ -140,7 +140,7 b' class Configurable(HasTraits):' | |||||
140 | my_config = self._find_my_config(cfg) |
|
140 | my_config = self._find_my_config(cfg) | |
141 |
|
141 | |||
142 | # hold trait notifications until after all config has been loaded |
|
142 | # hold trait notifications until after all config has been loaded | |
143 |
with self.d |
|
143 | with self.hold_trait_notifications(): | |
144 | for name, config_value in iteritems(my_config): |
|
144 | for name, config_value in iteritems(my_config): | |
145 | if name in traits: |
|
145 | if name in traits: | |
146 | if isinstance(config_value, LazyConfigValue): |
|
146 | if isinstance(config_value, LazyConfigValue): |
@@ -576,12 +576,12 b' class HasTraits(py3compat.with_metaclass(MetaHasTraits, object)):' | |||||
576 | # We need to use setattr for this to trigger validation and |
|
576 | # We need to use setattr for this to trigger validation and | |
577 | # notifications. |
|
577 | # notifications. | |
578 |
|
578 | |||
579 |
with self.d |
|
579 | with self.hold_trait_notifications(): | |
580 | for key, value in iteritems(kw): |
|
580 | for key, value in iteritems(kw): | |
581 | setattr(self, key, value) |
|
581 | setattr(self, key, value) | |
582 |
|
582 | |||
583 | @contextlib.contextmanager |
|
583 | @contextlib.contextmanager | |
584 |
def d |
|
584 | def hold_trait_notifications(self): | |
585 | """Context manager for bundling trait change notifications |
|
585 | """Context manager for bundling trait change notifications | |
586 |
|
586 | |||
587 | Use this when doing multiple trait assignments (init, config), |
|
587 | Use this when doing multiple trait assignments (init, config), |
General Comments 0
You need to be logged in to leave comments.
Login now