コード例 #1
0
    def on_get(self, req, resp):

        resp.status = falcon.HTTP_200

        headers.html(resp)

        resp.body = renderer.render("settings.html", {})
コード例 #2
0
	def on_get(self, req, resp):
		current_user = users.get_current_user

		if current_user:
			raise falcon.redirects.HTTPFound('/home')

		resp.status = falcon.HTTP_200

		headers.html(resp)
		
		resp.body = renderer.render("index.html", {})
コード例 #3
0
ファイル: collections.py プロジェクト: rrees/link-drop
	def on_get(self, request, response):
		user = users.get_current_user()

		collections = [repositories.collections.to_map(c) for c in repositories.collections.all_collections(user, sort=True)]

		template_data = {
			"collections" : collections,
		}

		headers.html(response)
		response.status = falcon.HTTP_200
		response.body = renderer.render("collections/list.html", template_data)
コード例 #4
0
ファイル: collections.py プロジェクト: rrees/link-drop
	def on_get(self, req, resp, collection_id):
		resp.status = falcon.HTTP_200

		headers.html(resp)

		current_user = users.get_current_user()

		template_data = {
			'collection': repositories.collections.read(current_user, collection_id)
		}
		
		resp.body = renderer.render("collections/view.html", template_data)
コード例 #5
0
ファイル: collections.py プロジェクト: rrees/link-drop
    def on_get(self, req, resp, collection_id):
        resp.status = falcon.HTTP_200

        headers.html(resp)

        current_user = users.get_current_user()

        template_data = {
            'collection':
            repositories.collections.read(current_user, collection_id)
        }

        resp.body = renderer.render("collections/view.html", template_data)
コード例 #6
0
ファイル: collections.py プロジェクト: rrees/link-drop
    def on_get(self, request, response):
        user = users.get_current_user()

        collections = [
            repositories.collections.to_map(c)
            for c in repositories.collections.all_collections(user, sort=True)
        ]

        template_data = {
            "collections": collections,
        }

        headers.html(response)
        response.status = falcon.HTTP_200
        response.body = renderer.render("collections/list.html", template_data)
コード例 #7
0
ファイル: collections.py プロジェクト: rrees/link-drop
    def on_get(self, req, response, public_id):

        collection = repositories.collections.read_public_collection(public_id)

        if collection == None or not collection.public:
            headers.text(response)
            response.status = falcon.HTTP_404
            response.body = "Unknown collection"
            return

        template_data = {
            'collection': collection,
        }

        headers.html(response)
        response.status = falcon.HTTP_200
        response.body = renderer.render("collections/public/view.html",
                                        template_data)
コード例 #8
0
ファイル: collections.py プロジェクト: rrees/link-drop
	def on_get(self, req, response, public_id):

		collection = repositories.collections.read_public_collection(public_id)

		if collection == None or not collection.public:
			headers.text(response)
			response.status = falcon.HTTP_404
			response.body = "Unknown collection"
			return


		template_data = {
			'collection': collection,
		}

		headers.html(response)
		response.status = falcon.HTTP_200
		response.body = renderer.render("collections/public/view.html", template_data)
コード例 #9
0
ファイル: links.py プロジェクト: rrees/link-drop
	def on_get(self, request, response, collection_id, link_index):

		link_idx = int(link_index)

		response.status = falcon.HTTP_200

		headers.html(response)

		current_user = users.get_current_user()

		collection = repositories.collections.read(current_user, collection_id)
		link = collection.links[link_idx]

		template_data = {
			'collection': collection,
			'link': link,
			'link_index': link_idx,
		}
		
		response.body = renderer.render("collections/links/view.html", template_data)
コード例 #10
0
    def on_get(self, request, response, collection_id, link_index):

        link_idx = int(link_index)

        response.status = falcon.HTTP_200

        headers.html(response)

        current_user = users.get_current_user()

        collection = repositories.collections.read(current_user, collection_id)
        link = collection.links[link_idx]

        template_data = {
            'collection': collection,
            'link': link,
            'link_index': link_idx,
        }

        response.body = renderer.render("collections/links/view.html",
                                        template_data)
コード例 #11
0
def html():
    #Titulo y definición de estilos
    titlepage = headers.title("FrontFace for Python4")

    #Styles CSS
    style = []

    style.append("body {\n\t text-align: center;\n\t} \n")
    style.append("#principal {\n\t display: block; \n\t #DDDDDD; \n\t background: #DDDDDD; \n\t border: 1px solid #999999; \n\t padding: 15px; \n\t}\n")
    style.append("#titulo {\n\t color: #999999; \n\t font: bold 36px verdana, sans-serif; \n\t text-shadow:rgb(0,0,150) 3px 3px 5px; \n \t}\n")

    allStyles = ""

    for i in range(len(style)):
        allStyles = allStyles + style[i]

    style = styles.style(allStyles,"")

    #Definición de cabecera
    finalhead = merger.mergeTitleStyle(titlepage, style)

    #Definición de HTML
    #Cabecera:
    head = headers.head(finalhead)

    #Cuerpo
    spann = formatting.span(formatting.a("Estilos CSS", "index5.html"), "id = \"titulo\"")

    #Definición header
    header = body.header(spann, "id = \"principal\"")

    bodyHTML = headers.body(header,"")

    #html = headers.html5Tag(mergeHeadBody(head, body))
    atrbt = atrb.lang_("es")
    html = headers.html(merger.mergeHeadBody(head, bodyHTML), atrbt)

    #Despliega en pantalla
    #print_html.printHtml(html)

    #imprime contenido en un archivo
    #print_html.saveHtml(html, "index4")

    return html
