Пример #1
0
<body>
<h1>Database script file</h1>
"""
sql_script_file = open(batch_script, "r")
lines = sql_script_file.readlines()
sql_script_file.close()
line_count = len(lines)
if line_count > 10:
    print """<input id="show_hide" type="button" onclick="toggleVerboseText()" value="Show all" /><br/>"""
print """<tt>"""
for line, index in zip(lines, range(line_count)):
    if line_count > 10 and index == 3:
        print "<div id='verbose_placeholder' style='display:block'>...</div>"
        print "<div id='too_verbose' style='display:none'>"
    print "<div style='whitespace:nowrap'>%s</div>" % (line)
    if line_count > 10 and index == line_count - 4:
        print "</div>"
print "</tt>"
if queue is None:
    job_id = sql_jobs.run_sql_file(batch_id,
                                   batch_script,
                                   output_file,
                                   project=my_batch["project"])
else:
    job_id = sql_jobs.run_sql_file(batch_id, batch_script, output_file, queue,
                                   my_batch["project"])

print "<h2>SQL script submitted to cluster as job # %s" % (job_id)
print "</body>"
print "</html>"
{
    make_visible = too_verbose.style.display == 'none';
    too_verbose.style.display = make_visible?'block':'none';
    verbose_placeholder.style.display = make_visible?'none':'block';
    show_hide.value=make_visible?'Hide most':'Show all';
}
</script>
<body>
<h1>Database script file</h1>
"""
sql_script_file = open(batch_script_path, "r")
lines = sql_script_file.readlines()
sql_script_file.close()
line_count = len(lines)
if line_count > 10:
    print """<input id="show_hide" type="button" onclick="toggleVerboseText()" value="Show all" /><br/>"""
print """<tt>"""
for line, index in zip(lines, range(line_count)):
    if line_count > 10 and index == 3:
        print "<div id='verbose_placeholder' style='display:block'>...</div>"
        print "<div id='too_verbose' style='display:none'>"
    print "<div style='whitespace:nowrap'>%s</div>" % (line)
    if line_count > 10 and index == line_count - 4:
        print "</div>"
print "</tt>"
job = sql_jobs.run_sql_file(batch_id, batch_script_file)

print "<h2>SQL script submitted to cluster as job # %s" % (job.job_id)
print "</body>"
print "</html>"
Пример #3
0
}
</script>
<body>
<h1>Database script file</h1>
"""
sql_script_file=open(batch_script,"r")
lines = sql_script_file.readlines()
sql_script_file.close()
line_count = len(lines)
if line_count > 10:
    print """<input id="show_hide" type="button" onclick="toggleVerboseText()" value="Show all" /><br/>"""
print """<tt>"""
for line, index in zip(lines,range(line_count)):
    if line_count > 10 and index == 3:
        print "<div id='verbose_placeholder' style='display:block'>...</div>"
        print "<div id='too_verbose' style='display:none'>"
    print "<div style='whitespace:nowrap'>%s</div>"%(line)
    if line_count > 10 and index == line_count-4:
        print "</div>"
print "</tt>"
if queue is None:
    job_id = sql_jobs.run_sql_file(batch_id, batch_script, output_file,
                                   project=my_batch["project"])
else:
    job_id = sql_jobs.run_sql_file(batch_id, batch_script, output_file, queue,
                                   my_batch["project"])
    
print "<h2>SQL script submitted to cluster as job # %s"%(job_id)
print "</body>"
print "</html>"
Пример #4
0
{
    make_visible = too_verbose.style.display == 'none';
    too_verbose.style.display = make_visible?'block':'none';
    verbose_placeholder.style.display = make_visible?'none':'block';
    show_hide.value=make_visible?'Hide most':'Show all';
}
</script>
<body>
<h1>Database script file</h1>
"""
sql_script_file=open(batch_script_path,"r")
lines = sql_script_file.readlines()
sql_script_file.close()
line_count = len(lines)
if line_count > 10:
    print """<input id="show_hide" type="button" onclick="toggleVerboseText()" value="Show all" /><br/>"""
print """<tt>"""
for line, index in zip(lines,range(line_count)):
    if line_count > 10 and index == 3:
        print "<div id='verbose_placeholder' style='display:block'>...</div>"
        print "<div id='too_verbose' style='display:none'>"
    print "<div style='whitespace:nowrap'>%s</div>"%(line)
    if line_count > 10 and index == line_count-4:
        print "</div>"
print "</tt>"
job = sql_jobs.run_sql_file(batch_id, batch_script_file)
    
print "<h2>SQL script submitted to cluster as job # %s"%(job.job_id)
print "</body>"
print "</html>"