Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
from collections import namedtuple
from ahk.script import ScriptEngine
from ahk.utils import make_logger
import ast
logger = make_logger(__name__)
_BUTTONS = {
1: 'L',
2: 'R',
3: 'M',
'left': 'L',
'right': 'R',
'middle': 'M',
'wheelup': 'WU',
'wheeldown': 'WD',
'wheelleft': 'WL',
'wheelright': 'WR',
}
def resolve_button(button):
import os
import subprocess
from shutil import which
from ahk.utils import make_logger
from ahk.directives import Persistent
from jinja2 import Environment, FileSystemLoader
logger = make_logger(__name__)
class ExecutableNotFoundError(EnvironmentError):
pass
class ScriptEngine(object):
def __init__(self, executable_path: str='', **kwargs):
"""
:param executable_path: the path to the AHK executable.
Defaults to environ['AHK_PATH'] if not explicitly provided
If environment variable not present, tries to look for 'AutoHotkey.exe' or 'AutoHotkeyA32.exe' with shutil.which
:param keep_scripts:
:raises ExecutableNotFound: if AHK executable is not provided and cannot be found in environment variables or PATH
"""
if not executable_path:
from ahk.script import ScriptEngine
import ast
from ahk.utils import make_logger, escape_sequence_replace
from contextlib import suppress
logger = make_logger(__name__)
class WindowNotFoundError(ValueError):
pass
class Control:
def __init__(self):
raise NotImplementedError
def click(self):
"""
REF: https://www.autohotkey.com/docs/commands/ControlClick.htm
:return:
"""
raise NotImplementedError