コード例 #12
0
def html():
    #Definición de estilos
    #Styles CSS
    style = []

    style.append("* { margin:0px; padding: 0px;} \n")
    style.append("p { font-size: 12px;} \n")
    style.append("h1 h2 { font-size: 15px;} \n")
    style.append(
        "body {background-color: #F5DEB3; overflow: hidden; height: 100px}")
    style.append(
        "#header {background-color: #CD853F; height: 80px; overflow: hidden; border-bottom: 2px solid #000000;}\n"
    )
    style.append("#headtext {color: #FFFFFF; font: bold; font-size: 15px;}\n")
    style.append("#imgdiv { text-align: left; float: left;}\n")
    style.append(
        "#inputdiv {text-align: right; float:right; font-style: italic;}\n")
    style.append("#headerdiv {display: inline-block;}\n")
    style.append(
        "#column {overflow:hidden; float:right; height: 500px; width: 300px; text-align:right}\n"
    )
    style.append("#section {overflow:hidden;  height: 500px; width: 500px;}\n")
    style.append(
        ".boxeshead { display: inline-block; margin:0px; padding: 2px;}\n")
    style.append(
        ".boxes {clear: both; display: inline-block; margin:1px; padding: 2px; height: 100px; width: 200px;}\n"
    )
    style.append(".input{ border-radius: 0px; border: none; height: 20px; }\n")
    style.append(
        "#footertext {height: 500px vertical-align: middle; color: #CD853F; }\n"
    )
    style.append(
        "#footer {text-align: center; padding: 20px; border-top: 2px solid #000000; display: block; overflow: hidden; font-style: italic; color: #FFFFFF;}\n"
    )
    style.append(
        "#login { background-color: #8B4513; border: 1px solid #8B4513; width: 100px; height: 22px; padding: 0px; font: bold; color: #FFFFFF; }\n"
    )
    style.append(
        ".register {background-color: #006400; height: 30px; width: 100px; color: #FFFFFF; border-radius: 50px;}\n"
    )
    style.append(
        "#nav {background-color: #F5DEB3; height: 20px; width: 100%; color: #FFFFFF; border-bottom: 2px solid #000000;}\n"
    )

    allStyles = ""

    for i in range(len(style)):
        allStyles = allStyles + style[i]

        cssScripts = styles.style(allStyles, atrb.type_("text/css"))

        #Titulo y definición de estilos
        titlepage = headers.title("Estad&iacutestica con Python")

        scriptFiles = headers.script(
            "",
            atrb.type_("text/javascript") + atrb.src_("scripts/statpy.js"))

        #definición de head
        head = headers.head(titlepage + cssScripts + scriptFiles)

    #definición barra navegacion

    #elementos de header
    #Image
    imageatrb = atrb.id_("headimage") + atrb.src_(
        "images/head.png") + atrb.title_("Hola")
    headimage = image.img(imageatrb)
    imgdiv = body.div(headimage, atrb.id_("imgdiv") + atrb.class_("boxeshead"))

    #UserInput
    textoU = formatting.span("Usuario:", atrb.id_("headtext"))
    inputatrb = atrb.id_("usuario") + atrb.type_("text") + atrb.maxlength_(
        "20") + atrb.class_("input")
    inputU = controls.input_(inputatrb)

    #PassInput
    textoP = formatting.span("Password:"******"headtext"))
    inputatrb2 = atrb.id_("password") + atrb.type_(
        "password") + atrb.maxlength_("10") + atrb.class_("input")
    inputP = controls.input_(inputatrb2)

    #ButtonLogin
    inputatrb3 = atrb.id_("login") + atrb.type_("submit")
    submit = controls.button("Login", inputatrb3)

    space = formatting.span(" ", "")
    headercont = textoU + inputU + space + textoP + inputP + space + submit
    inputdiv = body.div(headercont,
                        atrb.id_("inputdiv") + atrb.class_("boxeshead"))

    #header
    header = body.header(imgdiv + inputdiv, atrb.id_("header"))

    #nav
    nav = body.nav("", atrb.id_("nav"))

    #Section

    h1 = formatting.h1("PythonStatistics",
                       atrb.style_(styles.text_align("center")))

    ps1text = """Python Statistics es un proyecto experimental 
de integración desarrollo web con 
análisis de datos descriptivos, 
inferenciales y modelaje tanto en Machine 
Learning, Big Data, así como Bussiness Intelligence"""

    ps1 = formatting.p(ps1text, atrb.style_(styles.text_align("justify")))

    section1 = body.section(h1 + ps1,
                            atrb.id_("section") + atrb.class_("boxes"))

    #Aside
    h2 = formatting.h3("Regístrese",
                       atrb.style_(styles.text_align("center")))
    psa = """Para acceder a nuestros servicios debe crear una cuenta, es gratis,
favor leer nuestros términos y condiciones, y aprobarlos al final de su registro.
Aseguramos completa confidencialidad de sus datos. """
    ahref = formatting.a("Términos y Condiciones.", "")
    finaltext = h2 + formatting.p(psa + ahref,
                                  atrb.style_(styles.text_align("justify")))

    textobutton = formatting.span("Sign up",
                                  atrb.font_(styles.face("verdana")))
    asidebutton = controls.button(
        textobutton,
        atrb.class_("register") + atrb.style_(styles.text_align("center")))
    salto = formatting.br("")

    aside = body.aside(finaltext + salto + asidebutton,
                       atrb.id_("column") + atrb.class_("boxes"))

    #Div
    div = body.div(
        formatting.span(section1 + aside, ""),
        atrb.style_(styles.background("#FFFFFF") + styles.overflow("hidden")))

    #Footer
    footerimage = image.img(
        atrb.id_("footerimage") + atrb.src_("images/footer.png"))
    footertext = formatting.span("Derechos reservados &copy 2016",
                                 atrb.id_("footertext"))
    footercont = footerimage + formatting.br("") + footertext
    footer = body.footer(footercont, atrb.id_("footer"))

    #body
    allbodyComponents = header + nav + div + footer
    bodyHTML = headers.body(allbodyComponents, "")

    #Definición doctype y html (preprocesadores)
    doctype = headers.doctype("")
    atribute = atrb.lang_("es")
    html = headers.html(merger.mergeHeadBody(head, bodyHTML), atribute)

    #documento
    document = doctype + html

    #Despliega en pantalla
    #print_html.printHtml(document)

    #imprime contenido en un archivo para pruebas
    #print_html.saveHtml(document, "statpy")

    #imprime linea por linea:
    #read_html.printreadHtml("statpy.html")

    return document
