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

Removed star import from ctypes

This commit is contained in:
A_D 2021-03-09 18:19:57 +02:00 committed by Athanasius
parent 933ec723bd
commit 82db2e1a06

View File

@ -6,26 +6,25 @@
# #
import os import os
from sys import platform
from os.path import join
import tkinter as tk import tkinter as tk
from tkinter import ttk from os.path import join
from sys import platform
from tkinter import font as tkFont from tkinter import font as tkFont
from ttkHyperlinkLabel import HyperlinkLabel from tkinter import ttk
from config import appname, applongname, config from config import applongname, appname, config
from ttkHyperlinkLabel import HyperlinkLabel
if __debug__: if __debug__:
from traceback import print_exc from traceback import print_exc
if platform == "linux": if platform == "linux":
from ctypes import * from ctypes import POINTER, c_char_p, c_int, c_long, c_uint, c_ulong, c_void_p, cdll, Structure, byref
if platform == 'win32': if platform == 'win32':
import ctypes import ctypes
from ctypes.wintypes import LPCWSTR, DWORD, LPCVOID from ctypes.wintypes import DWORD, LPCVOID, LPCWSTR
AddFontResourceEx = ctypes.windll.gdi32.AddFontResourceExW AddFontResourceEx = ctypes.windll.gdi32.AddFontResourceExW
AddFontResourceEx.restypes = [LPCWSTR, DWORD, LPCVOID] AddFontResourceEx.restypes = [LPCWSTR, DWORD, LPCVOID]
FR_PRIVATE = 0x10 FR_PRIVATE = 0x10
@ -33,6 +32,7 @@ if platform == 'win32':
AddFontResourceEx(join(config.respath, u'EUROCAPS.TTF'), FR_PRIVATE, 0) AddFontResourceEx(join(config.respath, u'EUROCAPS.TTF'), FR_PRIVATE, 0)
elif platform == 'linux': elif platform == 'linux':
# pyright: reportUnboundVariable=false
XID = c_ulong # from X.h: typedef unsigned long XID XID = c_ulong # from X.h: typedef unsigned long XID
Window = XID Window = XID
Atom = c_ulong Atom = c_ulong
@ -338,7 +338,7 @@ class _Theme(object):
self.active = theme self.active = theme
if platform == 'darwin': if platform == 'darwin':
from AppKit import NSApplication, NSAppearance, NSMiniaturizableWindowMask, NSResizableWindowMask from AppKit import NSAppearance, NSApplication, NSMiniaturizableWindowMask, NSResizableWindowMask
root.update_idletasks() # need main window to be created root.update_idletasks() # need main window to be created
appearance = NSAppearance.appearanceNamed_(theme and appearance = NSAppearance.appearanceNamed_(theme and
'NSAppearanceNameDarkAqua' or 'NSAppearanceNameDarkAqua' or