1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-14 08:17:13 +03:00

Added some type comments to appease pylance

This commit is contained in:
A_D 2020-09-12 01:40:20 +02:00
parent 742709c431
commit 3010f21965
No known key found for this signature in database
GPG Key ID: 4BE9EB7DF45076C4

View File

@ -4,9 +4,9 @@ import tkinter as tk
import webbrowser
from os.path import exists, expanduser, expandvars, join, normpath
from sys import platform
from tkinter import colorchooser as tkColorChooser
from tkinter import colorchooser as tkColorChooser # type: ignore
from tkinter import ttk
from typing import Callable, TYPE_CHECKING
from typing import TYPE_CHECKING
import myNotebook as nb
import plug
@ -98,10 +98,12 @@ prefsVersion = PrefsVersion()
###########################################################################
if platform == 'darwin':
import objc
from Foundation import NSFileManager
import objc # type: ignore
from Foundation import NSFileManager # type: ignore
try:
from ApplicationServices import AXIsProcessTrusted, AXIsProcessTrustedWithOptions, kAXTrustedCheckOptionPrompt
from ApplicationServices import ( # type: ignore
AXIsProcessTrusted, AXIsProcessTrustedWithOptions, kAXTrustedCheckOptionPrompt
)
except ImportError:
HIServices = objc.loadBundle(
'HIServices',
@ -117,11 +119,12 @@ if platform == 'darwin':
objc.loadBundleVariables(HIServices, globals(), [('kAXTrustedCheckOptionPrompt', '@^{__CFString=}')])
was_accessible_at_launch = AXIsProcessTrusted()
was_accessible_at_launch = AXIsProcessTrusted() # type: ignore
elif platform == 'win32':
# sigh tkFileDialog.askdirectory doesn't support unicode on Windows
import ctypes
import ctypes.windll # type: ignore # I promise pylance, its there.
from ctypes.wintypes import HINSTANCE, HWND, LPARAM, LPCWSTR, LPVOID, LPWSTR, MAX_PATH, POINT, RECT, SIZE, UINT
SHGetLocalizedName = ctypes.windll.shell32.SHGetLocalizedName