Esempio n. 1
0
def gen_html():
    if "id" in form:
        body = single_message()
    else:
        body = list_messages()

    return html.html(
        html.head(html.title("a858 auto-analysis"),
                  html.script(language='javascript', src='functions.js')),
        body)
Esempio n. 2
0
def gen_html():
	if "id" in form:
		body = single_message()
	else:
		body = list_messages()

	return html.html(
		html.head(
			html.title("a858 auto-analysis"),
			html.script(language='javascript', src='functions.js')
		),
		body
	)
Esempio n. 3
0
def html_page(title, *content, **arguments):
    head = html.head(
        html.link(rel="shortcut icon", href=config["favicon"]),
        html.title("{} - {}".format(title, config["title"])),
        html.style(style),
    )
    nav = html.nav(
        html.ul(
            html.li(html.a("⚗", href=html.absolute())),
            html.li(html.a("Reviews", href=html.absolute("reviews"))),
            html.li(html.a("Commits", href=html.absolute("commits", repo.head.ref.name))),
            html.li(html.a("Tree", href=html.absolute("tree", repo.head.ref.name))),
            html.li(html.a("Refs", href=html.absolute("refs"))),
        )
    )
    return http.Html(html.html(head, html.body(*((nav,) + content + (html.script(script),)), **arguments)))
Esempio n. 4
0
    def test(self) :
        self.assertEquals(breaks("hello world"),"\nhello world\n")
        self.assertEquals(p('hello world'),"<p>hello world</p>")
        self.assertEquals(div('hello world'),"<div>hello world</div>")
        self.assertEquals(div({'class':'myclass','id':'myd'},'hello world'),
                              """<div class="myclass" id="myd">hello world</div>""")

        self.assertEquals(div('a','b'),'<div>ab</div>')

        self.assertEquals(p(),'<p/>')

        self.assertEquals(html(
            head(),
            body(
                h2("Header"),
                p('para1'),
                p('para2')
                )),
            """<html><head/><body><h2>Header</h2><p>para1</p><p>para2</p></body></html>""")
Esempio n. 5
0
import html
import cgitb
import cgi
import re
import sys
#print "Content-Type: text/html\n\n";
cgitb.enable()
#form = cgi.FieldStorage()
from urllib import unquote
from store import connect_store store_ontology
from html import start_html, head, open_div, anchor, end_div, open_body, par, anchor ,end_body, end_html, heading_h1

import_list = sys.argv[2::1]

print start_html()
print head("Triples Storage System")
print open_body()
print open_div("", "main-content")
print heading_h1("Triples Storage System")
print par( "Connecting to the store..." )
graph = connect_store( sys.argv[1], sys.argv[2] )
for guri in import_list:
        print par( "Processing Your submission url: " + anchor( unquote( guri ), unquote( guri ) ) )
        store_ontology( graph, unquote( guri ) )
        print par("Imported Graph " + anchor( unquote( guri ), guri ) ) )
print par( anchor( "http://www.cs.nmsu.edu/~bchisham/cgi-bin/import", "Import another url" ) )
print end_div()
print end_body() 
print end_html()
Esempio n. 6
0
    # if POST method request
    if method == 'POST':
        form = request.split('\r\n')
        idx = form.index('')             # Find the empty line
        entry = form[idx:]               # Main content of the request

        try:
            first = entry[-1].split('=')[1].split('&')[0]
            second = entry[-1].split('=')[2].split('&')[0]
            third = entry[-1].split('=')[3]
            print first
            print second
            print third
        except:
            pass
        html.addtable(star.highchart('B003YUC4YI'))
        #html.addtable(singlecomment.highchart('B003YUC4YI'))
        content = html.head() + html.body0('B003YUC4YI') + html.foot()

        value = entry[-1].split('=')[-1]
        

        #content = html.head() + html.body(singleprice.highchart('B003YUC4YI')) + html.foot()
        conn.sendall(content)
        ######
        # More operations, such as put the form into database
        # ...
        ######
    # close connection
    conn.close()