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 committed 2022-12-23 19:01:02 +02:00
1 parent 4527177f9b
commit ca915782f6
2 files changed
+6 -1

No files matched your search

+2 -1
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
+4
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()