projects
/
radio.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
b44d220
)
cleanup
author
Jean Philip Orsini
<orsinije@fr.ibm.com>
Thu, 28 Jan 2016 16:43:49 +0000
(17:43 +0100)
committer
Jean Philip Orsini
<orsinije@fr.ibm.com>
Thu, 28 Jan 2016 16:43:49 +0000
(17:43 +0100)
mp3tohtml/mp3tohtml.py
patch
|
blob
|
history
diff --git
a/mp3tohtml/mp3tohtml.py
b/mp3tohtml/mp3tohtml.py
index
0ef84de
..
db32bdc
100755
(executable)
--- a/
mp3tohtml/mp3tohtml.py
+++ b/
mp3tohtml/mp3tohtml.py
@@
-15,7
+15,6
@@
import eyeD3
import fnmatch
import glob
import os
import fnmatch
import glob
import os
-import os.path
import re
import sys
import re
import sys
@@
-43,23
+42,27
@@
def fma_copyright_to_html(path, copyright):
return copyright
def copy_header(path):
return copyright
def copy_header(path):
- header_path =
os.path.dirname(path)
+ "/header.tpl"
+ header_path =
path
+ "/header.tpl"
header = open(header_path, "r")
for line in header:
sys.stdout.write(line)
def copy_footer(path):
header = open(header_path, "r")
for line in header:
sys.stdout.write(line)
def copy_footer(path):
- footer_path =
os.path.dirname(path)
+ "/footer.tpl"
+ footer_path =
path
+ "/footer.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')
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')
+parser.add_argument("--config", help="The directory containing the configuration")
args = parser.parse_args()
args = parser.parse_args()
-cfg_dir = sys.argv[0]
+if (args.config is None):
+ cfg_dir = os.path.dirname(sys.argv[0])
+else:
+ cfg_dir = args.config
copy_header(cfg_dir)
copy_header(cfg_dir)