mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-15 07:35:27 +03:00
Give explicit types to util.Process.__init__
This gives better type hinting in the editor.
This commit is contained in:
parent
70d732ad36
commit
fe84887095
@ -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()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user