Package dogtail :: Module utils :: Class GnomeShell
[hide private]
[frames] | no frames]

Class GnomeShell

source code

object --+
         |
        GnomeShell

Utility class to help working with certain atributes of gnome-shell. Currently that means handling the Application menu available for apps on the top gnome-shell panel. Searching for the menu and its items is somewhat tricky due to fuzzy a11y tree of gnome-shell, mainly since the actual menu is not present as child to the menu-spawning button. Also, the menus get constructed/destroyed on the fly with application focus changes. Thus current application name as displayed plus a reference known menu item (with 'Quit' as default) are required by these methods.

Instance Methods [hide private]
 
__init__(self, classic_mode=False)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
getApplicationMenuList(self, search_by_item='Quit')
Returns list of all menu item nodes.
source code
 
getApplicationMenuButton(self, app_name)
Returns the application menu 'button' node as present on the gnome-shell top panel.
source code
 
getApplicationMenuItem(self, item, search_by_item='Quit')
Returns a particilar menu item node.
source code
 
clickApplicationMenuItem(self, app_name, item, search_by_item='Quit')
Executes the given menu item through opening the menu first followed by a click at the particular item.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, classic_mode=False)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

getApplicationMenuList(self, search_by_item='Quit')

source code 

Returns list of all menu item nodes. Searches for the menu by a reference item. Provide a different item name, if the 'Quit' is not present - but beware picking one present elsewhere, like 'Lock' or 'Power Off' present under the user menu.

getApplicationMenuItem(self, item, search_by_item='Quit')

source code 

Returns a particilar menu item node. Uses a different 'Quit' or custom item name for reference, but also attempts to use the given item if the general reference fails.

clickApplicationMenuItem(self, app_name, item, search_by_item='Quit')

source code 

Executes the given menu item through opening the menu first followed by a click at the particular item. The menu search reference 'Quit' may be customized. Also attempts to use the given item for reference if search fails with the default/custom one.