コード例 #13
0
def html():
    #Titulo y definición de estilos
    titlepage = headers.title("FrontFace for Python")

    #Styles CSS
    style1 = "* { margin:0px; padding: 0px; } \n"
    style2 = "p { font-size: 20px; } \n"
    style3 = "nav { font-size: 20px; } \n"
    style4 = "div { font-size: 20px; } \n"

    allStyles = style1 + style2 + style3

    style = styles.style(allStyles, "")

    #Definición de cabecera
    finalhead = merger.mergeTitleStyle(titlepage, style)

    #Definición de HTML
    #Cabecera:
    head = headers.head(finalhead)

    #Cuerpo

    #Items List
    item1 = listing.li("Principal","")
    item2 = listing.li("Fotos","")
    item3 = listing.li("Videos","")
    item4 = listing.li("Contacto","")

    AllItems = item1 + item2 + item3 + item4

    #Definición Ul
    ulDefinition = listing.ul(formatting.span(AllItems,""),"")

    #Defincion Navigator
    navigator = body.nav(body.div(ulDefinition, ""),"")

    #Definición header
    header = body.header(formatting.h1("Front Face for Python", ""),"")

    #Definición de articulos
    #Articulo 1
    titulo11 = formatting.h1("Titulo mensaje1", "")
    titulo12 = formatting.h2("Subtitulo mensaje1", "")
    textop1 = formatting.p(formatting.time("publicado 16-11-2016", "2016-11-16"),"")
    message1 = merger.mergeThreeComponents(titulo11,titulo12,textop1)
    headerA1 = body.header(message1,"")
    textoA1 = "Este es el texto primer Mensaje"
    footerA1 = body.footer(formatting.p("Primer comentario",""),"")
    image1 = image.img(atrb.src_("http://www.estudiantes.info/ciencias_naturales/images/lobo-solo.png"))
    figcaption1 = body.figcaption("Esta es la imagen 1", "")
    figures = image1 + figcaption1
    figure = body.figure(figures, "")
    articuloTexto1 = headerA1 + textoA1 + footerA1 + figures
    articulo1 = body.article(articuloTexto1, "")

    #Articulo2
    titulo21 = formatting.h1("Titulo mensaje2", "")
    titulo22 = formatting.h2("Subtitulo mensaje2", "")
    textop2 = formatting.p("publicado 16-11-2016","")
    message2 = merger.mergeThreeComponents(titulo21,titulo22,textop2)
    headerA2 = body.header(message2,"")
    address2 = "index2.html"
    textoA2 = formatting.a("Este es el texto segundo Mensaje", address2)
    footerA2 = body.footer(formatting.p("Segundo comentario",""),"")
    articuloTexto2 = headerA2 + textoA2 + footerA2
    articulo2 = body.article(articuloTexto2, "")

    mergedArt = merger.mergeTwoComponents(articulo1, articulo2)

    #Definición sección
    mySection = body.section(mergedArt,"")

    #Definición de lado derecho
    bloque1= formatting.blockquote("texto numero 1", "")
    bloque2= formatting.blockquote("texto numero 2", "")
    myAside = body.aside(merger.mergeTwoComponents(bloque1, bloque2),"")

    #Definición del footer
    myFooter = body.footer(formatting.small("Derechos Reservados &copy 2016"),"")

    #MezclaComponentes
    navheader = merger.mergeTwoComponents(navigator, header)
    sectaside = merger.mergeTwoComponents(mySection, myAside)

    bodyHTML = headers.body(merger.mergeTwoComponents(navheader, sectaside),"")

    #html = headers.html5Tag(mergeHeadBody(head, body))
    atrbt = atrb.lang_("es")
    html = headers.html(merger.mergeHeadBody(head, bodyHTML), atrbt)

    #Despliega en pantalla
    #print_html.printHtml(html)

    #imprime contenido en un archivo
    #print_html.saveHtml(html, "index")

    return html
