How to use the ahk.utils.make_logger function in ahk

To help you get started, we’ve selected a few ahk examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github spyoungtech / ahk / ahk / mouse.py View on Github external
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):
github spyoungtech / ahk / ahk / script.py View on Github external
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:
github spyoungtech / ahk / ahk / window.py View on Github external
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