Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit87bfe62

Browse files
committed
FIX: Add single shot update capability to TimerWx
1 parentb98b898 commit87bfe62

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

‎lib/matplotlib/backends/backend_wx.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ def _timer_set_interval(self):
6969
ifself._timer.IsRunning():
7070
self._timer_start()# Restart with new interval.
7171

72+
def_timer_set_single_shot(self):
73+
ifself._timer.IsRunning():
74+
self._timer_start()# Restart with new interval.
75+
7276

7377
@_api.deprecated(
7478
"2.0",name="wx",obj_type="backend",removal="the future",

‎lib/matplotlib/tests/test_backends_interactive.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,8 @@ def _impl_test_interactive_timers():
653653
assertmock_repeating.call_count>expected_100ms_calls, \
654654
f"Expected more than{expected_100ms_calls} calls, " \
655655
f"got{mock_repeating.call_count}"
656-
assertmock_single_shot.call_count==1
656+
assertmock_single_shot.call_count==1, \
657+
f"Expected 1 call, got{mock_single_shot.call_count}"
657658

658659
# Test updating the interval updates a running timer
659660
timer_repeating.interval=100
@@ -666,7 +667,8 @@ def _impl_test_interactive_timers():
666667
assert1<mock_repeating.call_count<=expected_100ms_calls+1, \
667668
f"Expected less than{expected_100ms_calls+1} calls, " \
668669
"got {mock.call_count}"
669-
assertmock_single_shot.call_count==2
670+
assertmock_single_shot.call_count==2, \
671+
f"Expected 2 calls, got{mock_single_shot.call_count}"
670672
plt.close("all")
671673

672674

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp