当前位置: 首页>>代码示例>>Python>>正文


Python IAccessibleHandler.accChild方法代码示例

本文整理汇总了Python中IAccessibleHandler.accChild方法的典型用法代码示例。如果您正苦于以下问题:Python IAccessibleHandler.accChild方法的具体用法?Python IAccessibleHandler.accChild怎么用?Python IAccessibleHandler.accChild使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IAccessibleHandler的用法示例。


在下文中一共展示了IAccessibleHandler.accChild方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _get_firstChild

# 需要导入模块: import IAccessibleHandler [as 别名]
# 或者: from IAccessibleHandler import accChild [as 别名]
 def _get_firstChild(self):
     # accNavigate incorrectly returns nothing for NAVDIR_FIRSTCHILD and requesting one child with AccessibleChildren causes a crash.
     # Therefore, we must use accChild(1).
     child = IAccessibleHandler.accChild(self.IAccessibleObject, 1)
     if not child:
         return None
     return IAccessible(IAccessibleObject=child[0], IAccessibleChildID=child[1])
开发者ID:RKelson93,项目名称:nvda,代码行数:9,代码来源:msOffice.py

示例2: locateHTMLElementByID

# 需要导入模块: import IAccessibleHandler [as 别名]
# 或者: from IAccessibleHandler import accChild [as 别名]
def locateHTMLElementByID(document,ID):
	try:
		element=document.getElementsByName(ID).item(0)
	except COMError as e:
		log.debugWarning("document.getElementsByName failed with COMError %s"%e)
		element=None
	if element:
		return element
	try:
		nodeName=document.body.nodeName
	except COMError as e:
		log.debugWarning("document.body.nodeName failed with COMError %s"%e)
		return None
	if nodeName=="FRAMESET":
		tag="frame"
	else:
		tag="iframe"
	try:
		frames=document.getElementsByTagName(tag)
	except COMError as e:
		log.debugWarning("document.getElementsByTagName failed with COMError %s"%e)
		return None
	for frame in frames:
		pacc=IAccessibleFromHTMLNode(frame)
		res=IAccessibleHandler.accChild(pacc,1)
		if not res: continue
		childElement=HTMLNodeFromIAccessible(res[0])
		if not childElement: continue
		childElement=locateHTMLElementByID(childElement.document,ID)
		if not childElement: continue
		return childElement
开发者ID:atsuoishimoto,项目名称:tweetitloud,代码行数:33,代码来源:MSHTML.py

示例3: getChildHTMLNodeFromFrame

# 需要导入模块: import IAccessibleHandler [as 别名]
# 或者: from IAccessibleHandler import accChild [as 别名]
def getChildHTMLNodeFromFrame(frame):
	try:
		pacc=IAccessibleFromHTMLNode(frame)
	except NotImplementedError:
		# #1569: It's not possible to get an IAccessible from frames marked with an ARIA role of presentation.
		# In this case, just skip this frame.
		return
	res=IAccessibleHandler.accChild(pacc,1)
	if not res: return
	return HTMLNodeFromIAccessible(res[0])
开发者ID:pcguruuu,项目名称:git-git.nvaccess.org-nvda,代码行数:12,代码来源:MSHTML.py

示例4: locateHTMLElementByID

# 需要导入模块: import IAccessibleHandler [as 别名]
# 或者: from IAccessibleHandler import accChild [as 别名]
def locateHTMLElementByID(document, ID):
    try:
        elements = document.getElementsByName(ID)
        if elements is not None:
            element = elements.item(0)
        else:  # probably IE 10 in standards mode (#3151)
            try:
                element = document.all.item(ID)
            except:
                element = None
    except COMError as e:
        log.debugWarning("document.getElementsByName failed with COMError %s" % e)
        element = None
    if element:
        return element
    try:
        nodeName = document.body.nodeName
    except COMError as e:
        log.debugWarning("document.body.nodeName failed with COMError %s" % e)
        return None
    if nodeName:
        nodeName = nodeName.upper()
    if nodeName == "FRAMESET":
        tag = "frame"
    else:
        tag = "iframe"
    try:
        frames = document.getElementsByTagName(tag)
    except COMError as e:
        log.debugWarning("document.getElementsByTagName failed with COMError %s" % e)
        return None
    if not frames:  # frames can be None in IE 10
        return None
    for frame in frames:
        try:
            pacc = IAccessibleFromHTMLNode(frame)
        except NotImplementedError:
            # #1569: It's not possible to get an IAccessible from frames marked with an ARIA role of presentation.
            # In this case, just skip this frame.
            continue
        res = IAccessibleHandler.accChild(pacc, 1)
        if not res:
            continue
        childElement = HTMLNodeFromIAccessible(res[0])
        if not childElement:
            continue
        childElement = locateHTMLElementByID(childElement.document, ID)
        if not childElement:
            continue
        return childElement
开发者ID:sonar-gnu-linux,项目名称:nvda,代码行数:52,代码来源:MSHTML.py


注:本文中的IAccessibleHandler.accChild方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。