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)
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>"
next += length total += 1 if show_field: get_first_tag(data, set([show_field])) if show_leader: print data[:24] if show_pos: print pos if verbose: show_book(data) print #marc_rec = MarcBinary(data) #edition_marc_bin = parse.read_edition(marc_rec) #print edition_marc_bin if build_rec: pprint(build_record(data)) print try: rec = read_edition(data) except SoundRecording: sound_rec += 1 continue except BadDictionary: bad_dict += 1 continue except NotBook: if show_non_books: show_book(data) print not_book += 1 else: