# exponentially wait for exportLinks to be returned if missing
while u'exportLinks' not in file_dict or \
u'text/plain' not in file_dict[u'exportLinks']:
+ # if 31.5 seconds have passed, give up
+ if delay_exp == 5:
+ raise ValueError('Google Drive failed to read the document.')
+
# wait some seconds
print "upload_check_sleep({0})".format(2. ** delay_exp)
time.sleep(2. ** delay_exp)
delay_exp = delay_exp + 1
- # if 31.5 seconds have passed, give up
- if delay_exp == 5:
- raise ValueError('Google Drive failed to read the document.')
-
# try to get the doc from gdrive
file_dict = service.files().get(fileId=file_dict[u'id']).execute()