Added test.py
Right now, this file will make a table with all my music.
This commit is contained in:
parent
f8e32ed9c9
commit
49b459f4d3
|
@ -0,0 +1,25 @@
|
||||||
|
# Bryan Schumaker
|
||||||
|
import libsaria
|
||||||
|
library = libsaria.sources.library
|
||||||
|
walk = library.walk
|
||||||
|
get_attrs = library.get_attrs
|
||||||
|
|
||||||
|
def header(wfile):
|
||||||
|
wfile.write("<html><body>")
|
||||||
|
|
||||||
|
def footer(wfile):
|
||||||
|
wfile.write("</body></html>")
|
||||||
|
|
||||||
|
def body(wfile):
|
||||||
|
wfile.write("<table border=1>")
|
||||||
|
for id in library.walk():
|
||||||
|
#attrs = get_attrs(id, "id", "title", "lenstr", "artist", "album", "year")
|
||||||
|
artist, album, title = library.get_attrs(id, "artist", "album", "title")
|
||||||
|
wfile.write("<tr><td>%s</td><td>%s</td><td>%s</td></tr>" % (artist, album, title))
|
||||||
|
wfile.write("</table>")
|
||||||
|
#wfile.write("Python!!!")
|
||||||
|
|
||||||
|
def to_html(wfile):
|
||||||
|
header(wfile)
|
||||||
|
body(wfile)
|
||||||
|
footer(wfile)
|
Loading…
Reference in New Issue