225
225
226
226
227
227
class BackendMessageReceiver (QObject ):
228
- def __init__ (self , app , backend , messages , exit_after_secs : Optional [int ] = None ):
228
+ def __init__ (self , app , backend , messages , exit_after_timeout : Optional [int ] = None ):
229
229
super ().__init__ ()
230
230
self ._app = app
231
231
self ._backend = backend
@@ -234,7 +234,7 @@ def __init__(self, app, backend, messages, exit_after_secs: Optional[int] = None
234
234
self ._thread .started .connect (self ._handle_started ) # pylint: disable=no-member
235
235
self .moveToThread (self ._thread )
236
236
self .start_time = None
237
- self .exit_after_secs = exit_after_secs
237
+ self .exit_after_timeout = exit_after_timeout
238
238
239
239
def _handle_started (self ):
240
240
QTimer .singleShot (0 , self .receive_messages )
@@ -254,7 +254,7 @@ def receive_messages(self):
254
254
QTimer .singleShot (0 , self .receive_messages )
255
255
256
256
def _receive_messages (self ):
257
- if self .exit_after_secs is not None and time .time () - self .start_time > self .exit_after_secs :
257
+ if self .exit_after_timeout is not None and time .time () - self .start_time > self .exit_after_timeout :
258
258
self ._app .quit ()
259
259
buffer = self ._backend .fetch_message ()
260
260
if not buffer :
@@ -581,8 +581,8 @@ def handle_cli_arguments(args: argparse.Namespace, globals_: QObject):
581
581
582
582
583
583
def main (passed_args : Optional [Tuple [str , ...]] = None ) -> int :
584
- parser = argparse .ArgumentParser (add_help = False , usage = argparse .SUPPRESS , allow_abbrev = False )
585
- parser .add_argument ("--exit-after-secs " , type = int , default = None )
584
+ parser = argparse .ArgumentParser (add_help = False , usage = argparse .SUPPRESS )
585
+ parser .add_argument ("--exit-after-timeout " , type = int , default = None )
586
586
parser .add_argument ("--show-fileio" , action = "store_true" )
587
587
parser .add_argument ("--show-file-connection" , action = "store_true" )
588
588
parser .add_argument ("--no-prompts" , action = "store_true" )
@@ -721,7 +721,7 @@ def handle_qml_load_errors(obj, _url):
721
721
app ,
722
722
backend_main ,
723
723
messages_main ,
724
- exit_after_secs = args_main .exit_after_secs ,
724
+ exit_after_timeout = args_main .exit_after_timeout ,
725
725
)
726
726
backend_msg_receiver .start ()
727
727
0 commit comments