projects
/
radio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
init
[radio.git]
/
mp3tohtml.py
diff --git
a/mp3tohtml.py
b/mp3tohtml.py
index
a683c88
..
c8631c5
100755
(executable)
--- a/
mp3tohtml.py
+++ b/
mp3tohtml.py
@@
-48,6
+48,14
@@
def copy_header(path):
for line in header:
sys.stdout.write(line)
for line in header:
sys.stdout.write(line)
+def get_mp3s(dir):
+ files = []
+ for root, dirnames, filenames in os.walk(args.dir):
+ for filename in fnmatch.filter(filenames, '*.mp3'):
+ files.append(os.path.join(root, filename))
+
+ return files
+
parser = argparse.ArgumentParser(description='Generate an HTML containing information about the MP3 files.')
parser.add_argument('dir', help='The directory containing the MP3 files')
parser = argparse.ArgumentParser(description='Generate an HTML containing information about the MP3 files.')
parser.add_argument('dir', help='The directory containing the MP3 files')
@@
-55,10
+63,7
@@
args = parser.parse_args()
copy_header(sys.argv[0])
copy_header(sys.argv[0])
-files = []
-for root, dirnames, filenames in os.walk(args.dir):
- for filename in fnmatch.filter(filenames, '*.mp3'):
- files.append(os.path.join(root, filename))
+files = get_mp3s(args.dir)
for f in files:
tag = eyeD3.Tag()
for f in files:
tag = eyeD3.Tag()