Show More
@@ -43,7 +43,6 b' class Command(BaseCommand):' | |||||
43 | local_id=local_id) |
|
43 | local_id=local_id) | |
44 |
|
44 | |||
45 | xml = GlobalId.objects.generate_request_get([global_id]) |
|
45 | xml = GlobalId.objects.generate_request_get([global_id]) | |
46 | # body = urllib.parse.urlencode(data) |
|
|||
47 | h = httplib2.Http() |
|
46 | h = httplib2.Http() | |
48 | response, content = h.request(get_url, method="POST", body=xml) |
|
47 | response, content = h.request(get_url, method="POST", body=xml) | |
49 |
|
48 | |||
@@ -51,12 +50,11 b' class Command(BaseCommand):' | |||||
51 | else: |
|
50 | else: | |
52 | raise Exception('Invalid global ID') |
|
51 | raise Exception('Invalid global ID') | |
53 | else: |
|
52 | else: | |
|
53 | print('Running LIST request') | |||
54 | h = httplib2.Http() |
|
54 | h = httplib2.Http() | |
55 | xml = GlobalId.objects.generate_request_list() |
|
55 | xml = GlobalId.objects.generate_request_list() | |
56 | response, content = h.request(list_url, method="POST", body=xml) |
|
56 | response, content = h.request(list_url, method="POST", body=xml) | |
57 |
|
57 | |||
58 | print(content.decode() + '\n') |
|
|||
59 |
|
||||
60 | root = ET.fromstring(content) |
|
58 | root = ET.fromstring(content) | |
61 | status = root.findall('status')[0].text |
|
59 | status = root.findall('status')[0].text | |
62 | if status == 'success': |
|
60 | if status == 'success': | |
@@ -79,8 +77,8 b' class Command(BaseCommand):' | |||||
79 | limit = options.get('split_query', len(ids_to_sync)) |
|
77 | limit = options.get('split_query', len(ids_to_sync)) | |
80 | for offset in range(0, len(ids_to_sync), limit): |
|
78 | for offset in range(0, len(ids_to_sync), limit): | |
81 | xml = GlobalId.objects.generate_request_get(ids_to_sync[offset:offset+limit]) |
|
79 | xml = GlobalId.objects.generate_request_get(ids_to_sync[offset:offset+limit]) | |
82 | # body = urllib.parse.urlencode(data) |
|
|||
83 | h = httplib2.Http() |
|
80 | h = httplib2.Http() | |
|
81 | print('Running GET request') | |||
84 | response, content = h.request(get_url, method="POST", body=xml) |
|
82 | response, content = h.request(get_url, method="POST", body=xml) | |
85 |
|
83 | |||
86 | SyncManager.parse_response_get(content, file_url) |
|
84 | SyncManager.parse_response_get(content, file_url) |
General Comments 0
You need to be logged in to leave comments.
Login now