def mouse_alternates(mode, nexus, monitor=1): if nexus.dep.PIL: if mode == "legion" and not utilities.window_exists(None, "legiongrid"): r = monitors[int(monitor) - 1].rectangle bbox = [ int(r.x), int(r.y), int(r.x) + int(r.dx) - 1, int(r.y) + int(r.dy) - 1 ] ls = LegionScanner() ls.scan(bbox) tscan = ls.get_update() Popen([ settings.SETTINGS["paths"]["PYTHONW"], settings.SETTINGS["paths"]["LEGION_PATH"], "-t", tscan[0], "-m", str(monitor) ]) # , "-d", "500_500_500_500" elif mode == "rainbow" and not utilities.window_exists(None, "rainbowgrid"): Popen([ settings.SETTINGS["paths"]["PYTHONW"], settings.SETTINGS["paths"]["RAINBOW_PATH"], "-g", "r", "-m", str(monitor) ]) elif mode == "douglas" and not utilities.window_exists(None, "douglasgrid"): Popen([ settings.SETTINGS["paths"]["PYTHONW"], settings.SETTINGS["paths"]["DOUGLAS_PATH"], "-g", "d", "-m", str(monitor) ]) else: utilities.availability_message(mode.title(), "PIL")
def mouse_alternates(mode, nexus, monitor=1): if nexus.dep.PIL: if mode == "legion" and not utilities.window_exists( None, "legiongrid"): r = monitors[int(monitor) - 1].rectangle bbox = [ int(r.x), int(r.y), int(r.x) + int(r.dx) - 1, int(r.y) + int(r.dy) - 1 ] ls = LegionScanner() ls.scan(bbox) tscan = ls.get_update() Popen([ "pythonw", settings.SETTINGS["paths"]["LEGION_PATH"], "-t", tscan[0], "-m", str(monitor) ]) # , "-d", "500_500_500_500" elif mode == "rainbow" and not utilities.window_exists( None, "rainbowgrid"): Popen([ "pythonw", settings.SETTINGS["paths"]["RAINBOW_PATH"], "-g", "r", "-m", str(monitor) ]) elif mode == "douglas" and not utilities.window_exists( None, "douglasgrid"): Popen([ "pythonw", settings.SETTINGS["paths"]["DOUGLAS_PATH"], "-g", "d", "-m", str(monitor) ]) else: utilities.availability_message(mode.title(), "PIL")
def get_symbol(n, sticky): n = int(n) - 1 if n < 0 or n > len(control.nexus().sticky) - 1: return Text(control.nexus().sticky[n]).execute() if not utilities.window_exists(None, settings.S_LIST_VERSION): enable_sticky_list(sticky)
def mouse_alternates(mode): if control.nexus().dep.PIL: try: if mode == "legion": if utilities.window_exists(None, "legiongrid"): pass else: ls = LegionScanner() ls.scan() #[500, 500, 1000, 1000] tscan = ls.get_update() Popen([ "pythonw", settings.SETTINGS["paths"]["LEGION_PATH"], "-t", tscan[0] ]) #, "-d", "500_500_500_500" elif mode == "rainbow": Popen([ "pythonw", settings.SETTINGS["paths"]["RAINBOW_PATH"], "-m", "r" ]) elif mode == "douglas": Popen([ "pythonw", settings.SETTINGS["paths"]["DOUGLAS_PATH"], "-m", "d" ]) except Exception: utilities.simple_log(True) else: utilities.availability_message(mode.title(), "PIL")
def settings_window(): # if control.nexus().dep.WX: if not utilities.window_exists( None, settings.STATUS_WINDOW_TITLE + settings.SOFTWARE_VERSION_NUMBER): h_launch.launch(settings.WXTYPE_SETTINGS, get_settings_from_settings_window)
def remove_word(n, sticky): n = int(n) del control.nexus().sticky[n - 1] utilities.save_json_file(control.nexus().sticky, settings.SETTINGS["paths"]["S_LIST_JSON_PATH"]) if utilities.window_exists(None, settings.S_LIST_VERSION): control.nexus().comm.get_com("sticky_list").remove_symbol(n) else: enable_sticky_list(sticky)
def wait_for_death(title, timeout=5): t = 0.0 inc = 0.1 while t < timeout: if not utilities.window_exists(None, title): break t += inc time.sleep(inc) if t >= timeout: print("wait_for_death()" + " timed out (" + title + ")")
def add_symbol(sticky): sticky_key="sticky_key" navigation.clipboard_to_file(sticky_key, True) time.sleep(0.1) control.nexus().sticky.append(control.nexus().clip[sticky_key]) utilities.save_json_file(control.nexus().sticky, settings.SETTINGS["paths"]["S_LIST_JSON_PATH"]) if utilities.window_exists(None, settings.S_LIST_VERSION): control.nexus().comm.get_com("sticky_list").add_symbol(control.nexus().clip[sticky_key]) else: enable_sticky_list(sticky)
def mouse_alternates(mode): if control.nexus().dep.PIL: try: if mode == "legion": if utilities.window_exists(None, "legiongrid"): pass else: ls = LegionScanner() ls.scan()#[500, 500, 1000, 1000] tscan = ls.get_update() Popen(["pythonw", settings.SETTINGS["paths"]["LEGION_PATH"], "-t", tscan[0]])#, "-d", "500_500_500_500" elif mode == "rainbow": Popen(["pythonw", settings.SETTINGS["paths"]["RAINBOW_PATH"], "-m", "r"]) elif mode == "douglas": Popen(["pythonw", settings.SETTINGS["paths"]["DOUGLAS_PATH"], "-m", "d"]) except Exception: utilities.simple_log(True) else: utilities.availability_message(mode.title(), "PIL")
def kill(self): if utilities.window_exists(None, settings.STATUS_WINDOW_TITLE): self.communicator.get_com("status").kill()
import caster.w except Exception: pass from caster.asynch.hmc import h_launch from caster.asynch.hmc import vocabulary_processing from caster.asynch.sikuli import sikuli from caster.lib import navigation, password from caster.lib.pita import scanner from caster.lib.dfplus.state.short import R ccr.initialize_ccr() utilities.clean_temporary_files() recording.load_alias_rules() recording.load_recorded_rules() h_launch.clean_homunculi() if settings.SETTINGS["miscellaneous"]["status_window_enabled"] and not utilities.window_exists(None, statuswindow.TITLE): Popen(["pythonw", settings.SETTINGS["paths"]["STATUS_WINDOW_PATH"]]) except: print "\nAttempting to load CCR anyway..." from caster.lib import ccr, utilities utilities.simple_log() ccr.initialize_ccr() def fix_Dragon_double(): try: lr = control.nexus().history[len(control.nexus().history) - 1] lu = " ".join(lr) Key("left/5:" + str(len(lu)) + ", del")._execute() except Exception:
def settings_window(nexus): if not utilities.window_exists(None, settings.STATUS_WINDOW_TITLE + settings.SOFTWARE_VERSION_NUMBER): h_launch.launch(settings.WXTYPE_SETTINGS) on_complete = AsynchronousAction.hmc_complete(lambda data: receive_settings(data), nexus) AsynchronousAction([L(S(["cancel"], on_complete))], time_in_seconds=1, repetitions=300, blocking=False).execute()
def clear(): control.nexus().sticky=[] utilities.save_json_file(control.nexus().sticky, settings.SETTINGS["paths"]["S_LIST_JSON_PATH"]) if utilities.window_exists(None, settings.S_LIST_VERSION): control.nexus().comm.get_com("sticky_list").clear()
def launch_status(): if not utilities.window_exists(None, settings.STATUS_WINDOW_TITLE): Popen(["pythonw", settings.SETTINGS["paths"]["STATUS_WINDOW_PATH"]])
def settings_window(): # if control.nexus().dep.WX: if not utilities.window_exists(None, settings.STATUS_WINDOW_TITLE + settings.SOFTWARE_VERSION_NUMBER): h_launch.launch(settings.WXTYPE_SETTINGS, get_settings_from_settings_window)