Ejemplo n.º 1
0
        def run(self):
            global _isPumpPending
            _isPumpPending = False
            # print("pumpujuuu")
            watchdog.alive()
            try:
                # if touchHandler.handler:
                #     touchHandler.handler.pump()
                JABHandler.pumpAll()
                # IAccessibleHandler.pumpAll()
                queueHandler.pumpAll()
                # mouseHandler.pumpAll()
                # braille.pumpAll()
                # vision.pumpAll()
            except Exception as e:

                print("errors in this core pump cycle", e)
                # raise
            # baseObject.AutoPropertyObject.invalidateCaches()
            # print("spinkam")
            watchdog.asleep()
            # print("vstalsem")
            if _isPumpPending and not _pump.IsRunning():
                # #3803: Another pump was requested during this pump execution.
                # As our pump is not re-entrant, schedule another pump.
                _pump.Start(PUMP_MAX_DELAY, True)
Ejemplo n.º 2
0
def _callLaterExec(callable, args, kwargs):
	import watchdog
	watchdog.alive()
	try:
		return callable(*args, **kwargs)
	finally:
		watchdog.asleep()
Ejemplo n.º 3
0
    def leftDrag(self, timeout=0.3, mouse_up=True):
        """ Drag with left button from x,y to r,b coordinates.
		Dangerous! When mouse_up is false, should be paired with leftUp !!!
		Args:
			timeout (float): time (in seconds) to wait before moving from initial to final position
			mouse_up (bool): generate mouse_up event after dragging (!!! Dangerous !!!) 
		"""
        self.moveTo()
        winUser.mouse_event(winUser.MOUSEEVENTF_LEFTDOWN, 0, 0, None, None)
        watchdog.asleep()  # do not let watchdog interrupt us
        time.sleep(timeout)
        watchdog.alive()
        libsibiac.MouseMove(self.windowHandle, c_int(self.r), c_int(self.b))
        if mouse_up:
            winUser.mouse_event(winUser.MOUSEEVENTF_LEFTUP, 0, 0, None, None)
Ejemplo n.º 4
0
	def execute(self):
		data = self.inputCtrl.GetValue()
		watchdog.alive()
		self.console.push(data)
		watchdog.asleep()
		if data:
			# Only add non-blank lines to history.
			if len(self.inputHistory) > 1 and self.inputHistory[-2] == data:
				# The previous line was the same and we don't want consecutive duplicates, so trash the most recent line.
				del self.inputHistory[-1]
			else:
				# Update the content for the most recent line of history.
				self.inputHistory[-1] = data
			# Start with a new, blank line.
			self.inputHistory.append("")
		self.inputHistoryPos = len(self.inputHistory) - 1
		self.inputCtrl.ChangeValue("")
Ejemplo n.º 5
0
 def execute(self):
     data = self.inputCtrl.GetValue()
     watchdog.alive()
     self.console.push(data)
     watchdog.asleep()
     if data:
         # Only add non-blank lines to history.
         if len(self.inputHistory) > 1 and self.inputHistory[-2] == data:
             # The previous line was the same and we don't want consecutive duplicates, so trash the most recent line.
             del self.inputHistory[-1]
         else:
             # Update the content for the most recent line of history.
             self.inputHistory[-1] = data
         # Start with a new, blank line.
         self.inputHistory.append("")
     self.inputHistoryPos = len(self.inputHistory) - 1
     self.inputCtrl.ChangeValue("")
Ejemplo n.º 6
0
		def run(self):
			global _isPumpPending
			_isPumpPending = False
			watchdog.alive()
			try:
				if touchHandler.handler:
					touchHandler.handler.pump()
				JABHandler.pumpAll()
				IAccessibleHandler.pumpAll()
				queueHandler.pumpAll()
				mouseHandler.pumpAll()
				braille.pumpAll()
			except:
				log.exception("errors in this core pump cycle")
			baseObject.AutoPropertyObject.invalidateCaches()
			watchdog.asleep()
			if _isPumpPending and not _pump.IsRunning():
				# #3803: Another pump was requested during this pump execution.
				# As our pump is not re-entrant, schedule another pump.
				_pump.Start(PUMP_MAX_DELAY, True)
Ejemplo n.º 7
0
 def Notify(self):
     global _isPumpPending
     _isPumpPending = False
     watchdog.alive()
     try:
         if touchHandler.handler:
             touchHandler.handler.pump()
         JABHandler.pumpAll()
         IAccessibleHandler.pumpAll()
         queueHandler.pumpAll()
         mouseHandler.pumpAll()
         braille.pumpAll()
     except:
         log.exception("errors in this core pump cycle")
     baseObject.AutoPropertyObject.invalidateCaches()
     watchdog.asleep()
     if _isPumpPending and not _pump.IsRunning():
         # #3803: A pump was requested, but the timer was ignored by a modal loop
         # because timers aren't re-entrant.
         # Therefore, schedule another pump.
         _pump.Start(PUMP_MAX_DELAY, True)
Ejemplo n.º 8
0
		def Notify(self):
			global _isPumpPending
			_isPumpPending = False
			watchdog.alive()
			try:
				if touchHandler.handler:
					touchHandler.handler.pump()
				JABHandler.pumpAll()
				IAccessibleHandler.pumpAll()
				queueHandler.pumpAll()
				mouseHandler.pumpAll()
				braille.pumpAll()
			except:
				log.exception("errors in this core pump cycle")
			baseObject.AutoPropertyObject.invalidateCaches()
			watchdog.asleep()
			if _isPumpPending and not _pump.IsRunning():
				# #3803: A pump was requested, but the timer was ignored by a modal loop
				# because timers aren't re-entrant.
				# Therefore, schedule another pump.
				_pump.Start(PUMP_MAX_DELAY, True)
Ejemplo n.º 9
0
from __future__ import print_function

from ctypes import *
from ctypes.wintypes import *
import winUser
user32 = winUser.user32
import time
import watchdog
import os
from logHandler import log
import core

from .location import *
from .location import _LocationRef

watchdog.asleep()  # can take a while...
sibiac_dir = os.path.dirname(__file__)
dll = os.path.join(sibiac_dir, "..", "sibiac", "libsibiac.dll")
libsibiac = cdll.LoadLibrary(dll)
watchdog.alive()


def Colors2Tuple(arg, default=None):
    """ Convert an argument to tuple
	Args:
		arg (tuple of ints or single int, optional): the argument to convert
	"""
    if arg is None:
        if default is None:
            return None
        else: