Web album display beginnings

I have begun working on a way to display information about albums.
This commit is contained in:
Bryan Schumaker 2010-11-17 19:21:51 -05:00
parent f01fbecee3
commit 41a73bdda0
2 changed files with 28 additions and 2 deletions

24
html/album.py Normal file
View File

@ -0,0 +1,24 @@
# Bryan Schumaker (11/17/2010)
from libsaria.sources import library
def header(wfile):
wfile.write("<html><body>")
def footer(wfile):
wfile.write("</body></html>")
def body(wfile, args):
wfile.write("<table border=1>")
artist = library.tag_tree[args["artist"]].value
album = library.tag_tree[args["artist"]][args["album"]].value
wfile.write("<tr><td>%s</td></tr><br>" % artist)
wfile.write("<tr><td>%s</td></tr>" % album)
wfile.write("</table>")
def to_html(wfile, args):
header(wfile)
body(wfile, args)
footer(wfile)

View File

@ -11,12 +11,14 @@ def footer(wfile):
wfile.write("</body></html>")
def body(wfile):
link = "<a href=\"album.py?artist=%s&album=%s\">%s</a><br>"
for artist, ar_key in library.artists():
wfile.write("<h2>%s</h2>" % artist)
for album, al_key in library.albums(ar_key):
wfile.write("%s<br>" % album)
wfile.write(link % (ar_key, al_key, album))
#wfile.write("<a href=\"album.py?artist=\">%s</a><br>" % album)
def to_html(wfile):
def to_html(wfile, args):
header(wfile)
body(wfile)
footer(wfile)