示例#1
0
def convert_to_dict(src):
    """ converts the content of source xml file to the a dict """

    with open(src) as fxml:
        xml = fxml.read()
        try:
            return parse_to_dict(xml)
        except:
            return ConversionFailureError()
示例#2
0
def send_response(response):
    parsed_resp = parse_to_dict(response)
    if is_successful(parsed_resp):
        return parsed_resp
    else:
        raise KempTechApiException(get_error_msg(parsed_resp))