Skip to content

Commit

Permalink
minimize diff
Browse files Browse the repository at this point in the history
  • Loading branch information
maartenbreddels committed Dec 14, 2021
1 parent 8a37a8d commit a50e5e1
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions python/ipywidgets/ipywidgets/widgets/widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -648,20 +648,6 @@ def _lock_property(self, **properties):
finally:
self._property_lock = {}

@contextmanager
def hold_sync(self):
"""Hold syncing any state until the outermost context manager exits"""
if self._holding_sync is True:
yield
else:
try:
self._holding_sync = True
yield
finally:
self._holding_sync = False
self.send_state(self._states_to_send)
self._states_to_send.clear()

@contextmanager
def _hold_sync_frontend(self):
"""Same as hold_sync, but will not sync back traits tagged as no_echo"""
Expand All @@ -676,6 +662,20 @@ def _hold_sync_frontend(self):
finally:
self._holding_sync_from_frontend_update = False

@contextmanager
def hold_sync(self):
"""Hold syncing any state until the outermost context manager exits"""
if self._holding_sync is True:
yield
else:
try:
self._holding_sync = True
yield
finally:
self._holding_sync = False
self.send_state(self._states_to_send)
self._states_to_send.clear()

def _should_send_property(self, key, value):
"""Check the property lock (property_lock)"""
to_json = self.trait_metadata(key, 'to_json', self._trait_to_json)
Expand Down

0 comments on commit a50e5e1

Please sign in to comment.