Read Potentials and Initial Testing
This commit is contained in:
15
diceplayer/shared/utils/validations.py
Normal file
15
diceplayer/shared/utils/validations.py
Normal file
@@ -0,0 +1,15 @@
|
||||
def NotNull(requiredArgs=[]):
|
||||
def _NotNull(function):
|
||||
def wrapper(*args, **kwargs):
|
||||
for arg in requiredArgs:
|
||||
try:
|
||||
assert (
|
||||
kwargs.get(arg) is not None
|
||||
), "Invalid Config File. Keyword {} is required".format(arg)
|
||||
except AssertionError as err:
|
||||
print(err)
|
||||
return function(*args, **kwargs)
|
||||
|
||||
return wrapper
|
||||
|
||||
return _NotNull
|
||||
Reference in New Issue
Block a user