summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRex Kerr <rexkerr@gmail.com>2015-11-20 13:41:07 -0800
committerdavidh-ssec <david.hoese@ssec.wisc.edu>2017-11-06 08:29:39 -0600
commitc99f3303007a1803cbaa23fc2830336ec551460b (patch)
tree28c78e4e677656c2c348ba1a9bd159c1ac701be2
parent69b55d0c20536c01270896b6a00eccae853179e1 (diff)
downloadappdirs-c99f3303007a1803cbaa23fc2830336ec551460b.tar.gz
Corrected *_config_dir() for OSX
-rw-r--r--appdirs.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/appdirs.py b/appdirs.py
index 2acd1de..f7f8359 100644
--- a/appdirs.py
+++ b/appdirs.py
@@ -185,15 +185,19 @@ def user_config_dir(appname=None, appauthor=None, version=None, roaming=False):
for a discussion of issues.
Typical user config directories are:
- Mac OS X: same as user_data_dir
+ Mac OS X: ~/Library/Preferences/<AppName>
Unix: ~/.config/<AppName> # or in $XDG_CONFIG_HOME, if defined
Win *: same as user_data_dir
For Unix, we follow the XDG spec and support $XDG_CONFIG_HOME.
That means, by default "~/.config/<AppName>".
"""
- if system in ["win32", "darwin"]:
+ if system == "win32":
path = user_data_dir(appname, appauthor, None, roaming)
+ elif system == 'darwin':
+ path = os.path.expanduser('~/Library/Preferences/')
+ if appname:
+ path = os.path.join(path, appname)
else:
path = os.getenv('XDG_CONFIG_HOME', os.path.expanduser("~/.config"))
if appname:
@@ -233,10 +237,14 @@ def site_config_dir(appname=None, appauthor=None, version=None, multipath=False)
WARNING: Do not use this on Windows. See the Vista-Fail note above for why.
"""
- if system in ["win32", "darwin"]:
+ if system == 'win32':
path = site_data_dir(appname, appauthor)
if appname and version:
path = os.path.join(path, version)
+ elif system == 'darwin':
+ path = os.path.expanduser('/Library/Preferences')
+ if appname:
+ path = os.path.join(path, appname)
else:
# XDG default for $XDG_CONFIG_DIRS
# only first, if multipath is False