Example #1
0
    def test_de(self):
        de = tools.guess_de()
        if de:
            self.add_success('Desktop environment detected as {0}'.format(de),
                             '')
        else:
            self.add_warning('Desktop environment couldn\'t be detected.',
                             "Auto power off feature may not work.")

        self.do_next_test()
Example #2
0
    def test_de(self):
        de = tools.guess_de()
        if de:
            self.add_success('Desktop environment detected as {0}'.format(de),
                             '')
        else:
            self.add_warning('Desktop environment couldn\'t be detected.',
                             "Auto power off feature may not work.")

        self.do_next_test()
Example #3
0
 def guess_shutdown_cmd(self):
     de = tools.guess_de()
     des = { 'xfce' : 'xfce4-session-logout --halt',
             'gnome' : 'gnome-session-save --shutdown-dialog',
             'ubuntu' : 'gnome-session-quit --power-off',
             'mate' : 'mate-session-save --shutdown-dialog',
             'kde' : 'qdbus org.kde.ksmserver /KSMServer logout 0 2 2',
             'cinnamon': 'cinnamon-session-quit --power-off --no-prompt'}
     if de and des.has_key(de):
         return des[de]
     else:
         return 'shutdown -h now'
Example #4
0
 def guess_shutdown_cmd(self):
     de = tools.guess_de()
     des = {
         'xfce': 'xfce4-session-logout --halt',
         'gnome': 'gnome-session-save --shutdown-dialog',
         'ubuntu': 'gnome-session-quit --power-off',
         'mate': 'mate-session-save --shutdown-dialog',
         'kde': 'qdbus org.kde.ksmserver /KSMServer logout 0 2 2',
         'cinnamon': 'cinnamon-session-quit --power-off --no-prompt'
     }
     if de and des.has_key(de):
         return des[de]
     else:
         return 'shutdown -h now'