コード例 #14
0
def html():
    #Definición de estilos
    #Styles CSS
    style = []

    style.append("* { margin 0px; padding: 0px;}\n")
    style.append("html { max-width 500px; max-height: 550px;}\n")
    style.append("body {margin 0px, padding: 0px; background: linear-gradient(blue, white);}\n")
    style.append("#header { margin 0px; padding: 0px; background: linear-gradient(blue, white); height: 80px; width: 100%; overflow: hidden; border-bottom: 1px solid #000000; color: red; text-shadow: 5px 5px 5px #000000;}\n")
    style.append("#footer { margin 0px; padding: 0px; height: 80px; width: 100%; overflow: hidden; border-top: 1px solid #000000;}\n")
    style.append(".textbox {width: 200px; height: 20px; border: 1px solid #000000; border-radius: 5px; box-shadow: 5px 5px 10px #888888;}\n")
    style.append("#div { margin 0px; padding: 0px;  width: 100%; height: 600px; }\n")
    style.append(".nav { margin 0px; padding: 0px; width: 100%; height: 20px; text-align: center; background: gray; border-bottom: 1px solid #000000;}\n")
    style.append("#button { width: 70px; height: 20px; float: left; border: 1px solid #000000; border-radius: 2px; box-shadow: 5px 5px 10px #888888; transform: translate(550%, 50%);}\n")
    style.append("#section1 { margin: 5px; padding: 5px; width: 500px; height: 100px; overflow: hidden; border: 1px solid #000000; text-align: center; border-radius: 5px; box-shadow: 10px 10px 5px #888888; transform: translate(35%, 0%);}\n")
    style.append("#section2 { margin: 5px; padding: 5px; width: 500px; height: 350px; overflow: hidden; border: 1px solid #000000; text-align: center; border-radius: 5px; box-shadow: 10px 10px 5px #888888; transform: translate(35%, 0%);}\n")
    
    allStyles = ""
    
    for i in range(len(style)):
        allStyles = allStyles + style[i]
        
        cssScripts = styles.style(allStyles, atrb.type_("text/css"))
        
        
        #Titulo y definición de estilos
        titlepage = headers.title("Ingreso datos usuario")
        
        scriptFiles = headers.script("", atrb.type_("text/javascript")+ atrb.src_("scripts/statpy.js"))
        
        #definición de head
        head = headers.head(titlepage + cssScripts + scriptFiles)
        

    #definición barra navegacion
    
    #elementos de header
    
    #header
    text = formatting.h1("Python Rules!","")
    header = body.header(text, atrb.id_("header") + atrb.style_(styles.text_align("center")))
    
    #nav
    nav = body.nav(" ", atrb.class_("nav"))
    
    
    #Section
    
    h1 = formatting.h1("Registro:", atrb.style_(styles.text_align("center")))
    
    ps1text = "Favor complete los siguientes campos con la información solicitada."
    ps1 = formatting.p(ps1text,atrb.style_(styles.text_align("justify") + styles.font_style("italic") + styles.font_size("15px")))

    ps2 = formatting.p("Nombre Usuario:", "")
    input1 = controls.input_(atrb.id_("nombre") + atrb.type_("text") + atrb.class_("textbox"))
    
    ps3 = formatting.p("E-mail:", "")
    input2 = controls.input_(atrb.id_("correo") + atrb.type_("email") + atrb.class_("textbox"))
    
    ps4 = formatting.p("Ingresar password:"******"")
    input3 = controls.input_(atrb.id_("password1") + atrb.type_("password") + atrb.class_("textbox"))
    
    ps5 = formatting.p("Confirmar password:"******"")
    input4 = controls.input_(atrb.id_("password2") + atrb.type_("password") + atrb.class_("textbox"))
    
    button = formatting.p(controls.button("Registrar", atrb.id_("button")), atrb.style_(styles.float_("center")))
    
    components = ps2 + input1 + ps3 + input2 + ps4 + input3 + ps5 + input4
    
    section1 = body.section(h1 + ps1, atrb.id_("section1"))
    section2 = body.section(components + button, atrb.id_("section2") + atrb.class_("boxes"))


    #Salto
    salto = formatting.br("")

    #Div
    div = body.div(salto + section1 + salto + section2 + salto , atrb.id_("div") + atrb.style_(styles.background("#FFFFFF") + styles.text_align("center")))
    
    
    #Footer
    footertext = formatting.span("Derechos reservados &copy 2016", atrb.id_("footertext") )
    footercont = formatting.br("") + footertext
    footer = body.footer(footercont, atrb.id_("footer") + atrb.style_(styles.text_align("center")))
    
    
    #body
    allbodyComponents = header + nav + div + footer
    bodyHTML = headers.body(allbodyComponents, "")
    
    #Definición doctype y html (preprocesadores)
    doctype = headers.doctype("")
    atribute = atrb.lang_("es")
    html = headers.html(merger.mergeHeadBody(head, bodyHTML), atribute)
    
    #documento
    document = doctype + html

    #Despliega en pantalla
    #print_html.printHtml(document)

    #imprime contenido en un archivo para pruebas
    #print_html.saveHtml(document, "statpy")

    #imprime linea por linea:
    #read_html.printreadHtml("statpy.html")

    return document
