Exemplo n.º 1
0
        def _obj_index(b_path, m_path, l_obj, f_list):
            conn.request('GET', m_path, headers=fheaders)
            resp, read = http.response_get(conn=conn, retry=retry)
            self.resp_exception(resp=resp, rty=retry)
            return_list = basic.json_encode(read)

            for obj in return_list:
                time_offset = ARGS.get('time_offset')
                if time_offset is not None:
                    # Get the last_modified data from the Object.
                    if cloud.time_delta(lmobj=time_offset) is True:
                        f_list.append(obj)
                else:
                    f_list.append(obj)

            last_obj_in_list = f_list[-1].get('name')
            if l_obj is last_obj_in_list:
                return f_list
            else:
                marker = _marker_type(base=b_path, last=last_obj_in_list)
                _obj_index(b_path, marker, last_obj_in_list, f_list)
Exemplo n.º 2
0
        def _obj_index(b_path, m_path, l_obj, f_list):
            conn.request('GET', m_path, headers=fheaders)
            resp, read = http.response_get(conn=conn, retry=retry)
            self.resp_exception(resp=resp, rty=retry)
            return_list = basic.json_encode(read)

            for obj in return_list:
                time_offset = ARGS.get('time_offset')
                if time_offset is not None:
                    # Get the last_modified data from the Object.
                    if cloud.time_delta(lmobj=time_offset) is True:
                        f_list.append(obj)
                else:
                    f_list.append(obj)

            last_obj_in_list = f_list[-1].get('name')
            if l_obj is last_obj_in_list:
                return f_list
            else:
                marker = _marker_type(base=b_path, last=last_obj_in_list)
                _obj_index(
                    b_path, marker, last_obj_in_list, f_list
                )
Exemplo n.º 3
0
 def test_json_encode(self):
     json_dict = '{"key": "value"}'
     self.assertIsInstance(basic_utils.json_encode(read=json_dict), dict)
Exemplo n.º 4
0
 def test_json_encode(self):
     json_dict = '{"key": "value"}'
     self.assertIsInstance(basic_utils.json_encode(read=json_dict), dict)