From fe84887095579d06e0cdeeb1439251ba215985db Mon Sep 17 00:00:00 2001 From: George Tsiamasiotis Date: Thu, 3 Oct 2024 19:17:54 +0300 Subject: [PATCH] Give explicit types to util.Process.__init__ This gives better type hinting in the editor. --- frigate/util/process.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/frigate/util/process.py b/frigate/util/process.py index 23e484b23..f0f6ff6f3 100644 --- a/frigate/util/process.py +++ b/frigate/util/process.py @@ -5,14 +5,24 @@ import sys import threading from functools import wraps from logging.handlers import QueueHandler -from typing import Any +from typing import Any, Callable, Optional import frigate.log class BaseProcess(mp.Process): - def __init__(self, **kwargs): - super().__init__(**kwargs) + def __init__( + self, + *, + name: Optional[str] = None, + target: Optional[Callable] = None, + args: tuple = (), + kwargs: dict = {}, + daemon: Optional[bool] = None, + ): + super().__init__( + name=name, target=target, args=args, kwargs=kwargs, daemon=daemon + ) def start(self, *args, **kwargs): self.before_start()