~ubuntu-branches/ubuntu/utopic/dogtail/utopic-proposed

« back to all changes in this revision

Viewing changes to scripts/dogtail-logout

  • Committer: Package Import Robot
  • Author(s): Alessio Treglia
  • Date: 2014-04-22 17:13:47 UTC
  • mfrom: (1.1.5) (3.2.3 sid)
  • Revision ID: package-import@ubuntu.com-20140422171347-eh1uvji121oea25l
Tags: 0.9.0-1
* New upstream release.
* Refresh patches.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/usr/bin/python
2
2
# Logs out the full gnome session. Be sure to have your documents saved, as running
3
 
# may cause loosing the changes, or it may halt the logout process. 
 
3
# may cause loosing the changes, or it may halt the logout process.
4
4
 
5
5
from dogtail.tree import *
6
6
from dogtail.rawinput import pressKey
12
12
# Click onto a super menu label that we find under the g-s top panel object.
13
13
# We need these indexes as g-s a11y support is a wee bit messy.
14
14
shell[0][1][2].child(getpass.getuser(), roleName='label').click()
15
 
# We can child this all the way down from the app as there's no other Log Out... label
 
15
# We can child this all the way down from the app as there's no other Log
 
16
# Out... label
16
17
shell.child('Log Out...', roleName='label').click()
17
18
# This takes care of the 60 second dialog.
18
19
# Sometimes a dialog warning about unsaved work in gedit etc. pops out, but that has the same
20
21
# in the affected application however, that might put the logout process on hold again. Unfortunatelly
21
22
# we cannot do anything about that with dotail at that point as a11y registry got disabled already
22
23
# by the logout process.
23
 
shell[0][1].child(roleName='dialog', recursive=False).child('Log Out', roleName='push button').click()
 
24
shell[0][1].child(roleName='dialog', recursive=False).child(
 
25
    'Log Out', roleName='push button').click()
24
26
 
25
27
# Give the session some time to end before we kill it.
26
28
sleep(10)