Lomiri
Loading...
Searching...
No Matches
lomiri.shell.ShellView Class Reference

Inherits lomiriuitoolkit.LomiriUIToolkitCustomProxyObjectBase.

Public Member Functions

 get_greeter (self)
 
 get_login_loader (self)
 
 get_login_list (self)
 
 get_bottombar (self)
 
 get_pinPadLoader (self)
 
 get_lockscreen (self)
 
 get_pinentryField (self)
 
 open_indicator_page (self, indicator_name)
 
 close_indicator_page (self)
 
 show_dash_swiping (self)
 
 get_current_focused_app_id (self)
 
 show_dash_from_launcher (self)
 
 open_launcher (self)
 
 is_launcher_open (self)
 
 launch_application (self, application_name)
 
 enter_pin_code (self, code)
 
 get_shell_orientation_angle (self)
 
 get_shell_orientation (self)
 
 get_shell_primary_orientation (self)
 
 get_shell_native_orientation (self)
 
 wait_for_notification (self)
 

Protected Member Functions

 _get_indicator_panel_item (self, indicator_name)
 
 _get_indicator_page (self, indicator_name)
 
 _get_shell (self)
 
 _get_launcher (self)
 
 _get_pinpad_button (self, button_id)
 

Detailed Description

An helper class that makes it easy to interact with the shell

Definition at line 98 of file __init__.py.

Member Function Documentation

◆ _get_indicator_page()

lomiri.shell.ShellView._get_indicator_page (   self,
  indicator_name 
)
protected

Definition at line 131 of file __init__.py.

131 def _get_indicator_page(self, indicator_name):
132 return self.select_single(
133 'IndicatorPage',
134 objectName=indicator_name+'-page'
135 )
136

◆ _get_indicator_panel_item()

lomiri.shell.ShellView._get_indicator_panel_item (   self,
  indicator_name 
)
protected

Definition at line 125 of file __init__.py.

125 def _get_indicator_panel_item(self, indicator_name):
126 return self.select_single(
127 'IndicatorItem',
128 objectName=indicator_name+'-panelItem'
129 )
130

◆ _get_launcher()

lomiri.shell.ShellView._get_launcher (   self)
protected

Definition at line 193 of file __init__.py.

193 def _get_launcher(self):
194 return self.select_single(launcher_helpers.Launcher)
195

◆ _get_pinpad_button()

lomiri.shell.ShellView._get_pinpad_button (   self,
  button_id 
)
protected

Definition at line 232 of file __init__.py.

232 def _get_pinpad_button(self, button_id):
233 return self.select_single(
234 'PinPadButton',
235 objectName='pinPadButton{}'.format(button_id)
236 )
237

◆ _get_shell()

lomiri.shell.ShellView._get_shell (   self)
protected

Definition at line 172 of file __init__.py.

172 def _get_shell(self):
173 return self.select_single('Shell')
174

◆ close_indicator_page()

lomiri.shell.ShellView.close_indicator_page (   self)
Swipe to close the opened indicator, wait until it's closed.

Definition at line 152 of file __init__.py.

152 def close_indicator_page(self):
153 """Swipe to close the opened indicator, wait until it's closed."""
154 indicators_menu = self.wait_select_single('IndicatorsMenu')
155 end_x, end_y = input.get_center_point(indicators_menu)
156 start_x = end_x
157 start_y = self.height
158 self.pointing_device.drag(start_x, start_y, end_x, end_y)
159 indicators_menu.fullyClosed.wait_for(True)
160

◆ enter_pin_code()

lomiri.shell.ShellView.enter_pin_code (   self,
  code 
)
Enter code 'code' into the single-pin lightdm pincode entry screen.

:param code: must be a string of numeric characters.
:raises: TypeError if code is not a string.
:raises: ValueError if code contains non-numeric characters.

Definition at line 211 of file __init__.py.

211 def enter_pin_code(self, code):
212 """Enter code 'code' into the single-pin lightdm pincode entry screen.
213
214 :param code: must be a string of numeric characters.
215 :raises: TypeError if code is not a string.
216 :raises: ValueError if code contains non-numeric characters.
217
218 """
219 if not isinstance(code, str):
220 raise TypeError(
221 "'code' parameter must be a string, not %r."
222 % type(code)
223 )
224 for num in code:
225 if not num.isdigit():
226 raise ValueError(
227 "'code' parameter contains non-numeric characters."
228 )
229 self.pointing_device.click_object(
230 self._get_pinpad_button(int(num)))
231

◆ get_bottombar()

lomiri.shell.ShellView.get_bottombar (   self)

Definition at line 110 of file __init__.py.

110 def get_bottombar(self):
111 return self.select_single("Bottombar")
112

◆ get_current_focused_app_id()

lomiri.shell.ShellView.get_current_focused_app_id (   self)
Return the id of the focused application.

Definition at line 175 of file __init__.py.

175 def get_current_focused_app_id(self):
176 """Return the id of the focused application."""
177 return self._get_shell().focusedApplicationId
178

◆ get_greeter()

lomiri.shell.ShellView.get_greeter (   self)

Definition at line 101 of file __init__.py.

101 def get_greeter(self):
102 return self.select_single(greeter.Greeter)
103

◆ get_lockscreen()

lomiri.shell.ShellView.get_lockscreen (   self)

Definition at line 119 of file __init__.py.

119 def get_lockscreen(self):
120 return self.select_single("Lockscreen")
121

◆ get_login_list()

lomiri.shell.ShellView.get_login_list (   self)

