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 171 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 195 of file dash.py.

196  def click_scope_item(self, category, title):
197  """Click an item from the scope.
198 
199  :parameter category: The name of the category where the item is.
200  :parameter title: The title of the item.
201 
202  """
203  category_element = self._get_category_element(category)
204  icon = category_element.select_single('AbstractButton', title=title)
205  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 214 of file dash.py.

215  def get_applications(self, category):
216  """Return the list of applications on a category.
217 
218  :parameter category: The name of the category.
219 
220  """
221  category_element = self._get_category_element(category)
222  see_all = category_element.select_single(objectName='seeAll')
223  application_cards = category_element.select_many('AbstractButton')
224 
225  application_cards = sorted(
226  (card for card in application_cards
227  if card.globalRect.y < see_all.globalRect.y),
228  key=lambda card: (card.globalRect.y, card.globalRect.x))
229 
230  result = []
231  for card in application_cards:
232  if card.objectName not in ('cardToolCard', 'seeAll'):
233  result.append(card.title)
234  return result
235 
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 175 of file dash.py.

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

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