Changeset View
Changeset View
Standalone View
Standalone View
pykolab/utils.py
Show First 20 Lines • Show All 358 Lines • ▼ Show 20 Lines | elif type(_object) == dict: | ||||
except: | except: | ||||
return value | return value | ||||
for key in _object: | for key in _object: | ||||
if type(_object[key]) == list: | if type(_object[key]) == list: | ||||
if _object[key] is None: | if _object[key] is None: | ||||
continue | continue | ||||
# Dont run strip anything from attributes which | |||||
# hold byte strings | |||||
if key.lower() in constants.BINARY_ATTRS: | |||||
val = _object[key] | |||||
else: | |||||
val = map(_strip, _object[key]) | val = map(_strip, _object[key]) | ||||
if len(val) == 1: | if len(val) == 1: | ||||
result[key.lower()] = ''.join(val) | result[key.lower()] = ''.join(val) | ||||
else: | else: | ||||
result[key.lower()] = val | result[key.lower()] = val | ||||
else: | else: | ||||
if _object[key] is None: | if _object[key] is None: | ||||
▲ Show 20 Lines • Show All 228 Lines • Show Last 20 Lines |