Back to index

unity  6.0.0
Public Member Functions | Static Public Attributes
unity.emulators.quicklist.Quicklist Class Reference
Inheritance diagram for unity.emulators.quicklist.Quicklist:
Inheritance graph
[legend]
Collaboration diagram for unity.emulators.quicklist.Quicklist:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def items
def selectable_items
def get_quicklist_item_by_text
def get_quicklist_application_item
def click_item
def move_mouse_to_right
def selected_item
def geometry

Static Public Attributes

string DBUS_SERVICE = "com.canonical.Unity"
string DBUS_OBJECT = "/com/canonical/Unity/Debug"

Detailed Description

Represents a quicklist.

Definition at line 21 of file quicklist.py.


Member Function Documentation

Click one of the quicklist items.

Definition at line 48 of file quicklist.py.

00048 
00049     def click_item(self, item):
00050         """Click one of the quicklist items."""
00051         if not isinstance(item, QuicklistMenuItem):
00052             raise TypeError("Item must be a subclass of QuicklistMenuItem")
00053 
00054         item.mouse_click()

Returns a tuple of (x,y,w,h) for the quicklist.

Definition at line 69 of file quicklist.py.

00069 
00070     def geometry(self):
00071         """Returns a tuple of (x,y,w,h) for the quicklist."""
00072         return (self.x, self.y, self.width, self.height)
00073 

Here is the call graph for this function:

Returns the QuicklistMenuItemLabel for the given application_name

Definition at line 44 of file quicklist.py.

00044 
00045     def get_quicklist_application_item(self, application_name):
00046         """Returns the QuicklistMenuItemLabel for the given application_name"""
00047         return self.get_quicklist_item_by_text("<b>"+application_name+"</b>")

Here is the call graph for this function:

Returns a QuicklistMenuItemLabel object with the given text, or None.

Definition at line 34 of file quicklist.py.

00034 
00035     def get_quicklist_item_by_text(self, text):
00036         """Returns a QuicklistMenuItemLabel object with the given text, or None."""
00037         if not self.active:
00038             raise RuntimeError("Cannot get quicklist items. Quicklist is inactive!")
00039 
00040         matches = filter(lambda i: i.text == text,
00041             self.get_children_by_type(QuicklistMenuItemLabel))
00042 
00043         return matches[0] if matches else None

Here is the call graph for this function:

Here is the caller graph for this function:

Represents a quicklist.
Individual items in the quicklist.

Definition at line 25 of file quicklist.py.

00025 
00026     def items(self):
00027         """Individual items in the quicklist."""
00028         return self.get_children_by_type(QuicklistMenuItem, visible=True)

Moves the mouse outside the quicklist

Definition at line 55 of file quicklist.py.

00055 
00056     def move_mouse_to_right(self):
00057         """Moves the mouse outside the quicklist"""
00058         logger.debug("Moving mouse outside the quicklist %r", self)
00059         target_x = self.x + self.width + 10
00060         target_y = self.y + self.height / 2
00061         Mouse().move(target_x, target_y, animate=False)

Here is the call graph for this function:

Items that can be selected in the quicklist.

Definition at line 30 of file quicklist.py.

00030 
00031     def selectable_items(self):
00032         """Items that can be selected in the quicklist."""
00033         return self.get_children_by_type(QuicklistMenuItem, visible=True, selectable=True)

Definition at line 63 of file quicklist.py.

00063 
00064     def selected_item(self):
00065         items = self.get_children_by_type(QuicklistMenuItem, selected=True)
00066         assert(len(items) <= 1)
00067         return items[0] if items else None


Member Data Documentation

string unity.emulators.UnityIntrospectionObject.DBUS_OBJECT = "/com/canonical/Unity/Debug" [static, inherited]

Definition at line 19 of file __init__.py.

string unity.emulators.UnityIntrospectionObject.DBUS_SERVICE = "com.canonical.Unity" [static, inherited]

Definition at line 18 of file __init__.py.


The documentation for this class was generated from the following file: