diff --git a/plotly/files.py b/plotly/files.py index 9668f144b13..a8aef7bb506 100644 --- a/plotly/files.py +++ b/plotly/files.py @@ -1,10 +1,9 @@ import os # file structure -PLOTLY_DIR = os.path.join(os.path.expanduser("~"), ".plotly") +PLOTLY_DIR = os.environ.get("PLOTLY_DIR", os.path.join(os.path.expanduser("~"), ".plotly")) CREDENTIALS_FILE = os.path.join(PLOTLY_DIR, ".credentials") CONFIG_FILE = os.path.join(PLOTLY_DIR, ".config") -TEST_DIR = os.path.join(os.path.expanduser("~"), ".test") TEST_FILE = os.path.join(PLOTLY_DIR, ".permission_test") # this sets both the DEFAULTS and the TYPES for these files @@ -22,11 +21,8 @@ 'sharing': 'public', 'auto_open': True}} - def _permissions(): try: - os.mkdir(TEST_DIR) - os.rmdir(TEST_DIR) if not os.path.exists(PLOTLY_DIR): os.mkdir(PLOTLY_DIR) with open(TEST_FILE, 'w') as f: