1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-06-09 11:52:27 +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 import webbrowser
from os.path import exists, expanduser, expandvars, join, normpath from os.path import exists, expanduser, expandvars, join, normpath
from sys import platform from sys import platform
from tkinter import colorchooser as tkColorChooser from tkinter import colorchooser as tkColorChooser # type: ignore
from tkinter import ttk from tkinter import ttk
from typing import Callable, TYPE_CHECKING from typing import TYPE_CHECKING
import myNotebook as nb import myNotebook as nb
import plug import plug
@ -98,10 +98,12 @@ prefsVersion = PrefsVersion()
########################################################################### ###########################################################################
if platform == 'darwin': if platform == 'darwin':
import objc import objc # type: ignore
from Foundation import NSFileManager from Foundation import NSFileManager # type: ignore
try: try:
from ApplicationServices import AXIsProcessTrusted, AXIsProcessTrustedWithOptions, kAXTrustedCheckOptionPrompt from ApplicationServices import ( # type: ignore
AXIsProcessTrusted, AXIsProcessTrustedWithOptions, kAXTrustedCheckOptionPrompt
)
except ImportError: except ImportError:
HIServices = objc.loadBundle( HIServices = objc.loadBundle(
'HIServices', 'HIServices',
@ -117,11 +119,12 @@ if platform == 'darwin':
objc.loadBundleVariables(HIServices, globals(), [('kAXTrustedCheckOptionPrompt', '@^{__CFString=}')]) objc.loadBundleVariables(HIServices, globals(), [('kAXTrustedCheckOptionPrompt', '@^{__CFString=}')])
was_accessible_at_launch = AXIsProcessTrusted() was_accessible_at_launch = AXIsProcessTrusted() # type: ignore
elif platform == 'win32': elif platform == 'win32':
# sigh tkFileDialog.askdirectory doesn't support unicode on Windows # sigh tkFileDialog.askdirectory doesn't support unicode on Windows
import ctypes 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 from ctypes.wintypes import HINSTANCE, HWND, LPARAM, LPCWSTR, LPVOID, LPWSTR, MAX_PATH, POINT, RECT, SIZE, UINT
SHGetLocalizedName = ctypes.windll.shell32.SHGetLocalizedName SHGetLocalizedName = ctypes.windll.shell32.SHGetLocalizedName