edit some parts where pycharm gives warning on type hint
This commit is contained in:
parent
8a4ad41a47
commit
948a33f201
3 changed files with 7 additions and 12 deletions
|
@ -176,7 +176,7 @@ class ViewConfigDialog(Dialog):
|
|||
master: Any,
|
||||
app: "Application",
|
||||
node_id: int,
|
||||
data: bytes,
|
||||
data: str,
|
||||
filename: str = None,
|
||||
):
|
||||
super().__init__(master, app, f"n{node_id} config data", modal=True)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from typing import TYPE_CHECKING, Set
|
||||
from typing import TYPE_CHECKING, Optional, Set
|
||||
|
||||
from core.api.grpc.core_pb2 import NodeType
|
||||
from core.gui.images import ImageEnum, Images
|
||||
|
@ -14,10 +14,10 @@ class NodeDraw:
|
|||
def __init__(self):
|
||||
self.custom: bool = False
|
||||
self.image = None
|
||||
self.image_enum: ImageEnum = None
|
||||
self.image_enum: Optional[ImageEnum] = None
|
||||
self.image_file = None
|
||||
self.node_type: core_pb2.NodeType = None
|
||||
self.model: str = None
|
||||
self.model: Optional[str] = None
|
||||
self.services: Set[str] = set()
|
||||
|
||||
@classmethod
|
||||
|
@ -39,7 +39,7 @@ class NodeDraw:
|
|||
return node_draw
|
||||
|
||||
@classmethod
|
||||
def from_custom(cls, name: str, image_file: str, services: str):
|
||||
def from_custom(cls, name: str, image_file: str, services: Set[str]):
|
||||
node_draw = NodeDraw()
|
||||
node_draw.custom = True
|
||||
node_draw.image_file = image_file
|
||||
|
|
|
@ -1,15 +1,10 @@
|
|||
import logging
|
||||
import threading
|
||||
from typing import TYPE_CHECKING, Callable
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from core.gui.app import Application
|
||||
from typing import Any, Callable
|
||||
|
||||
|
||||
class BackgroundTask:
|
||||
def __init__(
|
||||
self, master: "Application", task: Callable, callback: Callable = None, args=()
|
||||
):
|
||||
def __init__(self, master: Any, task: Callable, callback: Callable = None, args=()):
|
||||
self.master = master
|
||||
self.args = args
|
||||
self.task = task
|
||||
|
|
Loading…
Reference in a new issue