Unity 8
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 (self, category, app_name)
 
def click_scope_item (self, category, title)
 
def get_applications (self, category)
 

Detailed Description

Autopilot emulator for generic scopes.

Definition at line 189 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 213 of file dash.py.

213  def click_scope_item(self, category, title):
214  """Click an item from the scope.
215 
216  :parameter category: The name of the category where the item is.
217  :parameter title: The title of the item.
218 
219  """
220  category_element = self._get_category_element(category)
221  icon = category_element.wait_select_single('AbstractButton', title=title)
222  self.pointing_device.click_object(icon)
223 
def click_scope_item(self, category, title)
Definition: dash.py:213
def _get_category_element(self, category)
Definition: dash.py:224
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 232 of file dash.py.

232  def get_applications(self, category):
233  """Return the list of applications on a category.
234 
235  :parameter category: The name of the category.
236 
237  """
238  category_element = self._get_category_element(category)
239  see_all = category_element.select_single(objectName='seeAll')
240  application_cards = category_element.select_many('AbstractButton')
241 
242  application_cards = sorted(
243  (card for card in application_cards
244  if card.globalRect.y < see_all.globalRect.y),
245  key=lambda card: (card.globalRect.y, card.globalRect.x))
246 
247  result = []
248  for card in application_cards:
249  if card.objectName not in ('cardToolCard', 'seeAll'):
250  result.append(card.title)
251  return result
252 
253 
def get_applications(self, category)
Definition: dash.py:232
def _get_category_element(self, category)
Definition: dash.py:224
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 193 of file dash.py.

193  def open_preview(self, category, app_name):
194  """Open the preview of an application.
195 
196  :parameter category: The name of the category where the application is.
197  :parameter app_name: The name of the application.
198  :return: The opened preview.
199 
200  """
201  # FIXME some categories need a long press in order to see the preview.
202  # Some categories do not show previews, like recent apps.
203  # --elopio - 2014-1-14
204  self.click_scope_item(category, app_name)
205  preview_list = self.wait_select_single(
206  'QQuickLoader', objectName='subPageLoader')
207  preview_list.subPageShown.wait_for(True)
208  preview_list.x.wait_for(0)
209  return preview_list.select_single(
210  Preview, objectName='preview{}'.format(preview_list.currentIndex))
211 
def click_scope_item(self, category, title)
Definition: dash.py:213
def open_preview(self, category, app_name)
Definition: dash.py:193

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