def render(self): print '<form method="%s" action="%s">' % \ (self.method, self.url or threadvars.req.uri()) for i in self.items: print as_html(i) print self.submit.as_html() print '</form>'
style = """<style> td,th { padding: 3px; } tr { background: #eee; } th { text-align: left; vertical-align: top; } </style>""" dir = sys.argv[2] index = open(dir + "/index.html", "w") print >> index, "<html>\n<head><title>MARC records</title>" + style + "</head>\n<body>\n<ul>" rec_no = 0 for data, length in read_file(open(sys.argv[1])): rec_no += 1 rec = build_record(data) title = rec['title'] filename = dir + "/" + str(rec_no) + ".html" f = open(filename, 'w') print >> f, "<html>\n<head><title>" + title + "</title>" + style + "</head>\n<body>" print >> f, '<a href="index.html">Back to index</a><br>' print >> f, output_record_as_html(rec) print >> f, "<h2>MARC record</h2>" print >> f, as_html(data) print >> f, '<br>\n<a href="index.html">Back to index</a>' print >> f, "</body></html>" print >> index, '<li><a href="%d.html">%s</a>' % (rec_no, title) print >> index, "</ul>\n</body></html>"
tr { background: #eee; } th { text-align: left; vertical-align: top; } </style>""" dir = sys.argv[2] index = open(dir + "/index.html", "w") print("<html>\n<head><title>MARC records</title>" + style + "</head>\n<body>\n<ul>", file=index) rec_no = 0 for data, length in read_file(open(sys.argv[1])): rec_no += 1 rec = build_record(data) title = rec['title'] filename = dir + "/" + str(rec_no) + ".html" f = open(filename, 'w') print("<html>\n<head><title>" + title + "</title>" + style + "</head>\n<body>", file=f) print('<a href="index.html">Back to index</a><br>', file=f) print(output_record_as_html(rec), file=f) print("<h2>MARC record</h2>", file=f) print(as_html(data), file=f) print('<br>\n<a href="index.html">Back to index</a>', file=f) print("</body></html>", file=f) print('<li><a href="%d.html">%s</a>' % (rec_no, title), file=index) print("</ul>\n</body></html>", file=index)
return '<table>' + ''.join(rows) + '</table>' style = """<style> td,th { padding: 3px; } tr { background: #eee; } th { text-align: left; vertical-align: top; } </style>""" dir = sys.argv[2] index = open(dir + "/index.html", "w") print("<html>\n<head><title>MARC records</title>" + style + "</head>\n<body>\n<ul>", file=index) rec_no = 0 for data, length in read_file(open(sys.argv[1])): rec_no += 1 rec = build_record(data) title = rec['title'] filename = dir + "/" + str(rec_no) + ".html" f = open(filename, 'w') print("<html>\n<head><title>" + title + "</title>" + style + "</head>\n<body>", file=f) print('<a href="index.html">Back to index</a><br>', file=f) print(output_record_as_html(rec), file=f) print("<h2>MARC record</h2>", file=f) print(as_html(data), file=f) print('<br>\n<a href="index.html">Back to index</a>', file=f) print("</body></html>", file=f) print('<li><a href="%d.html">%s</a>' % (rec_no, title), file=index) print("</ul>\n</body></html>", file=index)
return '<table>' + ''.join(rows) + '</table>' style = """<style> td,th { padding: 3px; } tr { background: #eee; } th { text-align: left; vertical-align: top; } </style>""" dir = sys.argv[2] index = open(dir + "/index.html", "w") print >> index, "<html>\n<head><title>MARC records</title>" + style + "</head>\n<body>\n<ul>" rec_no = 0 for data, length in read_file(open(sys.argv[1])): rec_no += 1 rec = build_record(data) title = rec['title'] filename = dir + "/" + str(rec_no) + ".html" f = open(filename, 'w') print >> f, "<html>\n<head><title>" + title + "</title>" + style + "</head>\n<body>" print >> f, '<a href="index.html">Back to index</a><br>' print >> f, output_record_as_html(rec) print >> f, "<h2>MARC record</h2>" print >> f, as_html(data) print >> f, '<br>\n<a href="index.html">Back to index</a>' print >> f, "</body></html>" print >> index, '<li><a href="%d.html">%s</a>' % (rec_no, title) print >> index, "</ul>\n</body></html>"
def render(self): # This hidden input is needed so that we can make dateinput a required # input in a StandardForm. print '<input type=hidden name=%s value=1>' % self.id print as_html(self.months), as_html(self.days), as_html(self.years) pass
def render(self): print as_html(self.hour), ':', as_html(self.minute), as_html(self.ampm) pass
def buttonRender(self, val=None): if val == None: val = self.value() or self.default # NOTE: This code is in transition # self.buttonRenderItems([val], 'radio') print as_html(self.buttonItems([val], 'radio'))
def buttonRender(self, vals=None): if vals == None: vals = self.value() # NOTE: This code is in transition # self.buttonRenderItems(vals, 'checkbox') print as_html(self.buttonItems(vals, 'checkbox'))