|
23 | 23 | PLOTLY_DIR = os.path.join(os.path.expanduser("~"), ".plotly")
|
24 | 24 | CREDENTIALS_FILE = os.path.join(PLOTLY_DIR, ".credentials")
|
25 | 25 | CONFIG_FILE = os.path.join(PLOTLY_DIR, ".config")
|
| 26 | +TEST_DIR = os.path.join(os.path.expanduser("~"), ".test") |
26 | 27 | TEST_FILE = os.path.join(PLOTLY_DIR, ".permission_test")
|
27 | 28 |
|
28 | 29 | # this sets both the DEFAULTS and the TYPES for these items
|
|
33 | 34 | 'plotly_streaming_domain': u'stream.plot.ly'}}
|
34 | 35 |
|
35 | 36 | try:
|
| 37 | + os.mkdir(TEST_DIR) |
| 38 | + os.rmdir(TEST_DIR) |
36 | 39 | if not os.path.exists(PLOTLY_DIR):
|
37 | 40 | os.mkdir(PLOTLY_DIR)
|
38 | 41 | f = open(TEST_FILE, 'w')
|
@@ -64,10 +67,13 @@ def ensure_local_plotly_files():
|
64 | 67 | del contents[key]
|
65 | 68 | utils.save_json_dict(fn, contents)
|
66 | 69 | else:
|
67 |
| - warnings.warn("Looks like you don't have 'write' permission. That " |
68 |
| - "means, plotly's python api can't setup local " |
69 |
| - "configuration files. No problem though! You'll just " |
70 |
| - "have to sign-in using 'plotly.sign_in'.") |
| 70 | + warnings.warn("Looks like you don't have 'read-write' permission to " |
| 71 | + "your 'home' ('~') directory or to our '~/.plotly' " |
| 72 | + "directory. That means plotly's python api can't setup " |
| 73 | + "local configuration files. No problem though! You'll " |
| 74 | + "just have to sign-in using 'plotly.sign_in()'. For help " |
| 75 | + "with that: 'help(plotly.sign_in)'." |
| 76 | + |
71 | 77 |
|
72 | 78 |
|
73 | 79 | ### credentials tools ###
|
|
0 commit comments