Exemplo n.º 1
0
def main(form, output_format="json"):
  
    if form.has_key("name"):
        name = form["name"].value
    
    if form.has_key("output_format"):
        output_format = form["output_format"].value
    
    data_dict = load_solver_data(name)
    #jobs = data_dict["timesteps"][-1]["jobs"]
    output = ""
    try:
        os.kill(data_dict["pid"], signal.SIGTERM)
        output += "\n Grid solver process terminated."
    except OSError, err:
        if err.errno == 3:
            output += "\n Grid solver process is not running."
        else:
            output += "Error: "+str(err)
Exemplo n.º 2
0
def main(form):
    html = ""

    if form.has_key("solver_name"):
        global solver_name
        solver_name = form["solver_name"].value
        data = None
        
        if os.path.exists(os.path.join(config.jobdata_directory, solver_name, config.solver_data_file)):
            data = load_solver_data(solver_name)
            html = create_process_view(data)
        else:
            html = "No process data found."
    else:
        html = create_process_list()
        
    head = "<html><head>%s</head>" % scripts
    text = "<body><div id='mycontent' >%s</div></body></html>" % html
    print "Content-type: text/html"
    print 
    print head
    print text
Exemplo n.º 3
0
def main(form):
    html = ""

    if form.has_key("solver_name"):
        global solver_name
        solver_name = form["solver_name"].value
        data = None

        if os.path.exists(
                os.path.join(config.jobdata_directory, solver_name,
                             config.solver_data_file)):
            data = load_solver_data(solver_name)
            html = create_process_view(data)
        else:
            html = "No process data found."
    else:
        html = create_process_list()

    head = "<html><head>%s</head>" % scripts
    text = "<body><div id='mycontent' >%s</div></body></html>" % html
    print "Content-type: text/html"
    print
    print head
    print text