projects
/
radio.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
974601b
)
cleanup
author
Jean Philip Orsini
<orsinije@fr.ibm.com>
Wed, 27 Jan 2016 22:31:56 +0000
(23:31 +0100)
committer
Jean Philip Orsini
<orsinije@fr.ibm.com>
Wed, 27 Jan 2016 22:31:56 +0000
(23:31 +0100)
mp3tohtml.py
patch
|
blob
|
history
diff --git
a/mp3tohtml.py
b/mp3tohtml.py
index
a683c88
..
f0ba0d1
100755
(executable)
--- a/
mp3tohtml.py
+++ b/
mp3tohtml.py
@@
-48,12
+48,20
@@
def copy_header(path):
for line in header:
sys.stdout.write(line)
for line in header:
sys.stdout.write(line)
+def copy_footer(path):
+ footer_path = os.path.dirname(path) + "/header.tpl"
+ footer = open(footer_path, "r")
+ for line in footer:
+ sys.stdout.write(line)
+
parser = argparse.ArgumentParser(description='Generate an HTML containing information about the MP3 files.')
parser.add_argument('dir', help='The directory containing the MP3 files')
args = parser.parse_args()
parser = argparse.ArgumentParser(description='Generate an HTML containing information about the MP3 files.')
parser.add_argument('dir', help='The directory containing the MP3 files')
args = parser.parse_args()
-copy_header(sys.argv[0])
+cfg_dir = sys.argv[0]
+
+copy_header(cfg_dir)
files = []
for root, dirnames, filenames in os.walk(args.dir):
files = []
for root, dirnames, filenames in os.walk(args.dir):
@@
-102,6
+110,8
@@
for f in files:
print("\t</tr>")
print("\t</tr>")
+copy_footer(cfg_dir)
+
print("</table>")
print (" <ul>")
print ("<footer>")
print("</table>")
print (" <ul>")
print ("<footer>")