wrap up coretk type hinting
This commit is contained in:
parent
c1c580cdc4
commit
6ecffc465b
5 changed files with 10 additions and 18 deletions
|
@ -772,6 +772,7 @@ class Session:
|
|||
Broadcast node location to all listeners.
|
||||
|
||||
:param core.nodes.base.NodeBase node: node to broadcast location for
|
||||
:return: nothing
|
||||
"""
|
||||
node_data = NodeData(
|
||||
message_type=0,
|
||||
|
|
|
@ -4,7 +4,7 @@ custom color picker
|
|||
import logging
|
||||
import tkinter as tk
|
||||
from tkinter import ttk
|
||||
from typing import TYPE_CHECKING, Any, Optional
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
from core.gui.dialogs.dialog import Dialog
|
||||
|
||||
|
@ -13,9 +13,7 @@ if TYPE_CHECKING:
|
|||
|
||||
|
||||
class ColorPickerDialog(Dialog):
|
||||
def __init__(
|
||||
self, master: Any, app: "Application", initcolor: Optional[str] = "#000000"
|
||||
):
|
||||
def __init__(self, master: Any, app: "Application", initcolor: str = "#000000"):
|
||||
super().__init__(master, app, "color picker", modal=True)
|
||||
self.red_entry = None
|
||||
self.blue_entry = None
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import tkinter as tk
|
||||
from tkinter import ttk
|
||||
from typing import TYPE_CHECKING, Optional
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from core.gui.images import ImageEnum, Images
|
||||
from core.gui.themes import DIALOG_PAD
|
||||
|
@ -11,11 +11,7 @@ if TYPE_CHECKING:
|
|||
|
||||
class Dialog(tk.Toplevel):
|
||||
def __init__(
|
||||
self,
|
||||
master: tk.Widget,
|
||||
app: "Application",
|
||||
title: str,
|
||||
modal: Optional[bool] = False,
|
||||
self, master: tk.Widget, app: "Application", title: str, modal: bool = False
|
||||
):
|
||||
super().__init__(master)
|
||||
self.withdraw()
|
||||
|
@ -40,7 +36,7 @@ class Dialog(tk.Toplevel):
|
|||
self.grab_set()
|
||||
self.wait_window()
|
||||
|
||||
def draw_spacer(self, row: Optional[int] = None):
|
||||
def draw_spacer(self, row: int = None):
|
||||
frame = ttk.Frame(self.top)
|
||||
frame.grid(row=row, sticky="nsew")
|
||||
frame.rowconfigure(0, weight=1)
|
||||
|
|
|
@ -5,7 +5,7 @@ import logging
|
|||
import tkinter as tk
|
||||
import webbrowser
|
||||
from tkinter import ttk
|
||||
from typing import TYPE_CHECKING, Any, Optional
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
import grpc
|
||||
|
||||
|
@ -59,7 +59,7 @@ class EmaneModelDialog(Dialog):
|
|||
app: "Application",
|
||||
node: core_pb2.Node,
|
||||
model: str,
|
||||
interface: Optional[int] = None,
|
||||
interface: int = None,
|
||||
):
|
||||
super().__init__(master, app, f"{node.name} {model} Configuration", modal=True)
|
||||
self.node = node
|
||||
|
|
|
@ -4,7 +4,7 @@ marker dialog
|
|||
|
||||
import tkinter as tk
|
||||
from tkinter import ttk
|
||||
from typing import TYPE_CHECKING, Optional
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from core.gui.dialogs.colorpicker import ColorPickerDialog
|
||||
from core.gui.dialogs.dialog import Dialog
|
||||
|
@ -17,10 +17,7 @@ MARKER_THICKNESS = [3, 5, 8, 10]
|
|||
|
||||
class MarkerDialog(Dialog):
|
||||
def __init__(
|
||||
self,
|
||||
master: "Application",
|
||||
app: "Application",
|
||||
initcolor: Optional[str] = "#000000",
|
||||
self, master: "Application", app: "Application", initcolor: str = "#000000"
|
||||
):
|
||||
super().__init__(master, app, "marker tool", modal=False)
|
||||
self.app = app
|
||||
|
|
Loading…
Add table
Reference in a new issue