poco.freezeui.hierarchy module

class FrozenUIDumper[源代码]

基类:AbstractDumper

Partially implementation of IDumper. This is only a helper that helps to make dumper work with local nodes just like with remote nodes. The local nodes is an implementation of AbstractNode locally with fixed hierarchy data in arbitrary data type. In a word, this class is not going to crawl hierarchy from target app, but to perform like a ordinary dumper.

dumpHierarchy(onlyVisibleNode=True)[源代码]
返回:

json serializable dict holding the whole hierarchy data

返回类型:

dict

getRoot()[源代码]

Dump a hierarchy immediately from target runtime and store into a Node (subclass of AbstractNode) object.

返回:

Each time a new node instance is created by latest hierarchy

data.

返回类型:

inherit from AbstractNode

class FrozenUIHierarchy(dumper, attributor=None)[源代码]

基类:HierarchyInterface

Locally implementation of hierarchy interface with a given dumper and all other behaviours by default. As all information can only be retrieve from a fixed UI hierarchy data created by dumper and all UI elements are immutable, this class is called frozen hierarchy. With the help of this class, only very few of the methods are required to implement. See AbstractNode or poco-sdk integration guide to get more details about this.

This class makes it much easier to integrate poco-sdk and optimizes performance in some situations, but it is not sensitive enough to the changes of UI hierarchy in the app. For example, you should call select explicitly to re-crawl a new UI hierarchy when some UI elements changed on screen. Otherwise you are using attributes that are out of date.

dump()[源代码]

Get the UI hierarchy with its origin structure and attributes, then store the structure and attributes into a json serializable dictionary.

返回:

dict representing the hierarchy structure. Structure specification refers to IDumper.

返回类型:

dict

getAttr(nodes, name)[源代码]

get node attribute

select(query, multiple=False)[源代码]

select nodes by query

setAttr(nodes, name, value)[源代码]

set node attribute