macro_recorder: only import when we need it
parent
a75f4db086
commit
65a1e9d7c6
|
|
@ -11,8 +11,6 @@ from macro_action import ActionText, ActionTap, ActionDown, ActionUp, SS_TAP_COD
|
|||
from macro_key import KeyString, KeyDown, KeyUp, KeyTap
|
||||
from macro_line import MacroLine
|
||||
from macro_optimizer import macro_optimize
|
||||
from macro_recorder_linux import LinuxRecorder
|
||||
from macro_recorder_windows import WindowsRecorder
|
||||
from util import tr
|
||||
from vial_device import VialKeyboard
|
||||
|
||||
|
|
@ -194,8 +192,12 @@ class MacroRecorder(BasicEditor):
|
|||
self.recorder = None
|
||||
|
||||
if sys.platform.startswith("linux"):
|
||||
from macro_recorder_linux import LinuxRecorder
|
||||
|
||||
self.recorder = LinuxRecorder()
|
||||
elif sys.platform.startswith("win"):
|
||||
from macro_recorder_windows import WindowsRecorder
|
||||
|
||||
self.recorder = WindowsRecorder()
|
||||
|
||||
if self.recorder:
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ from fbs_runtime.application_context.PyQt5 import ApplicationContext
|
|||
|
||||
import sys
|
||||
|
||||
from linux_keystroke_recorder import linux_keystroke_recorder
|
||||
from main_window import MainWindow
|
||||
from constants import WINDOW_WIDTH, WINDOW_HEIGHT
|
||||
|
||||
|
|
@ -48,6 +47,8 @@ class UncaughtHook(QtCore.QObject):
|
|||
|
||||
if __name__ == '__main__':
|
||||
if len(sys.argv) == 2 and sys.argv[1] == "--linux-recorder":
|
||||
from linux_keystroke_recorder import linux_keystroke_recorder
|
||||
|
||||
linux_keystroke_recorder()
|
||||
else:
|
||||
appctxt = ApplicationContext() # 1. Instantiate ApplicationContext
|
||||
|
|
|
|||
Loading…
Reference in New Issue