You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
756 B
22 lines
756 B
6 years ago
|
#valueVerify
|
||
|
#inTypeClass int, str, dict, list, NoneType
|
||
|
def valueVerify(inValue,inTypeClass,inNotValidValue):
|
||
|
lResult = inNotValidValue
|
||
|
if inValue is not None:
|
||
|
if type(inValue) == inTypeClass:
|
||
|
lResult = inValue
|
||
|
#Вернуть результат
|
||
|
return lResult
|
||
|
#valueVerifyDict
|
||
|
def valueVerifyDict(inDict,inKey,inTypeClass,inNotValidValue):
|
||
|
lResult = inNotValidValue
|
||
|
if inKey in inDict:
|
||
|
lResult = valueVerify(inDict[inKey],inTypeClass,inNotValidValue)
|
||
|
return lResult
|
||
|
#valueVerifyList
|
||
|
def valueVerifyList(inList,inIndex,inTypeClass,inNotValidValue):
|
||
|
lResult = inNotValidValue
|
||
|
if inIndex in inList:
|
||
|
lResult = valueVerify(inList[inIndex],inTypeClass,inNotValidValue)
|
||
|
return lResult
|