INSTRUCTION stringlengths 1 8.43k | RESPONSE stringlengths 75 104k |
|---|---|
Get object properties. | def getobjectinfo(self, window_name, object_name):
"""
Get object properties.
@param window_name: Window name to look for, either full name,
LDTP's name convention, or a Unix glob.
@type window_name: string
@param object_name: Object name to look for, either full name,
... |
Get object property value. | def getobjectproperty(self, window_name, object_name, prop):
"""
Get object property value.
@param window_name: Window name to look for, either full name,
LDTP's name convention, or a Unix glob.
@type window_name: string
@param object_name: Object name to look for, eithe... |
Gets the list of object available in the window which matches component name or role name or both. | def getchild(self, window_name, child_name='', role='', parent=''):
"""
Gets the list of object available in the window, which matches
component name or role name or both.
@param window_name: Window name to look for, either full name,
LDTP's name convention, or a Unix glob.
... |
Launch application. | def launchapp(self, cmd, args=[], delay=0, env=1, lang="C"):
"""
Launch application.
@param cmd: Command line string to execute.
@type cmd: string
@param args: Arguments to the application
@type args: list
@param delay: Delay after the application is launched
... |
Activate window. | def activatewindow(self, window_name):
"""
Activate window.
@param window_name: Window name to look for, either full name,
LDTP's name convention, or a Unix glob.
@type window_name: string
@return: 1 on success.
@rtype: integer
"""
window_handle ... |
Click item. | def click(self, window_name, object_name):
"""
Click item.
@param window_name: Window name to look for, either full name,
LDTP's name convention, or a Unix glob.
@type window_name: string
@param object_name: Object name to look for, either full name,
LDTP's name ... |
Get all states of given object | def getallstates(self, window_name, object_name):
"""
Get all states of given object
@param window_name: Window name to look for, either full name,
LDTP's name convention, or a Unix glob.
@type window_name: string
@param object_name: Object name to look for, either full ... |
has state | def hasstate(self, window_name, object_name, state, guiTimeOut=0):
"""
has state
@param window_name: Window name to look for, either full name,
LDTP's name convention, or a Unix glob.
@type window_name: string
@param object_name: Object name to look for, either full name... |
Get object size | def getobjectsize(self, window_name, object_name=None):
"""
Get object size
@param window_name: Window name to look for, either full name,
LDTP's name convention, or a Unix glob.
@type window_name: string
@param object_name: Object name to look for, either full name,
... |
Grab focus. | def grabfocus(self, window_name, object_name=None):
"""
Grab focus.
@param window_name: Window name to look for, either full name,
LDTP's name convention, or a Unix glob.
@type window_name: string
@param object_name: Object name to look for, either full name,
LDT... |
Checks whether a window or component exists. | def guiexist(self, window_name, object_name=None):
"""
Checks whether a window or component exists.
@param window_name: Window name to look for, either full name,
LDTP's name convention, or a Unix glob.
@type window_name: string
@param object_name: Object name to look fo... |
Wait till a window or component exists. | def waittillguiexist(self, window_name, object_name='',
guiTimeOut=30, state=''):
"""
Wait till a window or component exists.
@param window_name: Window name to look for, either full name,
LDTP's name convention, or a Unix glob.
@type window_name: string... |
Wait till a window does not exist. | def waittillguinotexist(self, window_name, object_name='', guiTimeOut=30):
"""
Wait till a window does not exist.
@param window_name: Window name to look for, either full name,
LDTP's name convention, or a Unix glob.
@type window_name: string
@param object_name: Object n... |
Checks whether a window or component exists. | def objectexist(self, window_name, object_name):
"""
Checks whether a window or component exists.
@param window_name: Window name to look for, either full name,
LDTP's name convention, or a Unix glob.
@type window_name: string
@param object_name: Object name to look for,... |
Check whether an object state is enabled or not | def stateenabled(self, window_name, object_name):
"""
Check whether an object state is enabled or not
@param window_name: Window name to look for, either full name,
LDTP's name convention, or a Unix glob.
@type window_name: string
@param object_name: Object name to look ... |
Check item. | def check(self, window_name, object_name):
"""
Check item.
@param window_name: Window name to look for, either full name,
LDTP's name convention, or a Unix glob.
@type window_name: string
@param object_name: Object name to look for, either full name,
LDTP's name ... |
Verify check item. | def verifycheck(self, window_name, object_name):
"""
Verify check item.
@param window_name: Window name to look for, either full name,
LDTP's name convention, or a Unix glob.
@type window_name: string
@param object_name: Object name to look for, either full name,
... |
Get access key of given object | def getaccesskey(self, window_name, object_name):
"""
Get access key of given object
@param window_name: Window name to look for, either full name,
LDTP's name convention, or a Unix glob.
@type window_name: string
@param object_name: Object name to look for, either full ... |
Get the clipboard data ( Paste ). | def paste(cls):
"""Get the clipboard data ('Paste').
Returns: Data (string) retrieved or None if empty. Exceptions from
AppKit will be handled by caller.
"""
pb = AppKit.NSPasteboard.generalPasteboard()
# If we allow for multiple data types (e.g. a list of data types)
... |
Set the clipboard data ( Copy ). | def copy(cls, data):
"""Set the clipboard data ('Copy').
Parameters: data to set (string)
Optional: datatype if it's not a string
Returns: True / False on successful copy, Any exception raised (like
passes the NSPasteboardCommunicationError) should be caught
... |
Clear contents of general pasteboard. | def clearContents(cls):
"""Clear contents of general pasteboard.
Future enhancement can include specifying which clipboard to clear
Returns: True on success; caller should expect to catch exceptions,
probably from AppKit (ValueError)
"""
log_msg = 'Request to cl... |
Method to test if the general pasteboard is empty or not with respect to the type of object you want. | def isEmpty(cls, datatype=None):
"""Method to test if the general pasteboard is empty or not with respect
to the type of object you want.
Parameters: datatype (defaults to strings)
Returns: Boolean True (empty) / False (has contents); Raises
exception (passes any raised... |
Get LDTP format accessibile name | def _ldtpize_accessible(self, acc):
"""
Get LDTP format accessibile name
@param acc: Accessible handle
@type acc: object
@return: object type, stripped object name (associated / direct),
associated label
@rtype: tuple
"""
actual_r... |
Match given string by escaping regex characters | def _glob_match(self, pattern, string):
"""
Match given string, by escaping regex characters
"""
# regex flags Multi-line, Unicode, Locale
return bool(re.match(fnmatch.translate(pattern), string,
re.M | re.U | re.L)) |
Select ( click ) a menu item. | def selectmenuitem(self, window_name, object_name):
"""
Select (click) a menu item.
@param window_name: Window name to look for, either full name,
LDTP's name convention, or a Unix glob.
@type window_name: string
@param object_name: Object name to look for, either full n... |
Check a menu item exist. | def doesmenuitemexist(self, window_name, object_name):
"""
Check a menu item exist.
@param window_name: Window name to look for, either full name,
LDTP's name convention, or a Unix glob.
@type window_name: string
@param object_name: Object name to look for, either full n... |
Verify a menu item is enabled | def menuitemenabled(self, window_name, object_name):
"""
Verify a menu item is enabled
@param window_name: Window name to look for, either full name,
LDTP's name convention, or a Unix glob.
@type window_name: string
@param object_name: Object name to look for, either ful... |
List children of menu item @param window_name: Window name to look for either full name LDTP s name convention or a Unix glob. @type window_name: string @param object_name: Object name to look for either full name LDTP s name convention or a Unix glob. Or menu heirarchy @type object_name: string | def listsubmenus(self, window_name, object_name):
"""
List children of menu item
@param window_name: Window name to look for, either full name,
LDTP's name convention, or a Unix glob.
@type window_name: string
@param object_name: Object name to look for, either f... |
Verify a menu item is checked | def verifymenucheck(self, window_name, object_name):
"""
Verify a menu item is checked
@param window_name: Window name to look for, either full name,
LDTP's name convention, or a Unix glob.
@type window_name: string
@param object_name: Object name to look for, either ful... |
Check ( click ) a menu item. | def menucheck(self, window_name, object_name):
"""
Check (click) a menu item.
@param window_name: Window name to look for, either full name,
LDTP's name convention, or a Unix glob.
@type window_name: string
@param object_name: Object name to look for, either full name,
... |
Get a list of the running applications. | def _getRunningApps(cls):
"""Get a list of the running applications."""
def runLoopAndExit():
AppHelper.stopEventLoop()
AppHelper.callLater(1, runLoopAndExit)
AppHelper.runConsoleEventLoop()
# Get a list of running applications
ws = AppKit.NSWorkspace.shared... |
Get the current frontmost application. | def getFrontmostApp(cls):
"""Get the current frontmost application.
Raise a ValueError exception if no GUI applications are found.
"""
# Refresh the runningApplications list
apps = cls._getRunningApps()
for app in apps:
pid = app.processIdentifier()
... |
Get a random app that has windows. | def getAnyAppWithWindow(cls):
"""Get a random app that has windows.
Raise a ValueError exception if no GUI applications are found.
"""
# Refresh the runningApplications list
apps = cls._getRunningApps()
for app in apps:
pid = app.processIdentifier()
... |
Launch the application with the specified bundle ID | def launchAppByBundleId(bundleID):
"""Launch the application with the specified bundle ID"""
# NSWorkspaceLaunchAllowingClassicStartup does nothing on any
# modern system that doesn't have the classic environment installed.
# Encountered a bug when passing 0 for no options on 10.6 PyObjC... |
Launch app with a given bundle path. | def launchAppByBundlePath(bundlePath, arguments=None):
"""Launch app with a given bundle path.
Return True if succeed.
"""
if arguments is None:
arguments = []
bundleUrl = NSURL.fileURLWithPath_(bundlePath)
workspace = AppKit.NSWorkspace.sharedWorkspace()
... |
Terminate app with a given bundle ID. Requires 10. 6. | def terminateAppByBundleId(bundleID):
"""Terminate app with a given bundle ID.
Requires 10.6.
Return True if succeed.
"""
ra = AppKit.NSRunningApplication
if getattr(ra, "runningApplicationsWithBundleIdentifier_"):
appList = ra.runningApplicationsWithBundleId... |
Private method to post queued events ( e. g. Quartz events ). | def _postQueuedEvents(self, interval=0.01):
"""Private method to post queued events (e.g. Quartz events).
Each event in queue is a tuple (event call, args to event call).
"""
while len(self.eventList) > 0:
(nextEvent, args) = self.eventList.popleft()
nextEvent(*a... |
Private method to queue events to run. | def _queueEvent(self, event, args):
"""Private method to queue events to run.
Each event in queue is a tuple (event call, args to event call).
"""
if not hasattr(self, 'eventList'):
self.eventList = deque([(event, args)])
return
self.eventList.append((eve... |
Add keypress to queue. | def _addKeyToQueue(self, keychr, modFlags=0, globally=False):
"""Add keypress to queue.
Parameters: key character or constant referring to a non-alpha-numeric
key (e.g. RETURN or TAB)
modifiers
global or app specific
Returns: None or r... |
Send one character with no modifiers. | def _sendKey(self, keychr, modFlags=0, globally=False):
"""Send one character with no modifiers.
Parameters: key character or constant referring to a non-alpha-numeric
key (e.g. RETURN or TAB)
modifier flags,
global or app specific
Ret... |
Press given modifiers ( provided in list form ). | def _pressModifiers(self, modifiers, pressed=True, globally=False):
"""Press given modifiers (provided in list form).
Parameters: modifiers list, global or app specific
Optional: keypressed state (default is True (down))
Returns: Unsigned int representing flags to set
"""
... |
Hold given modifier keys ( provided in list form ). | def _holdModifierKeys(self, modifiers):
"""Hold given modifier keys (provided in list form).
Parameters: modifiers list
Returns: Unsigned int representing flags to set
"""
modFlags = self._pressModifiers(modifiers)
# Post the queued keypresses:
self._postQueuedEv... |
Release given modifiers ( provided in list form ). | def _releaseModifiers(self, modifiers, globally=False):
"""Release given modifiers (provided in list form).
Parameters: modifiers list
Returns: None
"""
# Release them in reverse order from pressing them:
modifiers.reverse()
modFlags = self._pressModifiers(modifi... |
Release given modifier keys ( provided in list form ). | def _releaseModifierKeys(self, modifiers):
"""Release given modifier keys (provided in list form).
Parameters: modifiers list
Returns: Unsigned int representing flags to set
"""
modFlags = self._releaseModifiers(modifiers)
# Post the queued keypresses:
self._post... |
Check whether given keyboard character is a single character. | def _isSingleCharacter(keychr):
"""Check whether given keyboard character is a single character.
Parameters: key character which will be checked.
Returns: True when given key character is a single character.
"""
if not keychr:
return False
# Regular character... |
Send one character with the given modifiers pressed. | def _sendKeyWithModifiers(self, keychr, modifiers, globally=False):
"""Send one character with the given modifiers pressed.
Parameters: key character, list of modifiers, global or app specific
Returns: None or raise ValueError exception
"""
if not self._isSingleCharacter(keychr)... |
Private method to handle generic mouse button clicking. | def _queueMouseButton(self, coord, mouseButton, modFlags, clickCount=1,
dest_coord=None):
"""Private method to handle generic mouse button clicking.
Parameters: coord (x, y) to click, mouseButton (e.g.,
kCGMouseButtonLeft), modFlags set (int)
Option... |
Private method to handle generic mouse left button dragging and dropping. | def _leftMouseDragged(self, stopCoord, strCoord, speed):
"""Private method to handle generic mouse left button dragging and
dropping.
Parameters: stopCoord(x,y) drop point
Optional: strCoord (x, y) drag point, default (0,0) get current
mouse position
... |
Wait for a particular UI event to occur ; this can be built upon in NativeUIElement for specific convenience methods. | def _waitFor(self, timeout, notification, **kwargs):
"""Wait for a particular UI event to occur; this can be built
upon in NativeUIElement for specific convenience methods.
"""
callback = self._matchOther
retelem = None
callbackArgs = None
callbackKwargs = None
... |
Convenience method to wait for focused element to change ( to element matching kwargs criteria ). | def waitForFocusToMatchCriteria(self, timeout=10, **kwargs):
"""Convenience method to wait for focused element to change
(to element matching kwargs criteria).
Returns: Element or None
"""
def _matchFocused(retelem, **kwargs):
return retelem if retelem._match(**kwa... |
Retrieve a list of actions supported by the object. | def _getActions(self):
"""Retrieve a list of actions supported by the object."""
actions = _a11y.AXUIElement._getActions(self)
# strip leading AX from actions - help distinguish them from attributes
return [action[2:] for action in actions] |
Perform the specified action. | def _performAction(self, action):
"""Perform the specified action."""
try:
_a11y.AXUIElement._performAction(self, 'AX%s' % action)
except _a11y.ErrorUnsupported as e:
sierra_ver = '10.12'
if mac_ver()[0] < sierra_ver:
raise e
else:
... |
Generator which yields all AXChildren of the object. | def _generateChildren(self):
"""Generator which yields all AXChildren of the object."""
try:
children = self.AXChildren
except _a11y.Error:
return
if children:
for child in children:
yield child |
Generator which recursively yields all AXChildren of the object. | def _generateChildrenR(self, target=None):
"""Generator which recursively yields all AXChildren of the object."""
if target is None:
target = self
try:
children = target.AXChildren
except _a11y.Error:
return
if children:
for child i... |
Method which indicates if the object matches specified criteria. | def _match(self, **kwargs):
"""Method which indicates if the object matches specified criteria.
Match accepts criteria as kwargs and looks them up on attributes.
Actual matching is performed with fnmatch, so shell-like wildcards
work within match strings. Examples:
obj._match(A... |
Perform _match but on another object not self. | def _matchOther(self, obj, **kwargs):
"""Perform _match but on another object, not self."""
if obj is not None:
# Need to check that the returned UI element wasn't destroyed first:
if self._findFirstR(**kwargs):
return obj._match(**kwargs)
return False |
Generator which yields matches on AXChildren. | def _generateFind(self, **kwargs):
"""Generator which yields matches on AXChildren."""
for needle in self._generateChildren():
if needle._match(**kwargs):
yield needle |
Generator which yields matches on AXChildren and their children. | def _generateFindR(self, **kwargs):
"""Generator which yields matches on AXChildren and their children."""
for needle in self._generateChildrenR():
if needle._match(**kwargs):
yield needle |
Return a list of all children that match the specified criteria. | def _findAll(self, **kwargs):
"""Return a list of all children that match the specified criteria."""
result = []
for item in self._generateFind(**kwargs):
result.append(item)
return result |
Return a list of all children ( recursively ) that match the specified criteria. | def _findAllR(self, **kwargs):
"""Return a list of all children (recursively) that match the specified
criteria.
"""
result = []
for item in self._generateFindR(**kwargs):
result.append(item)
return result |
Get the base application UIElement. | def _getApplication(self):
"""Get the base application UIElement.
If the UIElement is a child of the application, it will try
to get the AXParent until it reaches the top application level
element.
"""
app = self
while True:
try:
app =... |
Return the specified menu item. | def _menuItem(self, menuitem, *args):
"""Return the specified menu item.
Example - refer to items by name:
app._menuItem(app.AXMenuBar, 'File', 'New').Press()
app._menuItem(app.AXMenuBar, 'Edit', 'Insert', 'Line Break').Press()
Refer to items by index:
app._menuitem(a... |
Activate the application ( bringing menus and windows forward ). | def _activate(self):
"""Activate the application (bringing menus and windows forward)."""
ra = AppKit.NSRunningApplication
app = ra.runningApplicationWithProcessIdentifier_(
self._getPid())
# NSApplicationActivateAllWindows | NSApplicationActivateIgnoringOtherApps
# =... |
Return the bundle ID of the application. | def _getBundleId(self):
"""Return the bundle ID of the application."""
ra = AppKit.NSRunningApplication
app = ra.runningApplicationWithProcessIdentifier_(
self._getPid())
return app.bundleIdentifier() |
Return the specified menu item. | def menuItem(self, *args):
"""Return the specified menu item.
Example - refer to items by name:
app.menuItem('File', 'New').Press()
app.menuItem('Edit', 'Insert', 'Line Break').Press()
Refer to items by index:
app.menuitem(1, 0).Press()
Refer to items by mix-... |
Return the specified item in a pop up menu. | def popUpItem(self, *args):
"""Return the specified item in a pop up menu."""
self.Press()
time.sleep(.5)
return self._menuItem(self, *args) |
Drag the left mouse button without modifiers pressed. | def dragMouseButtonLeft(self, coord, dest_coord, interval=0.5):
"""Drag the left mouse button without modifiers pressed.
Parameters: coordinates to click on screen (tuple (x, y))
dest coordinates to drag to (tuple (x, y))
interval to send event of btn down, drag ... |
Double - click and drag the left mouse button without modifiers pressed. | def doubleClickDragMouseButtonLeft(self, coord, dest_coord, interval=0.5):
"""Double-click and drag the left mouse button without modifiers
pressed.
Parameters: coordinates to double-click on screen (tuple (x, y))
dest coordinates to drag to (tuple (x, y))
... |
Click the left mouse button without modifiers pressed. | def clickMouseButtonLeft(self, coord, interval=None):
"""Click the left mouse button without modifiers pressed.
Parameters: coordinates to click on screen (tuple (x, y))
Returns: None
"""
modFlags = 0
self._queueMouseButton(coord, Quartz.kCGMouseButtonLeft, modFlags)
... |
Click the right mouse button without modifiers pressed. | def clickMouseButtonRight(self, coord):
"""Click the right mouse button without modifiers pressed.
Parameters: coordinates to click on scren (tuple (x, y))
Returns: None
"""
modFlags = 0
self._queueMouseButton(coord, Quartz.kCGMouseButtonRight, modFlags)
self._po... |
Click the left mouse button with modifiers pressed. | def clickMouseButtonLeftWithMods(self, coord, modifiers, interval=None):
"""Click the left mouse button with modifiers pressed.
Parameters: coordinates to click; modifiers (list) (e.g. [SHIFT] or
[COMMAND, SHIFT] (assuming you've first used
from pyatom.AXKeyCodeC... |
Click the right mouse button with modifiers pressed. | def clickMouseButtonRightWithMods(self, coord, modifiers):
"""Click the right mouse button with modifiers pressed.
Parameters: coordinates to click; modifiers (list)
Returns: None
"""
modFlags = self._pressModifiers(modifiers)
self._queueMouseButton(coord, Quartz.kCGMous... |
Click the left mouse button and drag object. | def leftMouseDragged(self, stopCoord, strCoord=(0, 0), speed=1):
"""Click the left mouse button and drag object.
Parameters: stopCoord, the position of dragging stopped
strCoord, the position of dragging started
(0,0) will get current position
... |
Double - click primary mouse button. | def doubleClickMouse(self, coord):
"""Double-click primary mouse button.
Parameters: coordinates to click (assume primary is left button)
Returns: None
"""
modFlags = 0
self._queueMouseButton(coord, Quartz.kCGMouseButtonLeft, modFlags)
# This is a kludge:
... |
Click the left mouse button with modifiers pressed. | def doubleMouseButtonLeftWithMods(self, coord, modifiers):
"""Click the left mouse button with modifiers pressed.
Parameters: coordinates to click; modifiers (list)
Returns: None
"""
modFlags = self._pressModifiers(modifiers)
self._queueMouseButton(coord, Quartz.kCGMouse... |
Triple - click primary mouse button. | def tripleClickMouse(self, coord):
"""Triple-click primary mouse button.
Parameters: coordinates to click (assume primary is left button)
Returns: None
"""
# Note above re: double-clicks applies to triple-clicks
modFlags = 0
for i in range(2):
self._q... |
Generic wait for a UI event that matches the specified criteria to occur. | def waitFor(self, timeout, notification, **kwargs):
"""Generic wait for a UI event that matches the specified
criteria to occur.
For customization of the callback, use keyword args labeled
'callback', 'args', and 'kwargs' for the callback fn, callback args,
and callback kwargs, ... |
Convenience method to wait for creation of some UI element. | def waitForCreation(self, timeout=10, notification='AXCreated'):
"""Convenience method to wait for creation of some UI element.
Returns: The element created
"""
callback = AXCallbacks.returnElemCallback
retelem = None
args = (retelem,)
return self.waitFor(timeou... |
Convenience method to wait for a window with the given name to disappear. | def waitForWindowToDisappear(self, winName, timeout=10):
"""Convenience method to wait for a window with the given name to
disappear.
Returns: Boolean
"""
callback = AXCallbacks.elemDisappearedCallback
retelem = None
args = (retelem, self)
# For some rea... |
Convenience method to wait for value attribute of given element to change. | def waitForValueToChange(self, timeout=10):
"""Convenience method to wait for value attribute of given element to
change.
Some types of elements (e.g. menu items) have their titles change,
so this will not work for those. This seems to work best if you set
the notification at t... |
Convenience method to wait for focused element to change ( to new element given ). | def waitForFocusToChange(self, newFocusedElem, timeout=10):
"""Convenience method to wait for focused element to change (to new
element given).
Returns: Boolean
"""
return self.waitFor(timeout, 'AXFocusedUIElementChanged',
AXRole=newFocusedElem.AXRole... |
Convenience method to wait for focused window to change | def waitForFocusedWindowToChange(self, nextWinName, timeout=10):
"""Convenience method to wait for focused window to change
Returns: Boolean
"""
callback = AXCallbacks.returnElemCallback
retelem = None
return self.waitFor(timeout, 'AXFocusedWindowChanged',
... |
Method used by role based convenience functions to find a match | def _convenienceMatch(self, role, attr, match):
"""Method used by role based convenience functions to find a match"""
kwargs = {}
# If the user supplied some text to search for,
# supply that in the kwargs
if match:
kwargs[attr] = match
return self.findAll(AXR... |
Method used by role based convenience functions to find a match | def _convenienceMatchR(self, role, attr, match):
"""Method used by role based convenience functions to find a match"""
kwargs = {}
# If the user supplied some text to search for,
# supply that in the kwargs
if match:
kwargs[attr] = match
return self.findAllR(A... |
Captures screenshot of the whole desktop or given window @param window_name: Window name to look for either full name LDTP s name convention or a Unix glob. @type window_name: string @param x: x co - ordinate value @type x: int @param y: y co - ordinate value @type y: int @param width: width co - ordinate value @type w... | def imagecapture(self, window_name=None, x=0, y=0,
width=None, height=None):
"""
Captures screenshot of the whole desktop or given window
@param window_name: Window name to look for, either full name,
LDTP's name convention, or a Unix glob.
@type win... |
@param filename: Start logging on the specified file @type filename: string @param overwrite: Overwrite or append False - Append log to an existing file True - Write log to a new file. If file already exist then erase existing file content and start log @type overwrite: boolean | def startlog(filename, overwrite=True):
"""
@param filename: Start logging on the specified file
@type filename: string
@param overwrite: Overwrite or append
False - Append log to an existing file
True - Write log to a new file. If file already exist,
then erase existing file co... |
Remove registered callback on window create | def removecallback(window_name):
"""
Remove registered callback on window create
@param window_name: Window name to look for, either full name,
LDTP's name convention, or a Unix glob.
@type window_name: string
@return: 1 if registration was successful, 0 if not.
@rtype: integer
"""
... |
call a function on the main thread ( async ) | def callAfter(func, *args, **kwargs):
"""call a function on the main thread (async)"""
pool = NSAutoreleasePool.alloc().init()
obj = PyObjCAppHelperCaller_wrap.alloc().initWithArgs_((func, args, kwargs))
obj.callAfter_(None)
del obj
del pool |
call a function on the main thread after a delay ( async ) | def callLater(delay, func, *args, **kwargs):
"""call a function on the main thread after a delay (async)"""
pool = NSAutoreleasePool.alloc().init()
obj = PyObjCAppHelperCaller_wrap.alloc().initWithArgs_((func, args, kwargs))
obj.callLater_(delay)
del obj
del pool |
Stop the current event loop if possible returns True if it expects that it was successful False otherwise | def stopEventLoop():
"""
Stop the current event loop if possible
returns True if it expects that it was successful, False otherwise
"""
stopper = PyObjCAppHelperRunLoopStopper_wrap.currentRunLoopStopper()
if stopper is None:
if NSApp() is not None:
NSApp().terminate_(None)
... |
Run the event loop ask the user if we should continue if an exception is caught. Use this function instead of NSApplicationMain (). | def runEventLoop(argv=None, unexpectedErrorAlert=None, installInterrupt=None, pdb=None, main=NSApplicationMain):
"""Run the event loop, ask the user if we should continue if an
exception is caught. Use this function instead of NSApplicationMain().
"""
if argv is None:
argv = sys.argv
if pdb... |
Press key. NOTE: keyrelease should be called | def keypress(self, data):
"""
Press key. NOTE: keyrelease should be called
@param data: data to type.
@type data: string
@return: 1 on success.
@rtype: integer
"""
try:
window = self._get_front_most_window()
except (IndexError,):
... |
Release key. NOTE: keypress should be called before this | def keyrelease(self, data):
"""
Release key. NOTE: keypress should be called before this
@param data: data to type.
@type data: string
@return: 1 on success.
@rtype: integer
"""
try:
window = self._get_front_most_window()
except (Inde... |
Type string sequence. @param window_name: Window name to focus on either full name LDTP s name convention or a Unix glob. @type window_name: string @param object_name: Object name to focus on either full name LDTP s name convention or a Unix glob. @type object_name: string @param data: data to type. @type data: string | def enterstring(self, window_name, object_name='', data=''):
"""
Type string sequence.
@param window_name: Window name to focus on, either full name,
LDTP's name convention, or a Unix glob.
@type window_name: string
@param object_name: Object name to focus on, ei... |
Get text value @param window_name: Window name to type in either full name LDTP s name convention or a Unix glob. @type window_name: string @param object_name: Object name to type in either full name LDTP s name convention or a Unix glob. @type object_name: string @param startPosition: Starting position of text to fetc... | def gettextvalue(self, window_name, object_name, startPosition=0, endPosition=0):
"""
Get text value
@param window_name: Window name to type in, either full name,
LDTP's name convention, or a Unix glob.
@type window_name: string
@param object_name: Object name to... |
Insert string sequence in given position. @param window_name: Window name to type in either full name LDTP s name convention or a Unix glob. @type window_name: string @param object_name: Object name to type in either full name LDTP s name convention or a Unix glob. @type object_name: string @param position: position wh... | def inserttext(self, window_name, object_name, position, data):
"""
Insert string sequence in given position.
@param window_name: Window name to type in, either full name,
LDTP's name convention, or a Unix glob.
@type window_name: string
@param object_name: Objec... |
Verify partial text @param window_name: Window name to type in either full name LDTP s name convention or a Unix glob. @type window_name: string @param object_name: Object name to type in either full name LDTP s name convention or a Unix glob. @type object_name: string @param partial_text: Partial text to match @type o... | def verifypartialmatch(self, window_name, object_name, partial_text):
"""
Verify partial text
@param window_name: Window name to type in, either full name,
LDTP's name convention, or a Unix glob.
@type window_name: string
@param object_name: Object name to type i... |
Verify text is set correctly @param window_name: Window name to type in either full name LDTP s name convention or a Unix glob. @type window_name: string @param object_name: Object name to type in either full name LDTP s name convention or a Unix glob. @type object_name: string @param text: text to match @type object_n... | def verifysettext(self, window_name, object_name, text):
"""
Verify text is set correctly
@param window_name: Window name to type in, either full name,
LDTP's name convention, or a Unix glob.
@type window_name: string
@param object_name: Object name to type in, e... |
Verifies text state enabled or not @param window_name: Window name to type in either full name LDTP s name convention or a Unix glob. @type window_name: string @param object_name: Object name to type in either full name LDTP s name convention or a Unix glob. @type object_name: string | def istextstateenabled(self, window_name, object_name):
"""
Verifies text state enabled or not
@param window_name: Window name to type in, either full name,
LDTP's name convention, or a Unix glob.
@type window_name: string
@param object_name: Object name to type ... |
Get character count @param window_name: Window name to type in either full name LDTP s name convention or a Unix glob. @type window_name: string @param object_name: Object name to type in either full name LDTP s name convention or a Unix glob. @type object_name: string | def getcharcount(self, window_name, object_name):
"""
Get character count
@param window_name: Window name to type in, either full name,
LDTP's name convention, or a Unix glob.
@type window_name: string
@param object_name: Object name to type in, either full name,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.