File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed
Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -61,7 +61,6 @@ def start_monitor(
6161 if not self ._is_active ():
6262 # If SmartPause is already started, do not start it again
6363 self ._set_active (True )
64- utility .start_thread (self ._start_idle_monitor )
6564 utility .start_thread (
6665 self ._start_idle_monitor ,
6766 on_idle = on_idle ,
Original file line number Diff line number Diff line change @@ -95,18 +95,29 @@ def get_resource_path(resource_name):
9595 return resource_location
9696
9797
98- def start_thread (target_function , ** args ):
98+ P1 = typing .ParamSpec ("P1" )
99+
100+
101+ def start_thread (
102+ target_function : typing .Callable [P1 , None ], * args : P1 .args , ** kwargs : P1 .kwargs
103+ ) -> None :
99104 """Execute the function in a separate thread."""
100105 thread = threading .Thread (
101106 target = target_function ,
102107 name = f"WorkThread { target_function .__qualname__ } " ,
103108 daemon = False ,
104- kwargs = args ,
109+ args = args ,
110+ kwargs = kwargs ,
105111 )
106112 thread .start ()
107113
108114
109- def execute_main_thread (target_function , * args , ** kwargs ):
115+ P2 = typing .ParamSpec ("P2" )
116+
117+
118+ def execute_main_thread (
119+ target_function : typing .Callable [P2 , None ], * args : P2 .args , ** kwargs : P2 .kwargs
120+ ) -> None :
110121 """Execute the given function in main thread."""
111122 GLib .idle_add (lambda : target_function (* args , ** kwargs ))
112123
You can’t perform that action at this time.
0 commit comments