コード例 #15
0
def html():
    #Definición de estilos
    #Styles CSS
    style = []

    style.append("* { margin 0px; padding: 0px;}\n")
    
    allStyles = ""
    
    for i in range(len(style)):
        allStyles = allStyles + style[i]
        
        cssScripts = styles.style(allStyles, atrb.type_("text/css"))
        
        
        #Titulo y definición de estilos
        titlepage = headers.title("Canvas")
        
        
        #definición de head
        head = headers.head(titlepage + cssScripts)
        

    #definición barra navegacion
    
    #elementos de header
    
    #header
    text = formatting.h1("Canvas!","")
    header = body.header(text, atrb.id_("header") + atrb.style_(styles.text_align("center")))
    
    #Canvas
    canvasatrb = atrb.id_("myCanvas") + atrb.width_("300") + atrb.height_("150") + atrb.style_(styles.border("1px solid #d3d3d3;"))
    canvas = image.canvas("", canvasatrb)

    #SCript
    scriptlist = []
    
    scriptlist.append("var c = document.getElementById(\"myCanvas\");\n")
    scriptlist.append("var ctx = c.getContext(\"2d\");\n")
    scriptlist.append("ctx.beginPath();\n")
    scriptlist.append("ctx.moveTo(20,20);\n")
    scriptlist.append("ctx.lineTo(20,100);\n")
    scriptlist.append("ctx.lineTo(70,100);\n")
    scriptlist.append("ctx.strokeStyle=\"red\";\n")
    scriptlist.append("ctx.stroke();\n")

    script = ""    
    for i in range(len(scriptlist)):
        script = script + scriptlist[i]
        
    myScript = headers.script(script, "")
    
    #body
    allbodyComponents = canvas + myScript
    bodyHTML = headers.body(allbodyComponents, "")
    
    #Definición doctype y html (preprocesadores)
    doctype = headers.doctype("")
    atribute = atrb.lang_("es")
    html = headers.html(merger.mergeHeadBody(head, bodyHTML), atribute)
    
    #documento
    document = doctype + html

    

    return document
コード例 #16
0
def html():
    #Titulo y definición de estilos
    titlepage = headers.title("FrontFace for Python2")

    #Styles CSS
    style = []

    style.append("* {\n \t margin:0px;\n \t padding: 0px; \n \t} \n")
    style.append(
        "#header {\n \t margin: auto;\n \t width: 500px; \n \t font-family: Arial;\n \t} \n"
    )
    style.append("ul, ol {\n \t list-style: none;\n \t} \n")
    style.append(".nav > li {\n \t float: left; \n \t} \n")
    style.append(
        ".nav li a {\n \t background-color:#000; \n \t color:#fff; \n \t text-decoration:none; \n \t padding: 10px 12px;\n \t display: block;\n \t} \n"
    )
    style.append(".nav li a:hover {\n \t background-color: #434343;\n \t} \n")
    style.append(
        ".nav li ul {\n \t display: none;\n \t position: absolute;\n \t min-width: 140px;\n \t} \n"
    )
    style.append(".nav li:hover > ul {\n \t display: block; \n \t} \n")
    style.append(".nav li ul li {\n \t position: relative; \n \t} \n")
    style.append(
        ".nav li ul li ul {\n \t right: -140px;\n \t top:0px; \n \t} \n")

    allStyles = ""

    for i in range(len(style)):
        allStyles = allStyles + style[i]

    style = styles.style(allStyles, "")

    #Definición de cabecera
    finalhead = merger.mergeTitleStyle(titlepage, style)

    #Definición de HTML
    #Cabecera:
    head = headers.head(finalhead)

    #Cuerpo

    #Items Menu Principal
    item1 = listing.li(formatting.a("Inicio", "index3.html"), "")

    #Servicios:
    subitemA1 = listing.li(formatting.a("Sub1", ""), "")
    subitemA2 = listing.li(formatting.a("Sub2", ""), "")
    subitemA3 = listing.li(formatting.a("Sub3", ""), "")

    SubMenus = subitemA1 + subitemA2 + subitemA3
    Servicios = formatting.a("Servicios", "") + listing.ul(SubMenus, "")
    item2 = listing.li(Servicios, "")

    #Acerca de:
    subitemB1 = listing.li(formatting.a("Sub1", ""), "")
    subitemB2 = listing.li(formatting.a("Sub2", ""), "")

    subitemC1 = listing.li(formatting.a("Sub1", ""), "")
    subitemC2 = listing.li(formatting.a("Sub2", ""), "")
    subMenusC = subitemC1 + subitemC2

    subitemB3Menu = formatting.a("Sub3", "") + listing.ul(subMenusC, "")
    subitemB3 = listing.li(subitemB3Menu, "")

    SubMenusB = subitemB1 + subitemB2 + subitemB3
    Acercade = formatting.a("Acercade", "") + listing.ul(SubMenusB, "")
    item3 = listing.li(Acercade, "")

    item4 = listing.li(formatting.a("Contacto", ""), "")

    AllItems = item1 + item2 + item3 + item4

    #Definición Ul
    ulDefinition = listing.ul(AllItems, "class =\"nav\"")

    #Defincion Navigator
    div = body.div(ulDefinition, "id =\"header\"")

    #Definición header
    header = body.header(formatting.h1("Front Face for Python2", ""), "")

    #MezclaComponentes
    navheader = merger.mergeTwoComponents(header, div)

    images = image.img(
        atrb.src_(
            "http://www.estudiantes.info/ciencias_naturales/images/lobo-solo.png"
        ))
    finalbody = navheader + images

    bodyHTML = headers.body(finalbody, "")

    #html = headers.html5Tag(mergeHeadBody(head, body))
    atrbt = atrb.lang_("es")
    html = headers.html(merger.mergeHeadBody(head, bodyHTML), atrbt)

    #Despliega en pantalla
    #print_html.printHtml(html)

    #imprime contenido en un archivo
    #print_html.saveHtml(html, "index2")

    return html
