Give explicit types to util.Process.__init__

This gives better type hinting in the editor.
This commit is contained in:
George Tsiamasiotis 2024-10-03 19:17:54 +03:00
parent 70d732ad36
commit fe84887095

View File

@ -5,14 +5,24 @@ import sys
import threading import threading
from functools import wraps from functools import wraps
from logging.handlers import QueueHandler from logging.handlers import QueueHandler
from typing import Any from typing import Any, Callable, Optional
import frigate.log import frigate.log
class BaseProcess(mp.Process): class BaseProcess(mp.Process):
def __init__(self, **kwargs): def __init__(
super().__init__(**kwargs) 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): def start(self, *args, **kwargs):
self.before_start() self.before_start()