From 89638e55d64388c61895521fd2b522bd893bcd4e Mon Sep 17 00:00:00 2001 From: Thomas Adamcik Date: Sun, 15 Dec 2013 23:05:29 +0100 Subject: [PATCH 1/4] flags: use $XDG_CONFIG_DIRS and $XDG_CONFIG_HOME as defaults This does not add support for '$XDG_CONFIG_DIRS' expansion, it just makes the default include what it is set to. --- mopidy/commands.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/mopidy/commands.py b/mopidy/commands.py index 36f5ae1a..cba247fc 100644 --- a/mopidy/commands.py +++ b/mopidy/commands.py @@ -6,6 +6,7 @@ import logging import os import sys +import glib import gobject from mopidy import config as config_lib @@ -15,6 +16,12 @@ from mopidy.utils import deps, process, versioning logger = logging.getLogger('mopidy.commands') +_default_config = [] +for base in glib.get_system_config_dirs() + (glib.get_user_config_dir(),): + _default_config.append(os.path.join(base, b'mopidy', b'mopidy.conf')) +DEFAULT_CONFIG = b':'.join(_default_config) +print DEFAULT_CONFIG + def config_files_type(value): return value.split(b':') @@ -243,7 +250,7 @@ class RootCommand(Command): self.add_argument( '--config', action='store', dest='config_files', type=config_files_type, - default=b'$XDG_CONFIG_DIR/mopidy/mopidy.conf', metavar='FILES', + default=DEFAULT_CONFIG, metavar='FILES', help='config files to use, colon seperated, later files override') self.add_argument( '-o', '--option', From 2a57190d7a73f7c4cfdf01497cd2f5d15bb305f3 Mon Sep 17 00:00:00 2001 From: Thomas Adamcik Date: Thu, 19 Dec 2013 22:13:17 +0100 Subject: [PATCH 2/4] docs: Update change log with XDG_CONFIG_DIRS change --- docs/changelog.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/changelog.rst b/docs/changelog.rst index b04c6b95..bfc4a742 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -40,6 +40,11 @@ a temporary regression of :issue:`527`. asyncronously through the GObject event loop. This should resolve the issue that has blocked the merge of the EOT-vs-EOS fix for a long time. +**Config file loading** + +- The default for the config flag has been uptated to include + ``$XDG_CONFIG_DIRS`` in addition to ``$XDG_CONFIG_DIR``. (Fixes :issue:`431`) + v0.17.0 (2013-11-23) ==================== From 279618fcde9e2ceb996c25d32add5f0fc12df1a3 Mon Sep 17 00:00:00 2001 From: Thomas Adamcik Date: Thu, 19 Dec 2013 23:42:33 +0100 Subject: [PATCH 3/4] commands: Remove print statement --- mopidy/commands.py | 1 - 1 file changed, 1 deletion(-) diff --git a/mopidy/commands.py b/mopidy/commands.py index cba247fc..851bfb83 100644 --- a/mopidy/commands.py +++ b/mopidy/commands.py @@ -20,7 +20,6 @@ _default_config = [] for base in glib.get_system_config_dirs() + (glib.get_user_config_dir(),): _default_config.append(os.path.join(base, b'mopidy', b'mopidy.conf')) DEFAULT_CONFIG = b':'.join(_default_config) -print DEFAULT_CONFIG def config_files_type(value): From 0bbfaff0854585e85cb93583cf89a818703c8cde Mon Sep 17 00:00:00 2001 From: Thomas Adamcik Date: Fri, 20 Dec 2013 00:14:02 +0100 Subject: [PATCH 4/4] docs: Fix typo in changelog --- docs/changelog.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index bfc4a742..daad3cc1 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -42,7 +42,7 @@ a temporary regression of :issue:`527`. **Config file loading** -- The default for the config flag has been uptated to include +- The default for the config flag has been updated to include ``$XDG_CONFIG_DIRS`` in addition to ``$XDG_CONFIG_DIR``. (Fixes :issue:`431`)