0

Further glue for overlays. Make the validator actually validate. Also rough outlines for checking if

the render you've specified in the overlay actually exists and isn't itself.
This commit is contained in:
Richard Pastrick
2012-04-09 12:20:58 -07:00
parent 3ded0cfa9e
commit ebd8b287ed
2 changed files with 17 additions and 1 deletions

View File

@@ -304,6 +304,21 @@ dir but you forgot to put quotes around the directory, since it contains spaces.
if render.get('forcerender', False): if render.get('forcerender', False):
render['renderchecks'] = 2 render['renderchecks'] = 2
# check if overlays are set, if so, make sure that those renders exist
if render.get('overlay', []) != []:
for x in render.get('overlay'):
if x != rname:
try:
renderLink = config['renders'][x]
except KeyError:
logging.error("Render %s's overlay is '%s', but I could not find a corresponding entry in the renders dictionary.",
rname, x)
return 1
# TODO: Link the overlay rendering to the render modes it is used for so that the JS can properly fill in the dropdown
else:
logging.error("Render %s's overlay contains itself.", rname)
return 1
destdir = config['outputdir'] destdir = config['outputdir']
if not destdir: if not destdir:
logging.error("You must specify the output directory in your config file.") logging.error("You must specify the output directory in your config file.")

View File

@@ -55,7 +55,8 @@ def validateOverlays(renderlist):
if type(renderlist) != list: if type(renderlist) != list:
raise ValidationException("Overlay must specify a list of renders") raise ValidationException("Overlay must specify a list of renders")
for x in renderlist: for x in renderlist:
print x if validateStr(x) == '':
raise ValidationException("%r must be a string"% x)
return renderlist return renderlist
def validateWorldPath(worldpath): def validateWorldPath(worldpath):