projects
/
mp3tohtml.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
513b884
)
propagated exception
author
Jean-Philippe Orsini
<jeanfi@gmail.com>
Mon, 1 Feb 2016 17:11:40 +0000
(18:11 +0100)
committer
Jean-Philippe Orsini
<jeanfi@gmail.com>
Mon, 1 Feb 2016 17:11:40 +0000
(18:11 +0100)
mp3tohtml/mp3tohtml.py
patch
|
blob
|
history
diff --git
a/mp3tohtml/mp3tohtml.py
b/mp3tohtml/mp3tohtml.py
index
5b96b90
..
1cd1004
100755
(executable)
--- a/
mp3tohtml/mp3tohtml.py
+++ b/
mp3tohtml/mp3tohtml.py
@@
-54,12
+54,12
@@
def copy_header(path):
header = open(header_path, "r")
for line in header:
sys.stdout.write(line)
header = open(header_path, "r")
for line in header:
sys.stdout.write(line)
- except IOError as err:
+ header.close()
+ except IOError as e:
sys.stderr.write("Failed to read header file "
+ header_path
sys.stderr.write("Failed to read header file "
+ header_path
- + ": " + err.strerror + "\n")
- sys.exit(1)
- header.close()
+ + ": " + e.strerror + "\n")
+ raise
def copy_footer(path):
footer_path = path + "/footer.tpl"
def copy_footer(path):
footer_path = path + "/footer.tpl"
@@
-67,12
+67,12
@@
def copy_footer(path):
footer = open(footer_path, "r")
for line in footer:
sys.stdout.write(line)
footer = open(footer_path, "r")
for line in footer:
sys.stdout.write(line)
- except IOError as err:
+ footer.close()
+ except IOError as e:
sys.stderr.write("Failed to read footer file "
+ footer_path
sys.stderr.write("Failed to read footer file "
+ footer_path
- + ": " + err.strerror + "\n")
- sys.exit(1)
- footer.close()
+ + ": " + e.strerror + "\n")
+ raise
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')