Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def locateAllOnScreen(*args, **kwargs):
return pyscreeze.locateAllOnScreen(*args, **kwargs)
locateAllOnScreen.__doc__ = pyscreeze.locateAllOnScreen.__doc__
@raisePyAutoGUIImageNotFoundException
def locateCenterOnScreen(*args, **kwargs):
return pyscreeze.locateCenterOnScreen(*args, **kwargs)
locateCenterOnScreen.__doc__ = pyscreeze.locateCenterOnScreen.__doc__
@raisePyAutoGUIImageNotFoundException
def locateOnScreen(*args, **kwargs):
return pyscreeze.locateOnScreen(*args, **kwargs)
locateOnScreen.__doc__ = pyscreeze.locateOnScreen.__doc__
except ImportError:
# If pyscreeze module is not found, screenshot-related features will simply not work.
def _couldNotImportPyScreeze():
"""
This function raises ``PyAutoGUIException``. It's used for the PyScreeze function names if the PyScreeze module
failed to be imported.
"""
raise PyAutoGUIException(
"PyAutoGUI was unable to import pyscreeze. (This is likely because you're running a version of Python that Pillow (which pyscreeze depends on) doesn't support currently.) Please install this module to enable the function you tried to call."
)
center = _couldNotImportPyScreeze
grab = _couldNotImportPyScreeze
locate = _couldNotImportPyScreeze
locateAll = _couldNotImportPyScreeze