Fix application config directory for Darwin platforms.

This commit is contained in:
Bastian Kleineidam 2011-12-17 07:33:21 +01:00
parent 351cc72aa4
commit aeb6df05bd
2 changed files with 14 additions and 3 deletions

View file

@ -14,8 +14,9 @@
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import os
import os
import sys
# Windows filename encoding
nt_filename_encoding="mbcs"
@ -36,7 +37,11 @@ def get_profile_dir ():
dirpath = os.path.join(basedir, u"Google", u"Chrome", u"User Data")
elif os.name == 'posix':
basedir = unicode(os.environ["HOME"])
dirpath = os.path.join(basedir, u".config", u"Google", u"Chrome")
if sys.platform == 'darwin':
dirpath = os.path.join(basedir, u"Library", u"Application Support")
else:
dirpath = os.path.join(basedir, u".config")
dirpath = os.path.join(dirpath, u"Google", u"Chrome")
return dirpath

View file

@ -14,7 +14,9 @@
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import os
import sys
import json
@ -37,7 +39,11 @@ def get_profile_dir ():
dirpath = os.path.join(basedir, u"Chromium", u"User Data")
elif os.name == 'posix':
basedir = unicode(os.environ["HOME"])
dirpath = os.path.join(basedir, u".config", u"chromium")
if sys.platform == 'darwin':
dirpath = os.path.join(basedir, u"Library", u"Application Support")
else:
dirpath = os.path.join(basedir, u".config")
dirpath = os.path.join(dirpath, u"chromium")
return dirpath