0

Add custom web assets support

This commit is contained in:
Thomas Lake
2012-08-12 15:27:07 +01:00
parent 5ff9c507b7
commit fcfe3063c3
4 changed files with 22 additions and 4 deletions

View File

@@ -214,6 +214,18 @@ def validateDefaultZoom(z):
else:
raise ValidationException("The default zoom is set below 1")
def validateWebAssetsPath(p):
try:
validatePath(p)
except ValidationException as e:
raise ValidationException("Bad custom web assets path: %s" % e.message)
def validatePath(p):
_, path = checkBadEscape(p)
abs_path = expand_path(path)
if not os.path.exists(abs_path):
raise ValidationException("'%s' does not exist. Path initially given as '%s'" % (abs_path,p))
def make_dictValidator(keyvalidator, valuevalidator):
"""Compose and return a dict validator -- a validator that validates each
key and value in a dictionary.