Added validation for existence of files linked from folk.csv

This commit is contained in:
2020-04-01 19:55:46 +01:00
parent f74c304cd4
commit 2cdfd4ea53
6 changed files with 32 additions and 11 deletions

View File

@@ -1,5 +1,5 @@
#!/usr/bin/python
import sys, string, re
import sys, string, re, os
# run within the /folk/ folder:
# python ../scripts/make-folklist.py <folk.csv >index.htm
@@ -54,6 +54,9 @@ for r in lines[1:]:
output += '</td><td>'
if vfho: output += '&curren;'
output += '</td><td>'
if mug:
if not (os.path.isfile(mug)):
print >> sys.stderr, "ERROR: --------------- mug file does not exist: ", mug
if mug: output += '<a href=%s><img alt=":-)" src="i/mug.png" /></a>' % mug
output += '</td>'
for y in xrange(len(years)):