Web album display beginnings
I have begun working on a way to display information about albums.
This commit is contained in:
parent
63ac3f3353
commit
1ea1cae552
|
@ -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)
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue