def stop(app):
    app.check()
    if not os.path.exists(app.pid_path()):
        print "~ Oops! %s is not started (server.pid not found)" % os.path.normpath(app.path)
        print "~"
        sys.exit(-1)
    pid = open(app.pid_path()).readline().strip()
    kill(pid)
    os.remove(app.pid_path())
    print "~ OK, %s is stopped" % app.path
    print "~"
dataset/ETHPy150Open deanhiller/databus/webapp/play1.3.x/framework/pym/play/commands/daemon.py/stop/original