Skip to content

Commit c8737e4

Browse files
committed
added references back to ensure_local_plotly
1 parent 270b7a9 commit c8737e4

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

plotly/plotly/plotly.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
_plot_options = dict()
4646

4747
### test file permissions and make sure nothing is corrupted ###
48-
# tools.ensure_local_plotly_files()
48+
tools.ensure_local_plotly_files()
4949

5050
### _credentials stuff ###
5151

plotly/tools.py

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ def ensure_local_plotly_files():
7171
for fn in [CREDENTIALS_FILE, CONFIG_FILE]:
7272
contents = utils.load_json_dict(fn)
7373
for key, val in list(_FILE_CONTENT[fn].items()):
74-
if key not in contents or not isinstance(contents[key], type(val)):
74+
# TODO: removed type checking below, may want to revisit
75+
if key not in contents:
7576
contents[key] = val
7677
contents_keys = list(contents.keys())
7778
for key in contents_keys:
@@ -97,7 +98,7 @@ def set_credentials_file(username=None, api_key=None, stream_ids=None):
9798
if not _file_permissions:
9899
raise exceptions.PlotlyError("You don't have proper file permissions "
99100
"to run this function.")
100-
# ensure_local_plotly_files() # make sure what's there is OK
101+
ensure_local_plotly_files() # make sure what's there is OK
101102
credentials = get_credentials_file()
102103
if isinstance(username, str):
103104
credentials['username'] = username
@@ -106,7 +107,7 @@ def set_credentials_file(username=None, api_key=None, stream_ids=None):
106107
if isinstance(stream_ids, (list, tuple)):
107108
credentials['stream_ids'] = stream_ids
108109
utils.save_json_dict(CREDENTIALS_FILE, credentials)
109-
# ensure_local_plotly_files() # make sure what we just put there is OK
110+
ensure_local_plotly_files() # make sure what we just put there is OK
110111

111112

112113
def get_credentials_file(*args):
@@ -119,17 +120,17 @@ def get_credentials_file(*args):
119120
120121
"""
121122
if _file_permissions:
122-
# ensure_local_plotly_files() # make sure what's there is OK
123+
ensure_local_plotly_files() # make sure what's there is OK
123124
return utils.load_json_dict(CREDENTIALS_FILE, *args)
124125
else:
125126
return _FILE_CONTENT[CREDENTIALS_FILE]
126127

127128

128129
def reset_credentials_file():
129-
# ensure_local_plotly_files() # make sure what's there is OK
130+
ensure_local_plotly_files() # make sure what's there is OK
130131
f = open(CREDENTIALS_FILE, 'w')
131132
f.close()
132-
# ensure_local_plotly_files() # put the defaults back
133+
ensure_local_plotly_files() # put the defaults back
133134

134135

135136
# def show_credentials_file(*args): # TODO, can we lose this?
@@ -157,14 +158,14 @@ def set_config_file(plotly_domain=None, plotly_streaming_domain=None):
157158
if not _file_permissions:
158159
raise exceptions.PlotlyError("You don't have proper file permissions "
159160
"to run this function.")
160-
# ensure_local_plotly_files() # make sure what's there is OK
161+
ensure_local_plotly_files() # make sure what's there is OK
161162
settings = get_config_file()
162163
if isinstance(plotly_domain, str):
163164
settings['plotly_domain'] = plotly_domain
164165
if isinstance(plotly_streaming_domain, str):
165166
settings['plotly_streaming_domain'] = plotly_streaming_domain
166167
utils.save_json_dict(CONFIG_FILE, settings)
167-
# ensure_local_plotly_files() # make sure what we just put there is OK
168+
ensure_local_plotly_files() # make sure what we just put there is OK
168169

169170

170171
def get_config_file(*args):
@@ -177,17 +178,17 @@ def get_config_file(*args):
177178
178179
"""
179180
if _file_permissions:
180-
# ensure_local_plotly_files() # make sure what's there is OK
181+
ensure_local_plotly_files() # make sure what's there is OK
181182
return utils.load_json_dict(CONFIG_FILE, *args)
182183
else:
183184
return _FILE_CONTENT[CONFIG_FILE]
184185

185186

186187
def reset_config_file():
187-
# ensure_local_plotly_files() # make sure what's there is OK
188+
ensure_local_plotly_files() # make sure what's there is OK
188189
f = open(CONFIG_FILE, 'w')
189190
f.close()
190-
# ensure_local_plotly_files() # put the defaults back
191+
ensure_local_plotly_files() # put the defaults back
191192

192193

193194
### embed tools ###

0 commit comments

Comments
 (0)