コード例 #17
0
def html():
    #Titulo y definición de estilos
    titlepage = headers.title("FrontFace for Python5")

    #Styles CSS
    style = []

    style.append("head {\n\t background: #DDDDDD;\n\t} \n")
    style.append(
        "body {\n\t text-align: center;\n\t background: #DDDCCC;\n\t} \n")
    style.append("div {\n\t background: #CCCCCC;\n\t} \n")
    style.append("img {\n\t border: 2px solid #000000;\n\t} \n")
    style.append("header, section, nav {\n\t display: block;\n\t} \n")
    style.append("nav {\n\t margin: 5px 0px;\n\t background: #999999 \n\t} \n")
    style.append(
        "#reproducir {\n\t width: 100px;\n\t text-align: center;\n\t } \n")
    style.append(
        "#principal {\n\t display: block; \n\t border: 1px solid #999999; \n\t padding: 15px; \n\t}\n"
    )
    style.append(
        "#reproductor {\n\t width: 720px; \n\t margin: 20px auto; \n\t -moz-border-radius: 5px; \n\t \n\t background: #999999;\n\t border: 1px solid #666666; \n\t}\n"
    )
    style.append(
        "#barra {\n\t positin: relative; \n\t float: left; \n\t width: 600px; \n\t \n\t height: 16px; \n\t padding: 2px; \n\t border: 1px solid #CCCCCC; \n\t background: #EEEEEE; \n\t}\n"
    )
    style.append(
        "#botones {\n\t float: left; \n\t width: 100px;\n\t  height: 20px; \n\t}\n"
    )
    style.append(
        "#progreso {\n\t position: absolute; \n\t width: 0px;\n\t  height: 16px; \n\t background: rgba(0,0,150,0.2); \n\t}\n"
    )

    allStyles = ""

    for i in range(len(style)):
        allStyles = allStyles + style[i]

    style = styles.style(allStyles, "")

    #Script JavaScript
    script = []

    #funciones embebidas
    script.append("")

    allScript = ""

    for i in range(len(script)):
        allScript = allScript + script[i]

    scripts = headers.script(
        allScript,
        atrb.type_("text/javascript") + atrb.src_("script.js"))

    #Definición de cabecera
    finalhead = merger.mergeThreeComponents(titlepage, style, scripts)

    #Definición de HTML
    #Cabecera:
    head = headers.head(finalhead)

    #Cuerpo

    firstLine = formatting.p("Hacer Click", "")
    secondLine = formatting.p("No se puede hacer click", "")
    divContent = firstLine + secondLine
    div = body.div(divContent, atrb.id_("principal"))
    comentario = body.comment("Hola esto es un simple comentario")

    videoatributes = atrb.id_("medio") + atrb.width_("720") + atrb.height_(
        "400") + atrb.preload_("metadata") + atrb.controls_() + atrb.loop_(
        ) + atrb.poster_("http://minkbooks.com/content/poster.jpg")
    source1 = multimedia.source(
        "http://phyc.net/gallery2/m/25891-3/Chuck+G_4-5-2014-1.mp4", "")
    source2 = multimedia.source(
        "http://phyc.net/gallery2/m/25891-3/Chuck+G_4-5-2014-1.mp4", "")

    video1 = multimedia.video(source1 + source2, videoatributes)
    button1 = controls.button(
        "Reproducir",
        atrb.type_("button") + atrb.width_("500") + atrb.id_("reproducir"))
    div1 = body.div(button1, atrb.id_("botones"))
    divA = body.div("", atrb.id_("progreso"))
    div2 = body.div(divA, atrb.id_("barra"))
    div3 = body.div("", atrb.style_("clear: both"))
    nav1 = body.nav(comentario + div1 + div2 + div3, "")
    atrbute = atrb.id_("busqueda") + atrb.type_("search") + atrb.name_(
        "busqueda") + atrb.form_("formulario")
    input1 = controls.input_(atrbute)
    nav2 = body.nav(input1, "")
    section1 = body.section(video1 + nav1, atrb.id_("reproductor"))

    input2 = controls.input_(
        atrb.type_("text") + atrb.name_("nombre") + atrb.id_("nombre"))
    input3 = controls.input_(atrb.type_("submit") + atrb.value_("Enviar"))
    atrbform = atrb.name_("formulario") + atrb.id_(
        "formulario") + atrb.method_("get")
    form1 = controls.form(input2 + input3, atrbform)

    htmlImagen = "http://fravega.vteximg.com.br/arquivos/ids/287736-1000-1000/780642_1.jpg"
    imagen2 = image.img(
        atrb.src_(htmlImagen) + atrb.width_("100") + atrb.height_("100"))
    section3 = body.section(imagen2, "")

    section2 = body.section(form1, "")
    break_ = formatting.br("")

    allbodyComponents = div + nav2 + section1 + break_ + section2 + break_ + section3

    bodyHTML = headers.body(allbodyComponents, "")

    #html = headers.html5Tag(mergeHeadBody(head, body))
    atrbt = atrb.lang_("es")
    html = headers.html(merger.mergeHeadBody(head, bodyHTML), atrbt)

    #Despliega en pantalla
    #print_html.printHtml(html)

    #imprime contenido en un archivo
    #print_html.saveHtml(html, "index5")

    return html
