Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c02b33e

Browse files
committed
Update tools.py to use new session.py module.
1 parent 87166d4 commit c02b33e

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

plotly/tools.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
from plotly import utils
1919
from plotly import exceptions
20+
from plotly import session
2021

2122
from plotly.graph_objs import graph_objs
2223

@@ -213,7 +214,8 @@ def get_embed(file_owner_or_url, file_id=None, width="100%", height=525):
213214
214215
"""
215216
padding = 25
216-
plotly_rest_url = get_config_file()['plotly_domain']
217+
plotly_rest_url = (session.get_session_config().get('plotly_domain') or
218+
get_config_file()['plotly_domain'])
217219
if file_id is None: # assume we're using a url
218220
url = file_owner_or_url
219221
if url[:len(plotly_rest_url)] != plotly_rest_url:
@@ -301,8 +303,12 @@ def embed(file_owner_or_url, file_id=None, width="100%", height=525):
301303
pass
302304
if _ipython_imported:
303305
if file_id:
306+
plotly_domain = (
307+
session.get_session_config().get('plotly_domain') or
308+
get_config_file()['plotly_domain']
309+
)
304310
url = "{plotly_domain}/~{un}/{fid}".format(
305-
plotly_domain=get_config_file()['plotly_domain'],
311+
plotly_domain=plotly_domain,
306312
un=file_owner_or_url,
307313
fid=file_id)
308314
else:

0 commit comments

Comments
 (0)