fixed problem with specified template and error
just found a small edge case that broke metadata working on files with manually specified templates, and corrected a spelling mistake that resulted in an error
This commit is contained in:
parent
36578a7414
commit
c8d6509c71
|
@ -64,7 +64,7 @@ def get_meta(file, target):
|
|||
found = False
|
||||
with open(file, 'r') as f:
|
||||
line = '&'
|
||||
while line.startswith("&"):
|
||||
while line.startswith("&") or line.startswith("!"):
|
||||
line = f.readline()
|
||||
if line[:len(target)+1].lower() == '&' + target.lower():
|
||||
found = True
|
||||
|
@ -288,7 +288,7 @@ def make(SOURCE_DIR=SOURCE_DIR,
|
|||
elif rl[0].startswith("!TEMPLATE"):
|
||||
#TEMPLATE CASE 1: It's explicitely written out
|
||||
try:
|
||||
with open(TEMPLATE_DIR + r[0][10:] + ".template", 'r') as tfile:
|
||||
with open(TEMPLATE_DIR + rl[0][10:] + ".template", 'r') as tfile:
|
||||
template = tfile.read().splitlines()
|
||||
except:
|
||||
add_message("Template '%s' specified but does not exist" % r[0][10:])
|
||||
|
|
Loading…
Reference in New Issue