1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-12 23:37:14 +03:00

hotkey: add sys.platform guards to all files

This both makes mypy happy and ensures that the wrong file is not
imported in the wrong place
This commit is contained in:
A_D 2022-12-23 19:01:02 +02:00
parent 4527177f9b
commit ca915782f6
No known key found for this signature in database
GPG Key ID: 4BE9EB7DF45076C4
2 changed files with 6 additions and 1 deletions

View File

@ -3,6 +3,7 @@ import pathlib
import sys
import tkinter as tk
from typing import Callable, Optional, Tuple, Union
assert sys.platform == 'darwin'
import objc
from AppKit import (
@ -36,7 +37,7 @@ class MacHotkeyMgr(AbstractHotkeyMgr):
def __init__(self):
self.MODIFIERMASK = NSShiftKeyMask | NSControlKeyMask | NSAlternateKeyMask | NSCommandKeyMask \
| NSNumericPadKeyMask
| NSNumericPadKeyMask
self.root: tk.Tk
self.keycode = 0

View File

@ -1,7 +1,11 @@
"""Linux implementation of hotkey.AbstractHotkeyMgr."""
import sys
from EDMCLogging import get_main_logger
from hotkey import AbstractHotkeyMgr
assert sys.platform == 'linux'
logger = get_main_logger()