pymensago/contact.py
def unflatten_field(d: dict, fieldname: str, fieldvalue: str) -> RetVal:
	'''Unflattens a field into the target dictionary from the format described for flatten()'''
	if not isinstance(d, dict):
		return RetVal(ErrBadType)
	
	if not isinstance(fieldname, str):
		return RetVal(ErrBadType, 'fieldname must be a string')
	
	if not fieldname:
		return RetVal(ErrBadValue, "fieldname may not be empty")
	
	if not isinstance(fieldname, str):
		return RetVal(ErrBadType, 'values must be strings')
	
	if fieldname == 'Photo':
		return setphoto(d, fieldvalue)
	
	parts = fieldname.split('.')

	return _unflatten_recurse(d, parts, 0, fieldvalue)
Unflattens a field into the target dictionary from the format described for flatten()
Unflattens a field into the target dictionary from the format described for flatten()
Unflattens a field into the target dictionary from the format described for flatten ()
def unflatten_field(d: dict, fieldname: str, fieldvalue: str) -> RetVal:
	if not isinstance(d, dict):
		return RetVal(ErrBadType)
	if not isinstance(fieldname, str):
		return RetVal(ErrBadType, 'fieldname must be a string')
	if not fieldname:
		return RetVal(ErrBadValue, "fieldname may not be empty")
	if not isinstance(fieldname, str):
		return RetVal(ErrBadType, 'values must be strings')
	if fieldname == 'Photo':
		return setphoto(d, fieldvalue)
	parts = fieldname.split('.')
	return _unflatten_recurse(d, parts, 0, fieldvalue)
def unflatten_field ( d : dict , fieldname : str , fieldvalue : str ) -> RetVal : if not isinstance ( d , dict ) : return RetVal ( ErrBadType ) if not isinstance ( fieldname , str ) : return RetVal ( ErrBadType , 'fieldname must be a string' ) if not fieldname : return RetVal ( ErrBadValue , "fieldname may not be empty" ) if not isinstance ( fieldname , str ) : return RetVal ( ErrBadType , 'values must be strings' ) if fieldname == 'Photo' : return setphoto ( d , fieldvalue ) parts = fieldname . split ( '.' ) return _unflatten_recurse ( d , parts , 0 , fieldvalue )
Unflattens a field into the target dictionary from the format described for flatten()
Unflattens a field into the target dictionary from the format described for flatten ()
'''Unflattens a field into the target dictionary from the format described for flatten()'''
d
dict
fieldname
str
fieldvalue
str