Sophie

Sophie

distrib > Fedora > 17 > i386 > by-pkgid > 2b43f8ef66f6ce56505ed3316378149e > files > 64

dogtail-0.8.1-1.fc17.noarch.rpm

#!/usr/bin/python

import os
import signal
import sys

from dogtail.config import config
config.logDebugToFile = False
from dogtail.procedural import *
from dogtail.tc import TCNode, TCBool
tcn = TCNode()

def appStartup(binary, roleName = "menu item"):
    """Launches the given binary, then checks to see that the application 
    started correctly by looking for a Node with the given roleName."""

    pid = run(binary)
    tcn.compare("app exists", None, focus.application.node)
    focus.widget.node = focus.app.node.child(roleName=roleName)
    tcn.compare("app has a %s" % roleName, None, focus.widget.node)
    os.kill(pid, signal.SIGTERM)

if __name__ == "__main__":
    binary = sys.argv[1]
    appStartup(binary)