Use appdata for data on Windows
This commit is contained in:
1 parent
5521e6c07b
commit
2f154938d8
1 file changed
+5
-5
@@ -5,18 +5,18 @@ import re
|
|||||||
|
|
||||||
def getDataDir():
|
def getDataDir():
|
||||||
|
|
||||||
dir = os.path.expanduser("~")
|
|
||||||
|
|
||||||
# Windows
|
# Windows
|
||||||
if os.name == 'nt':
|
if os.name == 'nt':
|
||||||
return os.path.join(dir, 'CouchPotato')
|
return os.path.join(os.environ['APPDATA'], 'CouchPotato')
|
||||||
|
|
||||||
|
user_dir = os.path.expanduser('~')
|
||||||
|
|
||||||
# OSX
|
# OSX
|
||||||
if 'darwin' in platform.platform().lower():
|
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
|
# Linux
|
||||||
return os.path.join(dir, '.couchpotato')
|
return os.path.join(user_dir, '.couchpotato')
|
||||||
|
|
||||||
def isDict(object):
|
def isDict(object):
|
||||||
return isinstance(object, dict)
|
return isinstance(object, dict)
|
||||||
|
|||||||
Reference in new issue
Block a user