Removing more stuff that we will not support just yet
This commit is contained in:
@@ -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),
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user