8000 added testing_test_file_tools · henrypan/python-api@04ac35f · GitHub
[go: up one dir, main page]

Skip to content

Commit 04ac35f

Browse files
committed
added testing_test_file_tools
1 parent bf3c687 commit 04ac35f

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

plotly/plotly/plotly.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
DEFAULT_PLOT_OPTIONS = {
5151
'filename': "plot from API",
5252
'fileopt': "new",
53-
'world_readable': True,
53+
'world_readable': False,
5454
'auto_open': True,
5555
'validate': True
5656
}

plotly/session.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
'plotly_domain': six.string_types,
2727
'plotly_streaming_domain': six.string_types,
2828
'plotly_api_domain': six.string_types,
29-
'plotly_ssl_verification': bool
29+
'plotly_ssl_verification': bool,
30+
'plot_option':{'world_readable': bool}
3031
}
3132

3233
PLOT_OPTIONS = {
@@ -52,6 +53,7 @@ def sign_in(username, api_key, **kwargs):
5253
:param (str|optional) plotly_streaming_domain:
5354
:param (str|optional) plotly_api_domain:
5455
:param (str|optional) plotly_ssl_verification:
56+
:param (dict|optional) plot_option:
5557
5658
"""
5759
# TODO: verify these _credentials with plotly

plotly/tools.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ def warning_on_one_line(message, category, filename, lineno, file=None, line=Non
5252
CONFIG_FILE: {'plotly_domain': 'https://plot.ly',
5353
'plotly_streaming_domain': 'stream.plot.ly',
5454
'plotly_api_domain': 'https://api.plot.ly',
55-
'plotly_ssl_verification': True}}
55+
'plotly_ssl_verification': True,
56+
'plot_option': {'world_readable': False}}}
5657

5758
try:
5859
os.mkdir(TEST_DIR)
@@ -145,7 +146,8 @@ def reset_credentials_file():
145146
def set_config_file(plotly_domain=None,
146147
plotly_streaming_domain=None,
147148
plotly_api_domain=None,
148-
plotly_ssl_verification=None):
149+
plotly_ssl_verification=None,
150+
plot_option=None):
149151
"""Set the keyword-value pairs in `~/.plotly/.config`.
150152
151153
"""
@@ -162,6 +164,9 @@ def set_config_file(plotly_domain=None,
162164
settings['plotly_api_domain'] = plotly_api_domain
163165
if isinstance(plotly_ssl_verification, (six.string_types, bool)):
164166
settings['plotly_ssl_verification'] = plotly_ssl_verification
167+
if isinstance(plot_option, dict):
168+
settings['plot_option'] = plot_option
169+
session.update_session_plot_options('plot_option')
165170
utils.save_json_dict(CONFIG_FILE, settings)
166171
ensure_local_plotly_files() # make sure what we just put there is OK
167172

0 commit comments

Comments
 (0)
0