From d36214056e9fd6edd0305fcbc3df6a19cabec1f1 Mon Sep 17 00:00:00 2001 From: itsb Date: Thu, 12 Jan 2017 17:25:02 -0800 Subject: [PATCH] user-controllable plotly config directory --- plotly/files.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/plotly/files.py b/plotly/files.py index a97e79fe255..bfbee85bd71 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 @@ -23,8 +22,6 @@ 'auto_open': True}} try: - os.mkdir(TEST_DIR) - os.rmdir(TEST_DIR) if not os.path.exists(PLOTLY_DIR): os.mkdir(PLOTLY_DIR) f = open(TEST_FILE, 'w')