MCPcopy Index your code
hub / github.com/sqlmapproject/sqlmap / _normalizeOptions

Function _normalizeOptions

lib/core/option.py:2341–2376  ·  view source on GitHub ↗

Sets proper option types

(inputOptions)

Source from the content-addressed store, hash-verified

2339 logger.setLevel(CUSTOM_LOGGING.TRAFFIC_IN)
2340
2341def _normalizeOptions(inputOptions):
2342 """
2343 Sets proper option types
2344 """
2345
2346 types_ = {}
2347 for group in optDict.keys():
2348 types_.update(optDict[group])
2349
2350 for key in inputOptions:
2351 if key in types_:
2352 value = inputOptions[key]
2353 if value is None:
2354 continue
2355
2356 type_ = types_[key]
2357 if type_ and isinstance(type_, tuple):
2358 type_ = type_[0]
2359
2360 if type_ == OPTION_TYPE.BOOLEAN:
2361 try:
2362 value = bool(value)
2363 except (TypeError, ValueError):
2364 value = False
2365 elif type_ == OPTION_TYPE.INTEGER:
2366 try:
2367 value = int(value)
2368 except (TypeError, ValueError):
2369 value = 0
2370 elif type_ == OPTION_TYPE.FLOAT:
2371 try:
2372 value = float(value)
2373 except (TypeError, ValueError):
2374 value = 0.0
2375
2376 inputOptions[key] = value
2377
2378def _mergeOptions(inputOptions, overrideOptions):
2379 """

Callers 1

_mergeOptionsFunction · 0.85

Calls 2

keysMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…