0

Removing more stuff that we will not support just yet

This commit is contained in:
Andrew Chin
2012-01-01 14:31:38 -05:00
parent 0a23187f51
commit c17fb351f0
3 changed files with 65 additions and 84 deletions

View File

@@ -15,7 +15,7 @@ from settingsValidators import *
render = {
"world_path": dict(required=True, validator=validatePath),
"world_path": dict(required=True, validator=validateWorldPath),
"rendermode": dict(required=False, validator=validateRenderMode),
"north-direction": dict(required=False, validator=validateNorthDirection),
"render-range": dict(required=False, validator=validateRenderRange),

View File

@@ -5,12 +5,18 @@ import os.path
class ValidationException(Exception):
pass
def validatePath(path):
if not os.path.exists(path):
raise ValidationException("%r does not exist" % path)
if not os.path.isdir(path):
raise ValidationException("%r is not a directory" % path)
return os.path.abspath(path)
def validateWorldPath(path):
try:
if not os.path.exists(path):
raise ValidationException("%r does not exist" % path)
if not os.path.isdir(path):
raise ValidationException("%r is not a directory" % path)
except ValidationException, e
# TODO assume this is the name of a world and try
# to find it
raise e
full_path = os.path.abspath(path)
return full_path
def validateRenderMode(mode):
# TODO get list of valid rendermodes