[d-feet] Use XDG config dir
- From: John Palmieri <johnp src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [d-feet] Use XDG config dir
- Date: Tue, 15 Nov 2011 14:03:47 +0000 (UTC)
commit 7f6104bbc5ab07ad309eb0e4b6b6e147efe524ec
Author: William Jon McCann <jmccann redhat com>
Date: Sat Apr 2 22:07:26 2011 -0400
Use XDG config dir
https://bugzilla.gnome.org/show_bug.cgi?id=646542
dfeet/settings.py | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/dfeet/settings.py b/dfeet/settings.py
index 0a1c569..537e827 100644
--- a/dfeet/settings.py
+++ b/dfeet/settings.py
@@ -104,10 +104,13 @@ class Settings:
Parameters:
filename -- path to the settings file.
- If None, the default ~/.dfeet/config will be used.
+ If None, the default $XDG_CONFIG_HOME/d-feet/config will be used.
"""
if not filename:
- self.filename = os.path.expanduser("~/.d-feet/config")
+ if os.environ.has_key('XDG_CONFIG_HOME'):
+ self.filename = os.path.join(os.environ['XDG_CONFIG_HOME'], 'd-feet', 'config')
+ else:
+ self.filename = os.path.join(os.environ['HOME'], '.config', 'd-feet', 'config')
else:
self.filename = filename
self.config = ConfigParser.ConfigParser()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]