added type hinting for core.nodes
This commit is contained in:
parent
4e71759ac9
commit
c0fcc91d10
10 changed files with 534 additions and 360 deletions
|
@ -5,7 +5,7 @@ gRpc client for interfacing with CORE, when gRPC mode is enabled.
|
|||
import logging
|
||||
import threading
|
||||
from contextlib import contextmanager
|
||||
from typing import Any, Callable, Dict, List
|
||||
from typing import Any, Callable, Dict, Generator, List
|
||||
|
||||
import grpc
|
||||
import netaddr
|
||||
|
@ -1144,7 +1144,7 @@ class CoreGrpcClient:
|
|||
self.channel = None
|
||||
|
||||
@contextmanager
|
||||
def context_connect(self) -> None:
|
||||
def context_connect(self) -> Generator:
|
||||
"""
|
||||
Makes a context manager based connection to the server, will close after context ends.
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import logging
|
||||
from queue import Empty, Queue
|
||||
from typing import List
|
||||
from typing import Iterable
|
||||
|
||||
from core.api.grpc import core_pb2
|
||||
from core.api.grpc.grpcutils import convert_value
|
||||
|
@ -181,7 +181,9 @@ class EventStreamer:
|
|||
Processes session events to generate grpc events.
|
||||
"""
|
||||
|
||||
def __init__(self, session: Session, event_types: List[core_pb2.EventType]) -> None:
|
||||
def __init__(
|
||||
self, session: Session, event_types: Iterable[core_pb2.EventType]
|
||||
) -> None:
|
||||
"""
|
||||
Create a EventStreamer instance.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue