Пример #1
0
    def array_to_dict_response(self, params):
        """
        Convert the array element recieved by SOAP in a Dictionary .

        Param:
            params -- The array

        """
        dict = {}
        rs = SOAP.simplify(params)
        if rs:
            for test in rs['item']:
                dict[test['key']] = test['value']
            return dict
        else:
            return False
Пример #2
0
    def array_to_dict_response(self, params):
        """
        Convert the array element recieved by SOAP in a Dictionary .

        Param:
            params -- The array

        """
        dictionary = {}
        rs = SOAP.simplify(params)

        if isinstance(rs, list):
            for test in rs:
                dictionary[test['item']['key']] = test['item']['value']
            return dictionary
        elif isinstance(rs, dict):
            for test in rs['item']:
                dictionary[test['key']] = test['value']
            return dictionary
        else:
            return False