projects
/
radio.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
774f363
)
fixed correctly the way to retrieve all mp3s
author
Jean-Philippe Orsini
<jeanfi@gmail.com>
Wed, 27 Jan 2016 00:44:18 +0000
(
01:44
+0100)
committer
Jean-Philippe Orsini
<jeanfi@gmail.com>
Wed, 27 Jan 2016 00:44:18 +0000
(
01:44
+0100)
mp3tohtml.py
patch
|
blob
|
history
diff --git
a/mp3tohtml.py
b/mp3tohtml.py
index
9aa51ac
..
a683c88
100755
(executable)
--- a/
mp3tohtml.py
+++ b/
mp3tohtml.py
@@
-1,4
+1,4
@@
-#!/usr/bin/python
+#!/usr/bin/python
2
# Generate an HTML page containing information about MP3s in a
# directory.
# Generate an HTML page containing information about MP3s in a
# directory.
@@
-12,7
+12,9
@@
import argparse;
import eyeD3
import argparse;
import eyeD3
+import fnmatch
import glob
import glob
+import os
import os.path
import re
import sys
import os.path
import re
import sys
@@
-46,14
+48,17
@@
def copy_header(path):
for line in header:
sys.stdout.write(line)
for line in header:
sys.stdout.write(line)
-parser = argparse.ArgumentParser(description='Generate an HT
LM
containing information about the MP3 files.')
+parser = argparse.ArgumentParser(description='Generate an HT
ML
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])
parser.add_argument('dir', help='The directory containing the MP3 files')
args = parser.parse_args()
copy_header(sys.argv[0])
-files = glob.iglob(args.dir + "/**/*mp3")
+files = []
+for root, dirnames, filenames in os.walk(args.dir):
+ for filename in fnmatch.filter(filenames, '*.mp3'):
+ files.append(os.path.join(root, filename))
for f in files:
tag = eyeD3.Tag()
for f in files:
tag = eyeD3.Tag()