Unity 8
 All Classes Functions
unity8.shell.emulators.dash.GenericScopeView Class Reference
Inheritance diagram for unity8.shell.emulators.dash.GenericScopeView:
Collaboration diagram for unity8.shell.emulators.dash.GenericScopeView:

Public Member Functions

def open_preview
 
def click_scope_item
 
def get_applications
 

Detailed Description

Autopilot emulator for generic scopes.

Definition at line 175 of file dash.py.

Member Function Documentation

def unity8.shell.emulators.dash.GenericScopeView.click_scope_item (   self,
  category,
  title 
)
Click an item from the scope.

:parameter category: The name of the category where the item is.
:parameter title: The title of the item.

Definition at line 199 of file dash.py.

200  def click_scope_item(self, category, title):
201  """Click an item from the scope.
202 
203  :parameter category: The name of the category where the item is.
204  :parameter title: The title of the item.
205 
206  """
207  category_element = self._get_category_element(category)
208  icon = category_element.select_single('AbstractButton', title=title)
209  self.pointing_device.click_object(icon)
def unity8.shell.emulators.dash.GenericScopeView.get_applications (   self,
  category 
)
Return the list of applications on a category.

:parameter category: The name of the category.

Definition at line 218 of file dash.py.

219  def get_applications(self, category):
220  """Return the list of applications on a category.
221 
222  :parameter category: The name of the category.
223 
224  """
225  category_element = self._get_category_element(category)
226  see_all = category_element.select_single(objectName='seeAll')
227  application_cards = category_element.select_many('AbstractButton')
228 
229  application_cards = sorted(
230  (card for card in application_cards
231  if card.globalRect.y < see_all.globalRect.y),
232  key=lambda card: (card.globalRect.y, card.globalRect.x))
233 
234  result = []
235  for card in application_cards:
236  if card.objectName not in ('cardToolCard', 'seeAll'):
237  result.append(card.title)
238  return result
239 
def unity8.shell.emulators.dash.GenericScopeView.open_preview (   self,
  category,
  app_name 
)
Open the preview of an application.

:parameter category: The name of the category where the application is.
:parameter app_name: The name of the application.
:return: The opened preview.

Definition at line 179 of file dash.py.

180  def open_preview(self, category, app_name):
181  """Open the preview of an application.
182 
183  :parameter category: The name of the category where the application is.
184  :parameter app_name: The name of the application.
185  :return: The opened preview.
186 
187  """
188  # FIXME some categories need a long press in order to see the preview.
189  # Some categories do not show previews, like recent apps.
190  # --elopio - 2014-1-14
191  self.click_scope_item(category, app_name)
192  preview_list = self.wait_select_single(
193  'QQuickLoader', objectName='subPageLoader')
194  preview_list.subPageShown.wait_for(True)
195  preview_list.x.wait_for(0)
196  return preview_list.select_single(
197  Preview, objectName='preview{}'.format(preview_list.currentIndex))

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