typeConversion.py (469B)
1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\carbon\common\script\util\typeConversion.py 2 from future.utils import raise_ 3 conversionTable = {'int': int, 4 'float': float, 5 'str': str, 6 'unicode': unicode} 7 8 class ConvertVariableException(Exception): 9 pass 10 11 12 def CastValue(type, value): 13 if type in conversionTable: 14 return conversionTable[type](value) 15 raise_(ConvertVariableException, 'Unknown conversion type -%s-' % type)