Merge pull request #1 from badzil/master
Hi. Fixed a couple of issues where you meant to call self.do_json. Great work which made my life a lot easier.
This commit is contained in:
commit
ba4fcbbbb2
|
@ -285,7 +285,7 @@ class RefineProject:
|
||||||
|
|
||||||
def wait_until_idle(self, polling_delay=0.5):
|
def wait_until_idle(self, polling_delay=0.5):
|
||||||
while True:
|
while True:
|
||||||
response = self.do('get-processes')
|
response = self.do_json('get-processes')
|
||||||
if 'processes' in response and len(response['processes']) > 0:
|
if 'processes' in response and len(response['processes']) > 0:
|
||||||
time.sleep(polling_delay)
|
time.sleep(polling_delay)
|
||||||
else:
|
else:
|
||||||
|
@ -293,7 +293,7 @@ class RefineProject:
|
||||||
|
|
||||||
def apply_operations(self, file_path, wait=True):
|
def apply_operations(self, file_path, wait=True):
|
||||||
json = open(file_path).read()
|
json = open(file_path).read()
|
||||||
response_json = self.do('apply-operations', {'operations': json})
|
response_json = self.do_json('apply-operations', {'operations': json})
|
||||||
if response_json['code'] == 'pending' and wait:
|
if response_json['code'] == 'pending' and wait:
|
||||||
self.wait_until_idle()
|
self.wait_until_idle()
|
||||||
return 'ok'
|
return 'ok'
|
||||||
|
|
Loading…
Reference in New Issue