ontv r470 - trunk/ontv



Author: johans
Date: Thu Nov  6 23:00:43 2008
New Revision: 470
URL: http://svn.gnome.org/viewvc/ontv?rev=470&view=rev

Log:
Use XDG base dir for config files.

Modified:
   trunk/ontv/config.py

Modified: trunk/ontv/config.py
==============================================================================
--- trunk/ontv/config.py	(original)
+++ trunk/ontv/config.py	Thu Nov  6 23:00:43 2008
@@ -46,6 +46,8 @@
                      KEY_DISPLAY_UPCOMING_PROGRAMS:   'bool',
                      KEY_UPCOMING_PROGRAMS_BELOW:     'bool'}
 
+XDG_CONFIG_DIR = os.getenv("XDG_CONFIG_HOME") or "~/.config"
+
 class Configuration(object):
     """Singleton representing the configuration"""
 
@@ -58,7 +60,8 @@
         return Configuration.instance
 
     def __init(self, *args):
-        self.base_dir = os.path.expanduser("~/.gnome2/ontv")
+        self.base_dir = os.path.expanduser(os.path.join(XDG_CONFIG_DIR,
+            "ontv"))
         self.logos_dir = os.path.join(self.base_dir, "logos")
         if not os.path.exists(self.logos_dir):
             os.makedirs(self.logos_dir)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]