コード例 #18
0
def html():
    #Titulo y definición de estilos
    titlepage = headers.title("FrontFace for Python6")
    
    #Styles CSS
    style = []
    
    style.append("head {\n\t background: #DDDDDD;\n\t} \n")
    style.append("body {\n\t text-align: center;\n\t background: #DDDCCC;\n\t} \n")
    style.append("div {\n\t background: #CCCCCC;\n\t} \n")
    style.append("section {\n\t background: #EEEEEE;\n\t} \n")
    style.append("header, section, nav {\n\t display: block;\n\t} \n")
    style.append("nav {\n\t margin: 5px 0px;\n\t background: #999999 \n\t} \n")
    style.append("#reproducir {\n\t width: 100px;\n\t text-align: center;\n\t } \n")
    style.append("#principal {\n\t display: block; \n\t border: 1px solid #999999; \n\t padding: 15px; \n\t}\n")
    style.append("#reproductor {\n\t width: 720px; \n\t margin: 20px auto; \n\t -moz-border-radius: 5px; \n\t \n\t background: #999999;\n\t border: 1px solid #666666; \n\t}\n")
    style.append("#barra {\n\t positin: relative; \n\t float: left; \n\t width: 600px; \n\t \n\t height: 16px; \n\t padding: 2px; \n\t border: 1px solid #CCCCCC; \n\t background: #EEEEEE; \n\t}\n")
    style.append("#botones {\n\t float: left; \n\t width: 100px;\n\t  height: 20px; \n\t}\n")
    style.append("#progreso {\n\t position: absolute; \n\t width: 0px;\n\t  height: 16px; \n\t background: rgba(0,0,150,0.2); \n\t}\n")

    allStyles = ""

    for i in range(len(style)):
        allStyles = allStyles + style[i]

    style = styles.style(allStyles,"")

    #Script JavaScript
    script = []

    #funciones embebidas
    script.append("")

    allScript = ""

    for i in range(len(script)):
        allScript = allScript + script[i]

    scripts = headers.script(allScript, atrb.type_("text/javascript")+ atrb.src_("script2.js"))

    #Definición de cabecera
    finalhead = merger.mergeThreeComponents(titlepage, style, scripts)

    #Definición de HTML
    #Cabecera:
    head = headers.head(finalhead)

    #Cuerpo
    message = "Su navegador no soporta el elemento"
    canvas = image.canvas(message, atrb.id_("lienzo") + atrb.width_("500") + atrb.height_("300"))
    section = body.section(canvas, atrb.id_("cajalienzo"))


    allbodyComponents = section 

    bodyHTML = headers.body(allbodyComponents,"")

    #html = headers.html5Tag(mergeHeadBody(head, body))
    atrbt = atrb.lang_("es")
    html = headers.html(merger.mergeHeadBody(head, bodyHTML), atrbt)

    #Despliega en pantalla
    #print_html.printHtml(html)

    #imprime contenido en un archivo
    #print_html.saveHtml(html, "index6")

    return html
