# Bryan Schumaker (5 / 15 / 2011)
from libsaria import sources
SCRIPT = ""
def write_file(write, file):
f = open(file)
write(f.read())
f.close()
def index(write):
write_file(write, "html/index.html")
def library(write):
write("
")
write(SCRIPT % "controls.js")
write(SCRIPT % "utils.js")
write("\n")
color = "white"
get_attrs = sources.library.get_attrs
for id in sources.library.list_ids():
title, artist, album = get_attrs(id, "title", "artist", "album")
write("" % (color, id))
write("%s | " % (id, id, title))
write("%s | %s | \n" % (artist, album))
if color == "white":
color = "aliceblue"
else:
color = "white"
write("
")
def controls_page(write):
write_file(write, "html/controls.html")
def play_button(write):
write_file(write, "html/images/play.png")
def pause_button(write):
write_file(write, "html/images/pause.png")
def stop_button(write):
write_file(write, "html/images/stop.png")
def next_button(write):
write_file(write, "html/images/next.png")
def rewind_button(write):
write_file(write, "html/images/rewind.png")
def forward_button(write):
write_file(write, "html/images/forward.png")
def controls(write):
write_file(write, "html/controls.js")
def utils(write):
write_file(write, "html/utils.js")
docs = {
"index.html":(index, "html"),
"library.html":(library, "html"),
"controls.html":(controls_page, "html"),
"controls.js":(controls, "js"),
"utils.js":(utils, "js"),
"play.png":(play_button, "png"),
"pause.png":(pause_button, "png"),
"stop.png":(stop_button, "png"),
"next.png":(next_button, "png"),
"forward.png":(rewind_button, "png"),
"rewind.png":(forward_button, "png"),
}