File tree 2 files changed +6
-3
lines changed
2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 19
19
import copy
20
20
import json
21
21
import os
22
+ import time
22
23
import warnings
23
24
import webbrowser
24
25
@@ -1304,17 +1305,19 @@ def add_share_key_to_url(plot_url, attempt=0):
1304
1305
username = urlsplit .path .split ('/' )[1 ].split ('~' )[1 ]
1305
1306
idlocal = urlsplit .path .split ('/' )[2 ]
1306
1307
fid = '{}:{}' .format (username , idlocal )
1307
-
1308
1308
body = {'share_key_enabled' : True , 'world_readable' : False }
1309
1309
response = v2 .files .update (fid , body )
1310
1310
1311
1311
# Sometimes a share key is added, but access is still denied.
1312
1312
# Check that share_key_enabled is set to true and
1313
1313
# retry if this is not the case
1314
1314
# https://github.com/plotly/streambed/issues/4089
1315
- if not v2 .files .retrieve (fid ).json ()['share_key_enabled' ]:
1315
+ time .sleep (4 )
1316
+ share_key_enabled = v2 .files .retrieve (fid ).json ()['share_key_enabled' ]
1317
+ if not share_key_enabled :
1316
1318
attempt += 1
1317
1319
if attempt == 50 :
1320
+ print ('Raising exception' )
1318
1321
raise exceptions .PlotlyError (
1319
1322
"The sharekey could not be enabled at this time so the graph "
1320
1323
"is saved as private. Try again to save as 'secret' later."
Original file line number Diff line number Diff line change 1
- __version__ = '2.0.13 '
1
+ __version__ = '2.0.14 '
You can’t perform that action at this time.
0 commit comments