INSTRUCTION stringlengths 1 8.43k | RESPONSE stringlengths 75 104k |
|---|---|
x: int. y: int. count: int. Return ctypes. Array an iterable array of int values in argb form point x y horizontally. | def GetPixelColorsHorizontally(self, x: int, y: int, count: int) -> ctypes.Array:
"""
x: int.
y: int.
count: int.
Return `ctypes.Array`, an iterable array of int values in argb form point x,y horizontally.
"""
arrayType = ctypes.c_uint32 * count
values = a... |
Set pixel colors form x y horizontally. x: int. y: int. colors: Iterable an iterable list of int color values in argb. Return bool True if succeed otherwise False. | def SetPixelColorsHorizontally(self, x: int, y: int, colors: Iterable) -> bool:
"""
Set pixel colors form x,y horizontally.
x: int.
y: int.
colors: Iterable, an iterable list of int color values in argb.
Return bool, True if succeed otherwise False.
"""
co... |
x: int. y: int. count: int. Return ctypes. Array an iterable array of int values in argb form point x y vertically. | def GetPixelColorsVertically(self, x: int, y: int, count: int) -> ctypes.Array:
"""
x: int.
y: int.
count: int.
Return `ctypes.Array`, an iterable array of int values in argb form point x,y vertically.
"""
arrayType = ctypes.c_uint32 * count
values = array... |
y: int row index. Return ctypes. Array an iterable array of int values in argb of y row. | def GetPixelColorsOfRow(self, y: int) -> ctypes.Array:
"""
y: int, row index.
Return `ctypes.Array`, an iterable array of int values in argb of y row.
"""
return self.GetPixelColorsOfRect(0, y, self.Width, 1) |
x: int column index. Return ctypes. Array an iterable array of int values in argb of x column. | def GetPixelColorsOfColumn(self, x: int) -> ctypes.Array:
"""
x: int, column index.
Return `ctypes.Array`, an iterable array of int values in argb of x column.
"""
return self.GetPixelColorsOfRect(x, 0, 1, self.Height) |
x: int. y: int. width: int. height: int. Return ctypes. Array an iterable array of int values in argb of the input rect. | def GetPixelColorsOfRect(self, x: int, y: int, width: int, height: int) -> ctypes.Array:
"""
x: int.
y: int.
width: int.
height: int.
Return `ctypes.Array`, an iterable array of int values in argb of the input rect.
"""
arrayType = ctypes.c_uint32 * (width... |
x: int. y: int. width: int. height: int. colors: Iterable an iterable list of int values it s length must equal to width * height. Return ctypes. Array an iterable array of int values in argb of the input rect. | def SetPixelColorsOfRect(self, x: int, y: int, width: int, height: int, colors: Iterable) -> bool:
"""
x: int.
y: int.
width: int.
height: int.
colors: Iterable, an iterable list of int values, it's length must equal to width*height.
Return `ctypes.Array`, an iter... |
rects: a list of rects such as [ ( 0 0 10 10 ) ( 10 10 20 20 ) ( x y width height ) ]. Return list a list whose elements are ctypes. Array which is an iterable array of int values in argb. | def GetPixelColorsOfRects(self, rects: list) -> list:
"""
rects: a list of rects, such as [(0,0,10,10), (10,10,20,20),(x,y,width,height)].
Return list, a list whose elements are ctypes.Array which is an iterable array of int values in argb.
"""
rects2 = [(x, y, x + width, y + hei... |
Return ctypes. Array an iterable array of int values in argb. | def GetAllPixelColors(self) -> ctypes.Array:
"""
Return `ctypes.Array`, an iterable array of int values in argb.
"""
return self.GetPixelColorsOfRect(0, 0, self.Width, self.Height) |
x: int. y: int. width: int. height: int. Return Bitmap a sub bitmap of the input rect. | def GetSubBitmap(self, x: int, y: int, width: int, height: int) -> 'Bitmap':
"""
x: int.
y: int.
width: int.
height: int.
Return `Bitmap`, a sub bitmap of the input rect.
"""
colors = self.GetPixelColorsOfRect(x, y, width, height)
bitmap = Bitmap(w... |
Call IUIAutomationCustomNavigationPattern:: Navigate. Get the next control in the specified direction within the logical UI tree. direction: int a value in class NavigateDirection. Return Control subclass or None. Refer https:// docs. microsoft. com/ en - us/ windows/ desktop/ api/ uiautomationclient/ nf - uiautomation... | def Navigate(self, direction: int) -> 'Control':
"""
Call IUIAutomationCustomNavigationPattern::Navigate.
Get the next control in the specified direction within the logical UI tree.
direction: int, a value in class `NavigateDirection`.
Return `Control` subclass or None.
R... |
Call IUIAutomationDockPattern:: SetDockPosition. dockPosition: int a value in class DockPosition. waitTime: float. Refer https:// docs. microsoft. com/ en - us/ windows/ desktop/ api/ uiautomationclient/ nf - uiautomationclient - iuiautomationdockpattern - setdockposition | def SetDockPosition(self, dockPosition: int, waitTime: float = OPERATION_WAIT_TIME) -> int:
"""
Call IUIAutomationDockPattern::SetDockPosition.
dockPosition: int, a value in class `DockPosition`.
waitTime: float.
Refer https://docs.microsoft.com/en-us/windows/desktop/api/uiautoma... |
Call IUIAutomationDragPattern:: GetCurrentGrabbedItems. Return list a list of Control subclasses that represent the full set of items that the user is dragging as part of a drag operation. Refer https:// docs. microsoft. com/ en - us/ windows/ desktop/ api/ uiautomationclient/ nf - uiautomationclient - iuiautomationdra... | def GetGrabbedItems(self) -> list:
"""
Call IUIAutomationDragPattern::GetCurrentGrabbedItems.
Return list, a list of `Control` subclasses that represent the full set of items
that the user is dragging as part of a drag operation.
Refer https://docs.microsoft.com/en-u... |
Call IUIAutomationExpandCollapsePattern:: Expand. waitTime: float. Return bool True if succeed otherwise False. Refer https:// docs. microsoft. com/ en - us/ windows/ desktop/ api/ uiautomationclient/ nf - uiautomationclient - iuiautomationexpandcollapsepattern - collapse | def Expand(self, waitTime: float = OPERATION_WAIT_TIME) -> bool:
"""
Call IUIAutomationExpandCollapsePattern::Expand.
waitTime: float.
Return bool, True if succeed otherwise False.
Refer https://docs.microsoft.com/en-us/windows/desktop/api/uiautomationclient/nf-uiautomationclient... |
Call IUIAutomationItemContainerPattern:: FindItemByProperty. control: Control or its subclass. propertyValue: COM VARIANT according to propertyId? todo. propertyId: int a value in class PropertyId. Return Control subclass a control within a containing element based on a specified property value. Refer https:// docs. mi... | def FindItemByProperty(control: 'Control', propertyId: int, propertyValue) -> 'Control':
"""
Call IUIAutomationItemContainerPattern::FindItemByProperty.
control: `Control` or its subclass.
propertyValue: COM VARIANT according to propertyId? todo.
propertyId: int, a value in class... |
Call IUIAutomationLegacyIAccessiblePattern:: GetCurrentSelection. Return list a list of Control subclasses the Microsoft Active Accessibility property that identifies the selected children of this element. Refer https:// docs. microsoft. com/ en - us/ windows/ desktop/ api/ uiautomationclient/ nf - uiautomationclient -... | def GetSelection(self) -> list:
"""
Call IUIAutomationLegacyIAccessiblePattern::GetCurrentSelection.
Return list, a list of `Control` subclasses,
the Microsoft Active Accessibility property that identifies the selected children of this element.
Refer https://docs.mic... |
Call IUIAutomationLegacyIAccessiblePattern:: SetValue. Set the Microsoft Active Accessibility value property for the element. value: str. waitTime: float. Return bool True if succeed otherwise False. Refer https:// docs. microsoft. com/ en - us/ windows/ desktop/ api/ uiautomationclient/ nf - uiautomationclient - iuiau... | def SetValue(self, value: str, waitTime: float = OPERATION_WAIT_TIME) -> bool:
"""
Call IUIAutomationLegacyIAccessiblePattern::SetValue.
Set the Microsoft Active Accessibility value property for the element.
value: str.
waitTime: float.
Return bool, True if succeed otherw... |
Call IUIAutomationMultipleViewPattern:: SetCurrentView. Set the view of the control. view: int the control - specific view identifier. Return bool True if succeed otherwise False. Refer https:// docs. microsoft. com/ en - us/ windows/ desktop/ api/ uiautomationclient/ nf - uiautomationclient - iuiautomationmultipleview... | def SetView(self, view: int) -> bool:
"""
Call IUIAutomationMultipleViewPattern::SetCurrentView.
Set the view of the control.
view: int, the control-specific view identifier.
Return bool, True if succeed otherwise False.
Refer https://docs.microsoft.com/en-us/windows/desk... |
Call IUIAutomationScrollPattern:: Scroll. Scroll the visible region of the content area horizontally and vertically. horizontalAmount: int a value in ScrollAmount. verticalAmount: int a value in ScrollAmount. waitTime: float. Return bool True if succeed otherwise False. Refer https:// docs. microsoft. com/ en - us/ win... | def Scroll(self, horizontalAmount: int, verticalAmount: int, waitTime: float = OPERATION_WAIT_TIME) -> bool:
"""
Call IUIAutomationScrollPattern::Scroll.
Scroll the visible region of the content area horizontally and vertically.
horizontalAmount: int, a value in ScrollAmount.
ver... |
Call IUIAutomationScrollPattern:: SetScrollPercent. Set the horizontal and vertical scroll positions as a percentage of the total content area within the UI Automation element. horizontalPercent: float or int a value in [ 0 100 ] or ScrollPattern. NoScrollValue ( - 1 ) if no scroll. verticalPercent: float or int a valu... | def SetScrollPercent(self, horizontalPercent: float, verticalPercent: float, waitTime: float = OPERATION_WAIT_TIME) -> bool:
"""
Call IUIAutomationScrollPattern::SetScrollPercent.
Set the horizontal and vertical scroll positions as a percentage of the total content area within the UI Automation ... |
Call IUIAutomationSelectionPattern:: GetCurrentAnnotationObjects. Return list a list of Control subclasses representing the annotations associated with this spreadsheet cell. Refer https:// docs. microsoft. com/ en - us/ windows/ desktop/ api/ uiautomationclient/ nf - uiautomationclient - iuiautomationspreadsheetitempa... | def GetAnnotationObjects(self) -> list:
"""
Call IUIAutomationSelectionPattern::GetCurrentAnnotationObjects.
Return list, a list of `Control` subclasses representing the annotations associated with this spreadsheet cell.
Refer https://docs.microsoft.com/en-us/windows/desktop/api/uiautoma... |
Call IUIAutomationSpreadsheetPattern:: GetItemByName. name: str. Return Control subclass or None represents the spreadsheet cell that has the specified name.. Refer https:// docs. microsoft. com/ en - us/ windows/ desktop/ api/ uiautomationclient/ nf - uiautomationclient - iuiautomationspreadsheetpattern - getitembynam... | def GetItemByName(self, name: str) -> 'Control':
"""
Call IUIAutomationSpreadsheetPattern::GetItemByName.
name: str.
Return `Control` subclass or None, represents the spreadsheet cell that has the specified name..
Refer https://docs.microsoft.com/en-us/windows/desktop/api/uiautom... |
Call IUIAutomationTableItemPattern:: GetCurrentColumnHeaderItems. Return list a list of Control subclasses the column headers associated with a table item or cell. Refer https:// docs. microsoft. com/ en - us/ windows/ desktop/ api/ uiautomationclient/ nf - uiautomationclient - iuiautomationtableitempattern - getcurren... | def GetColumnHeaderItems(self) -> list:
"""
Call IUIAutomationTableItemPattern::GetCurrentColumnHeaderItems.
Return list, a list of `Control` subclasses, the column headers associated with a table item or cell.
Refer https://docs.microsoft.com/en-us/windows/desktop/api/uiautomationclient... |
Call IUIAutomationTableItemPattern:: GetCurrentRowHeaderItems. Return list a list of Control subclasses the row headers associated with a table item or cell. Refer https:// docs. microsoft. com/ en - us/ windows/ desktop/ api/ uiautomationclient/ nf - uiautomationclient - iuiautomationtableitempattern - getcurrentrowhe... | def GetRowHeaderItems(self) -> list:
"""
Call IUIAutomationTableItemPattern::GetCurrentRowHeaderItems.
Return list, a list of `Control` subclasses, the row headers associated with a table item or cell.
Refer https://docs.microsoft.com/en-us/windows/desktop/api/uiautomationclient/nf-uiaut... |
Call IUIAutomationTablePattern:: GetCurrentColumnHeaders. Return list a list of Control subclasses representing all the column headers in a table.. Refer https:// docs. microsoft. com/ en - us/ windows/ desktop/ api/ uiautomationclient/ nf - uiautomationclient - iuiautomationtablepattern - getcurrentcolumnheaders | def GetColumnHeaders(self) -> list:
"""
Call IUIAutomationTablePattern::GetCurrentColumnHeaders.
Return list, a list of `Control` subclasses, representing all the column headers in a table..
Refer https://docs.microsoft.com/en-us/windows/desktop/api/uiautomationclient/nf-uiautomationclie... |
Call IUIAutomationTablePattern:: GetCurrentRowHeaders. Return list a list of Control subclasses representing all the row headers in a table. Refer https:// docs. microsoft. com/ en - us/ windows/ desktop/ api/ uiautomationclient/ nf - uiautomationclient - iuiautomationtablepattern - getcurrentrowheaders | def GetRowHeaders(self) -> list:
"""
Call IUIAutomationTablePattern::GetCurrentRowHeaders.
Return list, a list of `Control` subclasses, representing all the row headers in a table.
Refer https://docs.microsoft.com/en-us/windows/desktop/api/uiautomationclient/nf-uiautomationclient-iuiauto... |
Call IUIAutomationTextRange:: Compare. textRange: TextRange. Return bool specifies whether this text range has the same endpoints as another text range. Refer https:// docs. microsoft. com/ en - us/ windows/ desktop/ api/ uiautomationclient/ nf - uiautomationclient - iuiautomationtextrange - compare | def Compare(self, textRange: 'TextRange') -> bool:
"""
Call IUIAutomationTextRange::Compare.
textRange: `TextRange`.
Return bool, specifies whether this text range has the same endpoints as another text range.
Refer https://docs.microsoft.com/en-us/windows/desktop/api/uiautomatio... |
Call IUIAutomationTextRange:: CompareEndpoints. srcEndPoint: int a value in class TextPatternRangeEndpoint. textRange: TextRange. targetEndPoint: int a value in class TextPatternRangeEndpoint. Return int a negative value if the caller s endpoint occurs earlier in the text than the target endpoint ; 0 if the caller s en... | def CompareEndpoints(self, srcEndPoint: int, textRange: 'TextRange', targetEndPoint: int) -> int:
"""
Call IUIAutomationTextRange::CompareEndpoints.
srcEndPoint: int, a value in class `TextPatternRangeEndpoint`.
textRange: `TextRange`.
targetEndPoint: int, a value in class `TextP... |
Call IUIAutomationTextRange:: FindAttribute. textAttributeID: int a value in class TextAttributeId. val: COM VARIANT according to textAttributeId? todo. backward: bool True if the last occurring text range should be returned instead of the first ; otherwise False. return TextRange or None a text range subset that has t... | def FindAttribute(self, textAttributeId: int, val, backward: bool) -> 'TextRange':
"""
Call IUIAutomationTextRange::FindAttribute.
textAttributeID: int, a value in class `TextAttributeId`.
val: COM VARIANT according to textAttributeId? todo.
backward: bool, True if the last occur... |
Call IUIAutomationTextRange:: FindText. text: str backward: bool True if the last occurring text range should be returned instead of the first ; otherwise False. ignoreCase: bool True if case should be ignored ; otherwise False. return TextRange or None a text range subset that contains the specified text. Refer https:... | def FindText(self, text: str, backward: bool, ignoreCase: bool) -> 'TextRange':
"""
Call IUIAutomationTextRange::FindText.
text: str,
backward: bool, True if the last occurring text range should be returned instead of the first; otherwise False.
ignoreCase: bool, True if case sho... |
Call IUIAutomationTextRange:: GetAttributeValue. textAttributeId: int a value in class TextAttributeId. Return ctypes. POINTER ( comtypes. IUnknown ) or None the value of the specified text attribute across the entire text range todo. Refer https:// docs. microsoft. com/ en - us/ windows/ desktop/ api/ uiautomationclie... | def GetAttributeValue(self, textAttributeId: int) -> ctypes.POINTER(comtypes.IUnknown):
"""
Call IUIAutomationTextRange::GetAttributeValue.
textAttributeId: int, a value in class `TextAttributeId`.
Return `ctypes.POINTER(comtypes.IUnknown)` or None, the value of the specified text attrib... |
Call IUIAutomationTextRange:: GetBoundingRectangles. textAttributeId: int a value in class TextAttributeId. Return list a list of Rect. bounding rectangles for each fully or partially visible line of text in a text range.. Refer https:// docs. microsoft. com/ en - us/ windows/ desktop/ api/ uiautomationclient/ nf - uia... | def GetBoundingRectangles(self) -> list:
"""
Call IUIAutomationTextRange::GetBoundingRectangles.
textAttributeId: int, a value in class `TextAttributeId`.
Return list, a list of `Rect`.
bounding rectangles for each fully or partially visible line of text in a text range..
... |
Call IUIAutomationTextRange:: GetChildren. textAttributeId: int a value in class TextAttributeId. Return list a list of Control subclasses embedded objects that fall within the text range.. Refer https:// docs. microsoft. com/ en - us/ windows/ desktop/ api/ uiautomationclient/ nf - uiautomationclient - iuiautomationte... | def GetChildren(self) -> list:
"""
Call IUIAutomationTextRange::GetChildren.
textAttributeId: int, a value in class `TextAttributeId`.
Return list, a list of `Control` subclasses, embedded objects that fall within the text range..
Refer https://docs.microsoft.com/en-us/windows/de... |
Call IUIAutomationTextRange:: Move. Move the text range forward or backward by the specified number of text units. unit: int a value in class TextUnit. count: int the number of text units to move. A positive value moves the text range forward. A negative value moves the text range backward. Zero has no effect. waitTime... | def Move(self, unit: int, count: int, waitTime: float = OPERATION_WAIT_TIME) -> int:
"""
Call IUIAutomationTextRange::Move.
Move the text range forward or backward by the specified number of text units.
unit: int, a value in class `TextUnit`.
count: int, the number of text units ... |
Call IUIAutomationTextRange:: MoveEndpointByRange. Move one endpoint of the current text range to the specified endpoint of a second text range. srcEndPoint: int a value in class TextPatternRangeEndpoint. textRange: TextRange. targetEndPoint: int a value in class TextPatternRangeEndpoint. waitTime: float. Return bool T... | def MoveEndpointByRange(self, srcEndPoint: int, textRange: 'TextRange', targetEndPoint: int, waitTime: float = OPERATION_WAIT_TIME) -> bool:
"""
Call IUIAutomationTextRange::MoveEndpointByRange.
Move one endpoint of the current text range to the specified endpoint of a second text range.
... |
Call IUIAutomationTextRange:: MoveEndpointByUnit. Move one endpoint of the text range the specified number of text units within the document range. endPoint: int a value in class TextPatternRangeEndpoint. unit: int a value in class TextUnit. count: int the number of units to move. A positive count moves the endpoint fo... | def MoveEndpointByUnit(self, endPoint: int, unit: int, count: int, waitTime: float = OPERATION_WAIT_TIME) -> int:
"""
Call IUIAutomationTextRange::MoveEndpointByUnit.
Move one endpoint of the text range the specified number of text units within the document range.
endPoint: int, a value ... |
Call IUIAutomationTextRange:: ScrollIntoView. Cause the text control to scroll until the text range is visible in the viewport. alignTop: bool True if the text control should be scrolled so that the text range is flush with the top of the viewport ; False if it should be flush with the bottom of the viewport. waitTime:... | def ScrollIntoView(self, alignTop: bool = True, waitTime: float = OPERATION_WAIT_TIME) -> bool:
"""
Call IUIAutomationTextRange::ScrollIntoView.
Cause the text control to scroll until the text range is visible in the viewport.
alignTop: bool, True if the text control should be scrolled s... |
Call IUIAutomationTextEditPattern:: GetActiveComposition. Return TextRange or None the active composition. Refer https:// docs. microsoft. com/ en - us/ windows/ desktop/ api/ uiautomationclient/ nf - uiautomationclient - iuiautomationtexteditpattern - getactivecomposition | def GetActiveComposition(self) -> TextRange:
"""
Call IUIAutomationTextEditPattern::GetActiveComposition.
Return `TextRange` or None, the active composition.
Refer https://docs.microsoft.com/en-us/windows/desktop/api/uiautomationclient/nf-uiautomationclient-iuiautomationtexteditpattern-g... |
Call IUIAutomationTextEditPattern:: GetConversionTarget. Return TextRange or None the current conversion target range.. Refer https:// docs. microsoft. com/ en - us/ windows/ desktop/ api/ uiautomationclient/ nf - uiautomationclient - iuiautomationtexteditpattern - getconversiontarget | def GetConversionTarget(self) -> TextRange:
"""
Call IUIAutomationTextEditPattern::GetConversionTarget.
Return `TextRange` or None, the current conversion target range..
Refer https://docs.microsoft.com/en-us/windows/desktop/api/uiautomationclient/nf-uiautomationclient-iuiautomationtexte... |
Call IUIAutomationTextPattern:: GetVisibleRanges. Return list a list of TextRange disjoint text ranges from a text - based control where each text range represents a contiguous span of visible text. Refer https:// docs. microsoft. com/ en - us/ windows/ desktop/ api/ uiautomationclient/ nf - uiautomationclient - iuiaut... | def GetVisibleRanges(self) -> list:
"""
Call IUIAutomationTextPattern::GetVisibleRanges.
Return list, a list of `TextRange`, disjoint text ranges from a text-based control
where each text range represents a contiguous span of visible text.
Refer https://docs.microsof... |
Call IUIAutomationTextPattern:: RangeFromChild. child: Control or its subclass. Return TextRange or None a text range enclosing a child element such as an image hyperlink Microsoft Excel spreadsheet or other embedded object. Refer https:// docs. microsoft. com/ en - us/ windows/ desktop/ api/ uiautomationclient/ nf - u... | def RangeFromChild(self, child) -> TextRange:
"""
Call IUIAutomationTextPattern::RangeFromChild.
child: `Control` or its subclass.
Return `TextRange` or None, a text range enclosing a child element such as an image,
hyperlink, Microsoft Excel spreadsheet, or other embedded ob... |
Call IUIAutomationTextPattern:: RangeFromPoint. child: Control or its subclass. Return TextRange or None the degenerate ( empty ) text range nearest to the specified screen coordinates. Refer https:// docs. microsoft. com/ en - us/ windows/ desktop/ api/ uiautomationclient/ nf - uiautomationclient - iuiautomationtextpa... | def RangeFromPoint(self, x: int, y: int) -> TextRange:
"""
Call IUIAutomationTextPattern::RangeFromPoint.
child: `Control` or its subclass.
Return `TextRange` or None, the degenerate (empty) text range nearest to the specified screen coordinates.
Refer https://docs.microsoft.com/... |
Call IUIAutomationTransformPattern:: Move. Move the UI Automation element. x: int. y: int. waitTime: float. Return bool True if succeed otherwise False. Refer https:// docs. microsoft. com/ en - us/ windows/ desktop/ api/ uiautomationclient/ nf - uiautomationclient - iuiautomationtransformpattern - move | def Move(self, x: int, y: int, waitTime: float = OPERATION_WAIT_TIME) -> bool:
"""
Call IUIAutomationTransformPattern::Move.
Move the UI Automation element.
x: int.
y: int.
waitTime: float.
Return bool, True if succeed otherwise False.
Refer https://docs.m... |
Call IUIAutomationTransformPattern:: Resize. Resize the UI Automation element. width: int. height: int. waitTime: float. Return bool True if succeed otherwise False. Refer https:// docs. microsoft. com/ en - us/ windows/ desktop/ api/ uiautomationclient/ nf - uiautomationclient - iuiautomationtransformpattern - resize | def Resize(self, width: int, height: int, waitTime: float = OPERATION_WAIT_TIME) -> bool:
"""
Call IUIAutomationTransformPattern::Resize.
Resize the UI Automation element.
width: int.
height: int.
waitTime: float.
Return bool, True if succeed otherwise False.
... |
Call IUIAutomationTransformPattern:: Rotate. Rotates the UI Automation element. degrees: int. waitTime: float. Return bool True if succeed otherwise False. Refer https:// docs. microsoft. com/ en - us/ windows/ desktop/ api/ uiautomationclient/ nf - uiautomationclient - iuiautomationtransformpattern - rotate | def Rotate(self, degrees: int, waitTime: float = OPERATION_WAIT_TIME) -> bool:
"""
Call IUIAutomationTransformPattern::Rotate.
Rotates the UI Automation element.
degrees: int.
waitTime: float.
Return bool, True if succeed otherwise False.
Refer https://docs.micros... |
Call IUIAutomationTransformPattern2:: Zoom. Zoom the viewport of the control. zoomLevel: float for int. waitTime: float. Return bool True if succeed otherwise False. Refer https:// docs. microsoft. com/ en - us/ windows/ desktop/ api/ uiautomationclient/ nf - uiautomationclient - iuiautomationtransformpattern2 - zoom | def Zoom(self, zoomLevel: float, waitTime: float = OPERATION_WAIT_TIME) -> bool:
"""
Call IUIAutomationTransformPattern2::Zoom.
Zoom the viewport of the control.
zoomLevel: float for int.
waitTime: float.
Return bool, True if succeed otherwise False.
Refer https:/... |
Call IUIAutomationTransformPattern2:: ZoomByUnit. Zoom the viewport of the control by the specified unit. zoomUnit: int a value in class ZoomUnit. waitTime: float. Return bool True if succeed otherwise False. Refer https:// docs. microsoft. com/ en - us/ windows/ desktop/ api/ uiautomationclient/ nf - uiautomationclien... | def ZoomByUnit(self, zoomUnit: int, waitTime: float = OPERATION_WAIT_TIME) -> bool:
"""
Call IUIAutomationTransformPattern2::ZoomByUnit.
Zoom the viewport of the control by the specified unit.
zoomUnit: int, a value in class `ZoomUnit`.
waitTime: float.
Return bool, True ... |
Call IUIAutomationWindowPattern:: SetWindowVisualState. Minimize maximize or restore the window. state: int a value in class WindowVisualState. waitTime: float. Return bool True if succeed otherwise False. Refer https:// docs. microsoft. com/ en - us/ windows/ desktop/ api/ uiautomationclient/ nf - uiautomationclient -... | def SetWindowVisualState(self, state: int, waitTime: float = OPERATION_WAIT_TIME) -> bool:
"""
Call IUIAutomationWindowPattern::SetWindowVisualState.
Minimize, maximize, or restore the window.
state: int, a value in class `WindowVisualState`.
waitTime: float.
Return bool,... |
Call IUIAutomationWindowPattern:: WaitForInputIdle. Cause the calling code to block for the specified time or until the associated process enters an idle state whichever completes first. milliseconds: int. Return bool True if succeed otherwise False. Refer https:// docs. microsoft. com/ en - us/ windows/ desktop/ api/ ... | def WaitForInputIdle(self, milliseconds: int) -> bool:
'''
Call IUIAutomationWindowPattern::WaitForInputIdle.
Cause the calling code to block for the specified time or
until the associated process enters an idle state, whichever completes first.
milliseconds: int.
Ret... |
Create a concreate Control from a com type IUIAutomationElement. element: ctypes. POINTER ( IUIAutomationElement ). Return a subclass of Control an instance of the control s real type. | def CreateControlFromElement(element) -> 'Control':
"""
Create a concreate `Control` from a com type `IUIAutomationElement`.
element: `ctypes.POINTER(IUIAutomationElement)`.
Return a subclass of `Control`, an instance of the control's real type.
"""
if element:
... |
Add search properties using dict. update. searchProperties: dict same as searchProperties in Control. __init__. | def AddSearchProperties(self, **searchProperties) -> None:
"""
Add search properties using `dict.update`.
searchProperties: dict, same as searchProperties in `Control.__init__`.
"""
self.searchProperties.update(searchProperties)
if 'Depth' in searchProperties:
... |
searchProperties: dict same as searchProperties in Control. __init__. | def RemoveSearchProperties(self, **searchProperties) -> None:
"""
searchProperties: dict, same as searchProperties in `Control.__init__`.
"""
for key in searchProperties:
del self.searchProperties[key]
if key == 'RegexName':
self.regexName = None |
keyColor valueColor: str color name in class ConsoleColor | def GetColorfulSearchPropertiesStr(self, keyColor='DarkGreen', valueColor='DarkCyan') -> str:
"""keyColor, valueColor: str, color name in class ConsoleColor"""
strs = ['<Color={}>{}</Color>: <Color={}>{}</Color>'.format(keyColor if k in Control.ValidKeys else 'DarkYellow', k, valueColor,
... |
Property BoundingRectangle. Call IUIAutomationElement:: get_CurrentBoundingRectangle. Return Rect. Refer https:// docs. microsoft. com/ en - us/ windows/ desktop/ api/ uiautomationclient/ nf - uiautomationclient - iuiautomationelement - get_currentboundingrectangle | def BoundingRectangle(self) -> Rect:
"""
Property BoundingRectangle.
Call IUIAutomationElement::get_CurrentBoundingRectangle.
Return `Rect`.
Refer https://docs.microsoft.com/en-us/windows/desktop/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentboundin... |
Call IUIAutomationElement:: GetClickablePoint. Return tuple ( x: int y: int gotClickable: bool ) like ( 20 10 True ) Refer https:// docs. microsoft. com/ en - us/ windows/ desktop/ api/ uiautomationclient/ nf - uiautomationclient - iuiautomationelement - getclickablepoint | def GetClickablePoint(self) -> tuple:
"""
Call IUIAutomationElement::GetClickablePoint.
Return tuple, (x: int, y: int, gotClickable: bool), like (20, 10, True)
Refer https://docs.microsoft.com/en-us/windows/desktop/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getclic... |
Call IUIAutomationElement:: GetCurrentPattern. Get a new pattern by pattern id if it supports the pattern. patternId: int a value in class PatternId. Refer https:// docs. microsoft. com/ en - us/ windows/ desktop/ api/ uiautomationclient/ nf - uiautomationclient - iuiautomationelement - getcurrentpattern | def GetPattern(self, patternId: int):
"""
Call IUIAutomationElement::GetCurrentPattern.
Get a new pattern by pattern id if it supports the pattern.
patternId: int, a value in class `PatternId`.
Refer https://docs.microsoft.com/en-us/windows/desktop/api/uiautomationclient/nf-uiaut... |
Call IUIAutomationElement:: GetCurrentPatternAs. Get a new pattern by pattern id if it supports the pattern todo. patternId: int a value in class PatternId. riid: GUID. Refer https:// docs. microsoft. com/ en - us/ windows/ desktop/ api/ uiautomationclient/ nf - uiautomationclient - iuiautomationelement - getcurrentpat... | def GetPatternAs(self, patternId: int, riid):
"""
Call IUIAutomationElement::GetCurrentPatternAs.
Get a new pattern by pattern id if it supports the pattern, todo.
patternId: int, a value in class `PatternId`.
riid: GUID.
Refer https://docs.microsoft.com/en-us/windows/des... |
Call IUIAutomationElement:: GetCurrentPropertyValueEx. propertyId: int a value in class PropertyId. ignoreDefaultValue: int 0 or 1. Return Any corresponding type according to propertyId. Refer https:// docs. microsoft. com/ en - us/ windows/ desktop/ api/ uiautomationclient/ nf - uiautomationclient - iuiautomationeleme... | def GetPropertyValueEx(self, propertyId: int, ignoreDefaultValue: int) -> Any:
"""
Call IUIAutomationElement::GetCurrentPropertyValueEx.
propertyId: int, a value in class `PropertyId`.
ignoreDefaultValue: int, 0 or 1.
Return Any, corresponding type according to propertyId.
... |
Property Element. Return ctypes. POINTER ( IUIAutomationElement ). | def Element(self):
"""
Property Element.
Return `ctypes.POINTER(IUIAutomationElement)`.
"""
if not self._element:
self.Refind(maxSearchSeconds=TIME_OUT_SECOND, searchIntervalSeconds=self.searchWaitTime)
return self._element |
Get a pattern by patternId. patternId: int a value in class PatternId. Return a pattern if it supports the pattern else None. cache: bool if True store the pattern for later use if False get a new pattern by self. GetPattern. | def GetCachedPattern(self, patternId: int, cache: bool):
"""
Get a pattern by patternId.
patternId: int, a value in class `PatternId`.
Return a pattern if it supports the pattern else None.
cache: bool, if True, store the pattern for later use, if False, get a new pattern by `sel... |
Get a ancestor control that matches the condition. condition: Callable function ( control: Control depth: int ) - > bool depth starts with - 1 and decreses when search goes up. Return Control subclass or None. | def GetAncestorControl(self, condition: Callable) -> 'Control':
"""
Get a ancestor control that matches the condition.
condition: Callable, function (control: Control, depth: int)->bool,
depth starts with -1 and decreses when search goes up.
Return `Control` subclass o... |
Return Control subclass or None. | def GetParentControl(self) -> 'Control':
"""
Return `Control` subclass or None.
"""
ele = _AutomationClient.instance().ViewWalker.GetParentElement(self.Element)
return Control.CreateControlFromElement(ele) |
Return Control subclass or None. | def GetFirstChildControl(self) -> 'Control':
"""
Return `Control` subclass or None.
"""
ele = _AutomationClient.instance().ViewWalker.GetFirstChildElement(self.Element)
return Control.CreateControlFromElement(ele) |
Return Control subclass or None. | def GetLastChildControl(self) -> 'Control':
"""
Return `Control` subclass or None.
"""
ele = _AutomationClient.instance().ViewWalker.GetLastChildElement(self.Element)
return Control.CreateControlFromElement(ele) |
Return Control subclass or None. | def GetNextSiblingControl(self) -> 'Control':
"""
Return `Control` subclass or None.
"""
ele = _AutomationClient.instance().ViewWalker.GetNextSiblingElement(self.Element)
return Control.CreateControlFromElement(ele) |
Return Control subclass or None. | def GetPreviousSiblingControl(self) -> 'Control':
"""
Return `Control` subclass or None.
"""
ele = _AutomationClient.instance().ViewWalker.GetPreviousSiblingElement(self.Element)
return Control.CreateControlFromElement(ele) |
Find a SiblingControl by condition ( control: Control ) - > bool. forward: bool if True only search next siblings if False search pervious siblings first then search next siblings. condition: Callable function ( control: Control ) - > bool. Return Control subclass or None. | def GetSiblingControl(self, condition: Callable, forward: bool = True) -> 'Control':
"""
Find a SiblingControl by condition(control: Control)->bool.
forward: bool, if True, only search next siblings, if False, search pervious siblings first, then search next siblings.
condition: Callable... |
Return list a list of Control subclasses. | def GetChildren(self) -> list:
"""
Return list, a list of `Control` subclasses.
"""
children = []
child = self.GetFirstChildControl()
while child:
children.append(child)
child = child.GetNextSiblingControl()
return children |
Define how to search. control: Control or its subclass. depth: int tree depth from searchFromControl. Return bool. | def _CompareFunction(self, control: 'Control', depth: int) -> bool:
"""
Define how to search.
control: `Control` or its subclass.
depth: int, tree depth from searchFromControl.
Return bool.
"""
for key, value in self.searchProperties.items():
if 'Contr... |
maxSearchSeconds: float searchIntervalSeconds: float Find control every searchIntervalSeconds seconds in maxSearchSeconds seconds. Return bool True if find | def Exists(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = SEARCH_INTERVAL, printIfNotExist: bool = False) -> bool:
"""
maxSearchSeconds: float
searchIntervalSeconds: float
Find control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool... |
maxSearchSeconds: float searchIntervalSeconds: float Check if control disappears every searchIntervalSeconds seconds in maxSearchSeconds seconds. Return bool True if control disappears. | def Disappears(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = SEARCH_INTERVAL, printIfNotDisappear: bool = False) -> bool:
"""
maxSearchSeconds: float
searchIntervalSeconds: float
Check if control disappears every searchIntervalSeconds seconds in maxSearchSeconds secon... |
Refind the control every searchIntervalSeconds seconds in maxSearchSeconds seconds. maxSearchSeconds: float. searchIntervalSeconds: float. raiseException: bool if True raise a LookupError if timeout. Return bool True if find. | def Refind(self, maxSearchSeconds: float = TIME_OUT_SECOND, searchIntervalSeconds: float = SEARCH_INTERVAL, raiseException: bool = True) -> bool:
"""
Refind the control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
maxSearchSeconds: float.
searchIntervalSeconds: float.... |
Move cursor to control s internal position default to center. x: int if < 0 move to self. BoundingRectangle. right + x if not None ignore ratioX. y: int if < 0 move to self. BoundingRectangle. bottom + y if not None ignore ratioY. ratioX: float. ratioY: float. simulateMove: bool. Return tuple two ints ( x y ) the curso... | def MoveCursorToInnerPos(self, x: int = None, y: int = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True) -> tuple:
"""
Move cursor to control's internal position, default to center.
x: int, if < 0, move to self.BoundingRectangle.right + x, if not None, ignore ratioX.
... |
Move cursor to control s center. Return tuple two ints tuple ( x y ) the cursor positon relative to screen ( 0 0 ) after moving. | def MoveCursorToMyCenter(self, simulateMove: bool = True) -> tuple:
"""
Move cursor to control's center.
Return tuple, two ints tuple(x,y), the cursor positon relative to screen(0,0) after moving .
"""
return self.MoveCursorToInnerPos(simulateMove=simulateMove) |
x: int if < 0 click self. BoundingRectangle. right + x if not None ignore ratioX. y: int if < 0 click self. BoundingRectangle. bottom + y if not None ignore ratioY. ratioX: float. ratioY: float. simulateMove: bool if True first move cursor to control smoothly. waitTime: float. | def Click(self, x: int = None, y: int = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = OPERATION_WAIT_TIME) -> None:
"""
x: int, if < 0, click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, click self.BoundingRectangle.... |
x: int if < 0 right click self. BoundingRectangle. right + x if not None ignore ratioX. y: int if < 0 right click self. BoundingRectangle. bottom + y if not None ignore ratioY. ratioX: float. ratioY: float. simulateMove: bool if True first move cursor to control smoothly. waitTime: float. | def DoubleClick(self, x: int = None, y: int = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = OPERATION_WAIT_TIME) -> None:
"""
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.... |
Make control have focus first move cursor to center and mouse wheel down. wheelTimes: int. interval: float. waitTime: float. | def WheelDown(self, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = OPERATION_WAIT_TIME) -> None:
"""
Make control have focus first, move cursor to center and mouse wheel down.
wheelTimes: int.
interval: float.
waitTime: float.
"""
x, y = GetCursorP... |
Get a native handle from self or ancestors until valid and call native ShowWindow with cmdShow. cmdShow: int a value in in class SW. waitTime: float. Return bool True if succeed otherwise False. | def ShowWindow(self, cmdShow: int, waitTime: float = OPERATION_WAIT_TIME) -> bool:
"""
Get a native handle from self or ancestors until valid and call native `ShowWindow` with cmdShow.
cmdShow: int, a value in in class `SW`.
waitTime: float.
Return bool, True if succeed otherwise... |
Call native ShowWindow ( SW. Show ). Return bool True if succeed otherwise False. | def Show(self, waitTime: float = OPERATION_WAIT_TIME) -> bool:
"""
Call native `ShowWindow(SW.Show)`.
Return bool, True if succeed otherwise False.
"""
return self.ShowWindow(SW.Show, waitTime) |
Call native ShowWindow ( SW. Hide ). waitTime: float Return bool True if succeed otherwise False. | def Hide(self, waitTime: float = OPERATION_WAIT_TIME) -> bool:
"""
Call native `ShowWindow(SW.Hide)`.
waitTime: float
Return bool, True if succeed otherwise False.
"""
return self.ShowWindow(SW.Hide, waitTime) |
Call native MoveWindow if control has a valid native handle. x: int. y: int. width: int. height: int. repaint: bool. Return bool True if succeed otherwise False. | def MoveWindow(self, x: int, y: int, width: int, height: int, repaint: bool = True) -> bool:
"""
Call native MoveWindow if control has a valid native handle.
x: int.
y: int.
width: int.
height: int.
repaint: bool.
Return bool, True if succeed otherwise Fal... |
Call native SetWindowText if control has a valid native handle. | def SetWindowText(self, text: str) -> bool:
"""
Call native SetWindowText if control has a valid native handle.
"""
handle = self.NativeWindowHandle
if handle:
return SetWindowText(handle, text)
return False |
Make control have focus first and type a key. self. SetFocus may not work for some controls you may need to click it to make it have focus. key: int a key code value in class Keys. waitTime: float. | def SendKey(self, key: int, waitTime: float = OPERATION_WAIT_TIME) -> None:
"""
Make control have focus first and type a key.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
key: int, a key code value in class Keys.
waitTime: float.... |
Make control have focus first and type keys. self. SetFocus may not work for some controls you may need to click it to make it have focus. keys: str keys to type see the docstring of SendKeys. interval: float seconds between keys. | def SendKeys(self, keys: str, interval: float = 0.01, waitTime: float = OPERATION_WAIT_TIME) -> None:
"""
Make control have focus first and type keys.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
keys: str, keys to type, see the docstrin... |
Call native GetPixelColor if control has a valid native handle. Use self. ToBitmap if control doesn t have a valid native handle or you get many pixels. x: int internal x position. y: int internal y position. Return int a color value in bgr. r = bgr & 0x0000FF g = ( bgr & 0x00FF00 ) >> 8 b = ( bgr & 0xFF0000 ) >> 16 | def GetPixelColor(self, x: int, y: int) -> int:
"""
Call native `GetPixelColor` if control has a valid native handle.
Use `self.ToBitmap` if control doesn't have a valid native handle or you get many pixels.
x: int, internal x position.
y: int, internal y position.
Return... |
Capture control to a Bitmap object. x y: int the point in control s internal position ( from 0 0 ). width height: int image s width and height from x y use 0 for entire area. If width ( or height ) < 0 image size will be control s width ( or height ) - width ( or height ). | def ToBitmap(self, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> Bitmap:
"""
Capture control to a Bitmap object.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
... |
Capture control to a image file. savePath: str should end with. bmp. jpg. jpeg. png. gif. tif. tiff. x y: int the point in control s internal position ( from 0 0 ). width height: int image s width and height from x y use 0 for entire area. If width ( or height ) < 0 image size will be control s width ( or height ) - wi... | def CaptureToImage(self, savePath: str, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> bool:
"""
Capture control to a image file.
savePath: str, should end with .bmp, .jpg, .jpeg, .png, .gif, .tif, .tiff.
x, y: int, the point in control's internal position(from 0,0).
... |
Determine whether current control is top level. | def IsTopLevel(self) -> bool:
"""Determine whether current control is top level."""
handle = self.NativeWindowHandle
if handle:
return GetAncestor(handle, GAFlag.Root) == handle
return False |
Get the top level control which current control lays. If current control is top level return self. If current control is root control return None. Return PaneControl or WindowControl or None. | def GetTopLevelControl(self) -> 'Control':
"""
Get the top level control which current control lays.
If current control is top level, return self.
If current control is root control, return None.
Return `PaneControl` or `WindowControl` or None.
"""
handle = self.N... |
Show combobox s popup menu and select a item by name. itemName: str. condition: Callable function ( comboBoxItemName: str ) - > bool if condition is valid ignore itemName. waitTime: float. Some comboboxs doesn t support SelectionPattern here is a workaround. This method tries to and selection support. It may not work f... | def Select(self, itemName: str = '', condition: Callable = None, waitTime: float = OPERATION_WAIT_TIME) -> bool:
"""
Show combobox's popup menu and select a item by name.
itemName: str.
condition: Callable function(comboBoxItemName: str)->bool, if condition is valid, ignore itemName.
... |
Set top level window topmost. isTopmost: bool. waitTime: float. | def SetTopmost(self, isTopmost: bool = True, waitTime: float = OPERATION_WAIT_TIME) -> bool:
"""
Set top level window topmost.
isTopmost: bool.
waitTime: float.
"""
if self.IsTopLevel():
ret = SetWindowTopmost(self.NativeWindowHandle, isTopmost)
ti... |
Set top level window maximize. | def Maximize(self, waitTime: float = OPERATION_WAIT_TIME) -> bool:
"""
Set top level window maximize.
"""
if self.IsTopLevel():
return self.ShowWindow(SW.ShowMaximized, waitTime)
return False |
Move window to screen center. | def MoveToCenter(self) -> bool:
"""
Move window to screen center.
"""
if self.IsTopLevel():
rect = self.BoundingRectangle
screenWidth, screenHeight = GetScreenSize()
x, y = (screenWidth - rect.width()) // 2, (screenHeight - rect.height()) // 2
... |
Set top level window active. | def SetActive(self, waitTime: float = OPERATION_WAIT_TIME) -> bool:
"""Set top level window active."""
if self.IsTopLevel():
handle = self.NativeWindowHandle
if IsIconic(handle):
ret = ShowWindow(handle, SW.Restore)
elif not IsWindowVisible(handle):
... |
Only work on Windows 8/ 8. 1 if current window is Metro UI. waitTime: float. | def MetroClose(self, waitTime: float = OPERATION_WAIT_TIME) -> None:
"""
Only work on Windows 8/8.1, if current window is Metro UI.
waitTime: float.
"""
if self.ClassName == METRO_WINDOW_CLASS_NAME:
screenWidth, screenHeight = GetScreenSize()
MoveTo(screen... |
for Chinese language | def DemoCN():
"""for Chinese language"""
thisWindow = auto.GetConsoleWindow()
auto.Logger.ColorfullyWrite('我将运行<Color=Cyan>cmd</Color>并设置它的<Color=Cyan>屏幕缓冲区</Color>使<Color=Cyan>cmd</Color>一行能容纳很多字符\n\n')
time.sleep(3)
auto.SendKeys('{Win}r')
while not isinstance(auto.GetFocusedControl(), auto.E... |
for other language | def DemoEN():
"""for other language"""
thisWindow = auto.GetConsoleWindow()
auto.Logger.ColorfullyWrite('I will run <Color=Cyan>cmd</Color>\n\n')
time.sleep(3)
auto.SendKeys('{Win}r')
while not isinstance(auto.GetFocusedControl(), auto.EditControl):
time.sleep(1)
auto.SendKeys('cmd{... |
If you want to use functionalities related to Controls and Patterns in a new thread. You must call InitializeUIAutomationInCurrentThread first in the thread and call UninitializeUIAutomationInCurrentThread when the thread exits. But you can t use use a Control or a Pattern created in a different thread. So you can t cr... | def threadFunc(root):
"""
If you want to use functionalities related to Controls and Patterns in a new thread.
You must call InitializeUIAutomationInCurrentThread first in the thread
and call UninitializeUIAutomationInCurrentThread when the thread exits.
But you can't use use a Control or a Patt... |
Implements Algorithm 3 in manuscript | def _saliency_map(self, a, image, target, labels, mask, fast=False):
"""Implements Algorithm 3 in manuscript
"""
# pixel influence on target class
alphas = a.gradient(image, target) * mask
# pixel influence on sum of residual classes
# (don't evaluate if fast == True)
... |
Alternative constructor for a TensorFlowModel that accepts a tf. keras. Model instance. | def from_keras(cls, model, bounds, input_shape=None,
channel_axis=3, preprocessing=(0, 1)):
"""Alternative constructor for a TensorFlowModel that
accepts a `tf.keras.Model` instance.
Parameters
----------
model : `tensorflow.keras.Model`
A `tensorf... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.