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 188 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 212 of file dash.py.

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

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

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

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