KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17
System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64
User : nobody ( 99)
PHP Version : 5.2.17
Disable Function : NONE
Directory :  /proc/21572/root/usr/bin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/21572/root/usr/bin/dogtail-detect-session
#!/usr/bin/python
"""
dogtail-detect session

This script checks for some main pieces of a running GNOME session, 
specifically gnome-panel and metacity. 

It checks to see that the gnome-panel node has at least some child nodes.
For example, the main gnome-panel node by default has two direct descendents:
the top panel, and the bottom panel.
Metacity's existence is also checked. However, metacity currently never has
any child nodes.

If a proper session is running, the scripts exits with a status of 0.
If no session is found, a non-zero exit code is returned.

Author: Zack Cerza <zcerza@redhat.com>
"""

__author__ = "Zack Cerza <zcerza@redhat.com>"

from dogtail.procedural import *
import sys

def GNOME():
	"""
	"Is an accessibility-enabled GNOME session running?"
	"""
	running = False
	try: 
		assert focus.desktop
		assert focus.desktop.children
		
		focus.application('gnome-panel')
		assert focus.application.children
		
		focus.application('metacity')
		print focus.application.node
		assert focus.application.node
		running = True
		print "GNOME Session detected."
	except AttributeError or AssertionError or FocusError:
		print "ERROR: No session found."
	return running

def KDE():
	"""
	"Is an accessibility-enabled KDE session running?"
	"""
	running = False
	return running

def JustSomeApps():
    """
    "Is at least one accessibility-enabled application running?"
    """
    assert focus.desktop
    assert focus.desktop.children

if GNOME() or KDE() or JustSomeApps():
	sys.exit()
else: 
	sys.exit(1)


Anon7 - 2021