# Bryan Schumaker (12 / 26 / 2010)
import libsaria
library = libsaria.sources.library
walk = library.walk
get_attrs = library.get_attrs
cols = [("Title", 400), ("Length", 60), ("Artist", 200), ("Album", 200), ("Year", 50)]
def header(wfile):
wfile.write("
")
def footer(wfile):
wfile.write("")
def content_header(wfile):
wfile.write("")
for col, width in cols:
wfile.write("%s | " % (width, col))
wfile.write("
")
wfile.write("
")
def body(wfile):
wfile.write("header stuff goes here")
content_header(wfile)
wfile.write("")
wfile.write("
")
colors = ["white", "aliceblue"]
i = 0
for id in walk():
wfile.write("")
for index, attr in enumerate(get_attrs(id, "title", "lenstr", "artist", "album", "year")):
wfile.write("%s | " % (cols[index][1], colors[i], attr))
wfile.write("
")
if i == 0:
i = 1
else:
i = 0
wfile.write("
")
wfile.write("footer stuff goes here")
def to_html(wfile, args):
header(wfile)
body(wfile)
footer(wfile)