From 2f154938d86ad44047f405aaf6858f15e95e3038 Mon Sep 17 00:00:00 2001 From: Ruud Date: Sun, 29 Jan 2012 19:53:25 +0100 Subject: [PATCH] Use appdata for data on Windows --- couchpotato/core/helpers/variable.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/couchpotato/core/helpers/variable.py b/couchpotato/core/helpers/variable.py index 91f5bb65..aaee7866 100644 --- a/couchpotato/core/helpers/variable.py +++ b/couchpotato/core/helpers/variable.py @@ -5,18 +5,18 @@ import re def getDataDir(): - dir = os.path.expanduser("~") - # Windows if os.name == 'nt': - return os.path.join(dir, 'CouchPotato') + return os.path.join(os.environ['APPDATA'], 'CouchPotato') + + user_dir = os.path.expanduser('~') # OSX if 'darwin' in platform.platform().lower(): - return os.path.join(dir, 'Library', 'Application Support', 'CouchPotato') + return os.path.join(user_dir, 'Library', 'Application Support', 'CouchPotato') # Linux - return os.path.join(dir, '.couchpotato') + return os.path.join(user_dir, '.couchpotato') def isDict(object): return isinstance(object, dict)