Definition at line 107 of file __init__.py.

107 def get_login_list(self):
108 return self.select_single("LoginList")
109

◆ get_login_loader()

lomiri.shell.ShellView.get_login_loader (   self)

Definition at line 104 of file __init__.py.

104 def get_login_loader(self):
105 return self.select_single("QQuickLoader", objectName="loginLoader")
106

◆ get_pinentryField()

lomiri.shell.ShellView.get_pinentryField (   self)

Definition at line 122 of file __init__.py.

122 def get_pinentryField(self):
123 return self.select_single(objectName="pinentryField")
124

◆ get_pinPadLoader()

lomiri.shell.ShellView.get_pinPadLoader (   self)

Definition at line 113 of file __init__.py.

113 def get_pinPadLoader(self):
114 return self.select_single(
115 "QQuickLoader",
116 objectName="pinPadLoader"
117 )
118

◆ get_shell_native_orientation()

lomiri.shell.ShellView.get_shell_native_orientation (   self)

Definition at line 247 of file __init__.py.

247 def get_shell_native_orientation(self):
248 return self._get_shell().nativeOrientation
249

◆ get_shell_orientation()

lomiri.shell.ShellView.get_shell_orientation (   self)

Definition at line 241 of file __init__.py.

241 def get_shell_orientation(self):
242 return self._get_shell().orientation
243

◆ get_shell_orientation_angle()

lomiri.shell.ShellView.get_shell_orientation_angle (   self)

Definition at line 238 of file __init__.py.

238 def get_shell_orientation_angle(self):
239 return self._get_shell().orientationAngle
240

◆ get_shell_primary_orientation()

lomiri.shell.ShellView.get_shell_primary_orientation (   self)

Definition at line 244 of file __init__.py.

244 def get_shell_primary_orientation(self):
245 return self._get_shell().primaryOrientation
246

◆ is_launcher_open()

lomiri.shell.ShellView.is_launcher_open (   self)

Definition at line 196 of file __init__.py.

196 def is_launcher_open(self):
197 return self._get_launcher().shown
198

◆ launch_application()

lomiri.shell.ShellView.launch_application (   self,
  application_name 
)
Launch an application.

:parameter application_name: The name of the application to launch.

Definition at line 200 of file __init__.py.

200 def launch_application(self, application_name):
201 """Launch an application.
202
203 :parameter application_name: The name of the application to launch.
204
205 """
206 launcher = self.open_launcher()
207 launcher.click_application_launcher_icon(application_name)
208 self.get_current_focused_app_id().wait_for(application_name)
209 launcher.shown.wait_for(False)
210

◆ open_indicator_page()

lomiri.shell.ShellView.open_indicator_page (   self,
  indicator_name 
)
Swipe to open the indicator, wait until it's open.

:returns: The indicator page.

Definition at line 138 of file __init__.py.

138 def open_indicator_page(self, indicator_name):
139 """Swipe to open the indicator, wait until it's open.
140
141 :returns: The indicator page.
142 """
143 widget = self._get_indicator_panel_item(indicator_name)
144 start_x, start_y = input.get_center_point(widget)
145 end_x = start_x
146 end_y = self.height
147 self.pointing_device.drag(start_x, start_y, end_x, end_y)
148 self.wait_select_single('IndicatorsMenu', fullyOpened=True)
149 return self._get_indicator_page(indicator_name)
150

◆ open_launcher()

lomiri.shell.ShellView.open_launcher (   self)

Definition at line 188 of file __init__.py.

188 def open_launcher(self):
189 launcher = self._get_launcher()
190 launcher.show()
191 return launcher
192

◆ show_dash_from_launcher()

lomiri.shell.ShellView.show_dash_from_launcher (   self)
Open the dash clicking the dash icon on the launcher.

Definition at line 180 of file __init__.py.

180 def show_dash_from_launcher(self):
181 """Open the dash clicking the dash icon on the launcher."""
182 launcher = self.open_launcher()
183 launcher.click_dash_icon()
184 self.get_current_focused_app_id().wait_for('lomiri-dash')
185 launcher.shown.wait_for(False)
186

◆ show_dash_swiping()

lomiri.shell.ShellView.show_dash_swiping (   self)
Show the dash swiping from the left.

Definition at line 162 of file __init__.py.

162 def show_dash_swiping(self):
163 """Show the dash swiping from the left."""
164 x, y, width, height = self._get_shell().globalRect
165 start_x = x
166 end_x = x + width
167 start_y = end_y = y + height // 2
168
169 self.pointing_device.drag(start_x, start_y, end_x, end_y)
170 self.get_current_focused_app_id().wait_for('lomiri-dash')
171

◆ wait_for_notification()

lomiri.shell.ShellView.wait_for_notification (   self)
Wait for a notification dialog to appear.

:return: An object for the notification dialog data.
:raise StateNotFoundError: if the timeout expires when the
notification has not appeared.

Definition at line 251 of file __init__.py.

251 def wait_for_notification(self):
252 """Wait for a notification dialog to appear.
253
254 :return: An object for the notification dialog data.
255 :raise StateNotFoundError: if the timeout expires when the
256 notification has not appeared.
257
258 """
259 notify_list = self.select_single('Notifications',
260 objectName='notificationList')
261 visible_notification = notify_list.wait_select_single('Notification',
262 visible=True)
263 return {'summary': visible_notification.summary,
264 'body': visible_notification.body,
265 'iconSource': visible_notification.iconSource}

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