File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 1919import copy
2020import json
2121import os
22+ import time
2223import warnings
2324import webbrowser
2425
@@ -1304,17 +1305,19 @@ def add_share_key_to_url(plot_url, attempt=0):
13041305 username = urlsplit .path .split ('/' )[1 ].split ('~' )[1 ]
13051306 idlocal = urlsplit .path .split ('/' )[2 ]
13061307 fid = '{}:{}' .format (username , idlocal )
1307-
13081308 body = {'share_key_enabled' : True , 'world_readable' : False }
13091309 response = v2 .files .update (fid , body )
13101310
13111311 # Sometimes a share key is added, but access is still denied.
13121312 # Check that share_key_enabled is set to true and
13131313 # retry if this is not the case
13141314 # 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 :
13161318 attempt += 1
13171319 if attempt == 50 :
1320+ print ('Raising exception' )
13181321 raise exceptions .PlotlyError (
13191322 "The sharekey could not be enabled at this time so the graph "
13201323 "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