コード例 #19
0
def html():
    #Titulo y definición de estilos
    titlepage = headers.title("FrontFace for Python3")

    #Styles CSS
    style = []

    style.append("* {\n\t margin:0px;\n\t padding: 0px;\n\t} \n")
    style.append(
        "#agrupar {\n\t width: 960px;\n\t margin: 15px auto;\n\t text-align: left;\n\t} \n"
    )
    style.append(
        "h1 {\n\t font: bold 20px verdana, sans-serif;\n\t text-align: center;\n\t}\n"
    )
    style.append("h2 {\n\t font: bold 14px verdana, sans-serif;\n\t}\n")
    style.append("footer {\n\t display: block; \n\t}\n")
    style.append(
        "#image {\n\t display: block; \n\t margin-left: auto; \n\t margin-right: auto; \n\t}\n"
    )
    style.append("body {\n\t background: #999999; \n\t}\n")
    style.append(
        "#cabecera {\n\t background: #FFFBB9; \n\t border: 1px solid #999999; \n\t padding: 20px; \n\t}\n"
    )
    style.append(
        "#menu {\n\t background: #CCCCCC; \n\t padding: 5px 15px; \n\t}\n")
    style.append(
        "#menu li {\n\t display: inline-block; \n\t list-style: none; \n\t padding: 5px; \n\t}\n"
    )
    style.append(
        "#columna {\n\t float: left; \n\t width: 220px; \n\t margin: 20px 0px; \n\t background: #CCCCC;}\n"
    )
    style.append(
        "#seccion {\n\t float: left; \n\t width: 660px; \n\t margin: 20px; \n\t}\n"
    )
    style.append(
        "#pie {\n\t clear: both; \n\t text-align: center; \n\t padding: 20px; \n\t border-top: 2px solid #DDDDDD; \n\t}\n"
    )
    style.append(
        "div {\n\t width: 100px; \n\t margin: 20px; \n\t padding: 10px; \n\t border: 1px solid #000000; \n\t -moz-box-sizing: border-box; \n\t}\n"
    )

    allStyles = ""

    for i in range(len(style)):
        allStyles = allStyles + style[i]

    style = styles.style(allStyles, "")

    #Definición de cabecera
    finalhead = merger.mergeTitleStyle(titlepage, style)

    #Definición de meta
    metachar = headers.metaCharset("iso-8859-1")
    metadesc = headers.metaDescription("Ejemplo HTML5")
    metakeyw = headers.metaKeywords("html5, css3")

    metaLine = metachar + metadesc + metakeyw
    finalhead = finalhead + metaLine

    #Definición de HTML
    #Cabecera:
    head = headers.head(finalhead)

    #Cuerpo

    #Items List
    item1 = listing.li(formatting.a("Principal", "index.html"), "")
    item2 = listing.li("Fotos", "")
    item3 = listing.li("Videos", "")
    item4 = listing.li("Contacto", "")

    AllItems = item1 + item2 + item3 + item4

    #Definición Ul
    ulDefinition = listing.ul(AllItems, "")

    #Defincion Navigator
    navigator = body.nav(ulDefinition, "id = \"menu\"")

    #Definición header
    header = body.header(formatting.h1("Front Face for Python3", ""),
                         "id = \"cabecera\"")

    myFooter = body.footer("Derechos reservados &copy 2016", "id = \"pie\"")
    headerArt = formatting.h1("Titulo1", "")
    imgsource = "https://upload.wikimedia.org/wikipedia/commons/thumb/4/46/Tizian_-_Danae_receiving_the_Golden_Rain_-_Prado.jpg/800px-Tizian_-_Danae_receiving_the_Golden_Rain_-_Prado.jpg"
    image2 = image.img(atrb.src_(imgsource))

    artic = headerArt + image2 + myFooter
    myArticle = body.article(artic, "")

    mySection1 = body.section("hola", "id = \"seccion\"")
    myAside = body.aside(formatting.a("hola", "index4.html"),
                         "id = \"columna\"")

    AllDiv = header + navigator + mySection1 + myAside + myArticle
    #Definición del div
    div = body.div(AllDiv, "id = \"agrupar\"")
    bodyHTML = div

    #html = headers.html5Tag(mergeHeadBody(head, body))
    atrbt = atrb.lang_("es")
    html = headers.html(merger.mergeHeadBody(head, bodyHTML), atrbt)

    #Despliega en pantalla
    #print_html.printHtml(html)

    #imprime contenido en un archivo
    #print_html.saveHtml(html, "index3")
    return html
コード例 #20
0
def html():
    #Titulo y definición de estilos
    titlepage = headers.title("FrontFace for Python6")

    #Styles CSS
    style = []

    style.append(
        ".cajas {\r\t display: inline-block;\r\t margin: 10px;\r\t padding: 5px;\r\t border: 1px solid #999999;\r\t} \r"
    )

    allStyles = ""

    for i in range(len(style)):
        allStyles = allStyles + style[i]

    style = styles.style(allStyles, "")

    #Script JavaScript
    script = []

    #funciones embebidas
    script.append("")

    allScript = ""

    for i in range(len(script)):
        allScript = allScript + script[i]

    scripts = headers.script(
        allScript,
        atrb.type_("text/javascript") + atrb.src_("script3.js"))

    #Definición de cabecera
    finalhead = merger.mergeThreeComponents(titlepage, style, scripts)

    #Definición de HTML
    #Cabecera:
    head = headers.head(finalhead)

    #Cuerpo
    address = "http://phyc.net/gallery2/m/25891-3/Chuck+G_4-5-2014-1.mp4"
    source1 = multimedia.source(address, "")
    source2 = multimedia.source(address, "")
    video = multimedia.video(
        source1 + source2,
        atrb.id_("medio") + atrb.width_("483") + atrb.height_("272"))
    section1 = body.section(video, atrb.class_("cajas"))

    message = "Su navegador no soporta el elemento"
    canvas = image.canvas(
        message,
        atrb.id_("lienzo") + atrb.width_("483") + atrb.height_("272"))
    section2 = body.section(canvas, atrb.class_("cajas"))

    allbodyComponents = section1 + section2

    bodyHTML = headers.body(allbodyComponents, "")

    #html = headers.html5Tag(mergeHeadBody(head, body))
    atrbt = atrb.lang_("es")
    html = headers.html(merger.mergeHeadBody(head, bodyHTML), atrbt)

    #Despliega en pantalla
    #print_html.printHtml(html)

    #imprime contenido en un archivo
    #print_html.saveHtml(html, "index7")

    return html