How to use onwindowcreate method in pyatom

Best Python code snippet using pyatom_python

script.py

Source:script.py Github

copy

Full Screen

1# Orca2#3# Copyright 2004-2008 Sun Microsystems Inc.4#5# This library is free software; you can redistribute it and/or6# modify it under the terms of the GNU Lesser General Public7# License as published by the Free Software Foundation; either8# version 2.1 of the License, or (at your option) any later version.9#10# This library is distributed in the hope that it will be useful,11# but WITHOUT ANY WARRANTY; without even the implied warranty of12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU13# Lesser General Public License for more details.14#15# You should have received a copy of the GNU Lesser General Public16# License along with this library; if not, write to the17# Free Software Foundation, Inc., Franklin Street, Fifth Floor,18# Boston MA 02110-1301 USA.19""" Custom script for The notification daemon."""20__id__ = ""21__version__ = ""22__date__ = ""23__copyright__ = "Copyright (c) 2005-2008 Sun Microsystems Inc."24__license__ = "LGPL"25import orca.scripts.default as default26import orca.speech as speech27import pyatspi28from orca.orca_i18n import _29########################################################################30# #31# The notification-daemon script class. #32# #33########################################################################34class Script(default.Script):35 def getListeners(self):36 """Sets up the AT-SPI event listeners for this script.37 """38 listeners = default.Script.getListeners(self)39 listeners["window:create"] = \40 self.onWindowCreate41 return listeners42 def onWindowCreate(self, event):43 """Called whenever a window is created in the notification-daemon44 application.45 Arguments:46 - event: the Event.47 """48 a = self.utilities.descendantsWithRole(event.source, pyatspi.ROLE_LABEL)49 print a50 texts = [self.utilities.displayedText(acc) for acc in a]51 # Translators: This denotes a notification to the user of some sort.52 #53 text = _('Notification %s') % ' '.join(texts)...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run pyatom automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful