From ad87d2af9231c4bd735ba477a621fb51b0b263b3 Mon Sep 17 00:00:00 2001 From: MolarAmbiguity Date: Fri, 14 Apr 2017 12:40:32 +1000 Subject: [PATCH 1/4] Add info about overlaying configs --- beets/ui/__init__.py | 9 ++++++++- docs/reference/cli.rst | 5 +++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/beets/ui/__init__.py b/beets/ui/__init__.py index 29e228497..762a21174 100644 --- a/beets/ui/__init__.py +++ b/beets/ui/__init__.py @@ -1122,9 +1122,12 @@ def _configure(options): # special handling lets specified plugins get loaded before we # finish parsing the command line. if getattr(options, 'config', None) is not None: + overlay_path = True config_path = options.config del options.config config.set_file(config_path) + else: + overlay_path = False config.set_args(options) # Configure the logger. @@ -1133,9 +1136,13 @@ def _configure(options): else: log.set_global_level(logging.INFO) + if overlay_path: + log.debug(u'overlaying configuration: {0}', + util.displayable_path(config_path)) + config_path = config.user_config_path() if os.path.isfile(config_path): - log.debug(u'user configuration: {0}', + log.debug(u'base user configuration: {0}', util.displayable_path(config_path)) else: log.debug(u'no user configuration found at {0}', diff --git a/docs/reference/cli.rst b/docs/reference/cli.rst index 403c1e174..7bdb891c3 100644 --- a/docs/reference/cli.rst +++ b/docs/reference/cli.rst @@ -72,7 +72,7 @@ box. To extract `rar` files, install the `rarfile`_ package and the Optional command flags: * By default, the command copies files your the library directory and - updates the ID3 tags on your music. In order to move the files, instead of + updates the ID3 tags on your music. In order to move the files, instead of copying, use the ``-m`` (move) option. If you'd like to leave your music files untouched, try the ``-C`` (don't copy) and ``-W`` (don't write tags) options. You can also disable this behavior by default in the @@ -409,7 +409,8 @@ import ...``. * ``-v``: verbose mode; prints out a deluge of debugging information. Please use this flag when reporting bugs. You can use it twice, as in ``-vv``, to make beets even more verbose. -* ``-c FILE``: read a specified YAML :doc:`configuration file `. +* ``-c FILE``: read a specified YAML :doc:`configuration file `. any +options set in the specified config will override your normal config. Beets also uses the ``BEETSDIR`` environment variable to look for configuration and data. From 94b75e8fb4ab9f96156ae00877eef8fb4c83169e Mon Sep 17 00:00:00 2001 From: MolarAmbiguity Date: Fri, 14 Apr 2017 12:57:42 +1000 Subject: [PATCH 2/4] Fix bulleted list --- docs/reference/cli.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/reference/cli.rst b/docs/reference/cli.rst index 7bdb891c3..58ce8c324 100644 --- a/docs/reference/cli.rst +++ b/docs/reference/cli.rst @@ -410,7 +410,7 @@ import ...``. this flag when reporting bugs. You can use it twice, as in ``-vv``, to make beets even more verbose. * ``-c FILE``: read a specified YAML :doc:`configuration file `. any -options set in the specified config will override your normal config. + options set in the specified config will override your normal config. Beets also uses the ``BEETSDIR`` environment variable to look for configuration and data. From a526eb7222826fbdb15b0d3288de7b73ec8a0853 Mon Sep 17 00:00:00 2001 From: MolarAmbiguity Date: Sat, 15 Apr 2017 09:23:35 +1000 Subject: [PATCH 3/4] Implement feedback from sampsyo --- beets/ui/__init__.py | 11 +++++------ docs/reference/cli.rst | 7 +++++-- testconfig.yaml | 10 ++++++++++ 3 files changed, 20 insertions(+), 8 deletions(-) create mode 100644 testconfig.yaml diff --git a/beets/ui/__init__.py b/beets/ui/__init__.py index 762a21174..75bce9e7a 100644 --- a/beets/ui/__init__.py +++ b/beets/ui/__init__.py @@ -1122,12 +1122,11 @@ def _configure(options): # special handling lets specified plugins get loaded before we # finish parsing the command line. if getattr(options, 'config', None) is not None: - overlay_path = True - config_path = options.config + overlay_path = options.config del options.config - config.set_file(config_path) + config.set_file(overlay_path) else: - overlay_path = False + overlay_path = None config.set_args(options) # Configure the logger. @@ -1138,11 +1137,11 @@ def _configure(options): if overlay_path: log.debug(u'overlaying configuration: {0}', - util.displayable_path(config_path)) + util.displayable_path(overlay_path)) config_path = config.user_config_path() if os.path.isfile(config_path): - log.debug(u'base user configuration: {0}', + log.debug(u'user configuration: {0}', util.displayable_path(config_path)) else: log.debug(u'no user configuration found at {0}', diff --git a/docs/reference/cli.rst b/docs/reference/cli.rst index 58ce8c324..37fc31767 100644 --- a/docs/reference/cli.rst +++ b/docs/reference/cli.rst @@ -409,8 +409,11 @@ import ...``. * ``-v``: verbose mode; prints out a deluge of debugging information. Please use this flag when reporting bugs. You can use it twice, as in ``-vv``, to make beets even more verbose. -* ``-c FILE``: read a specified YAML :doc:`configuration file `. any - options set in the specified config will override your normal config. +* ``-c FILE``: read a specified YAML :doc:`configuration file `. This + configuration works as an overlay: rather than replacing your normal + configuration options entirely, the two are merged. Any individual options set + in this config file will override your base configuration. + Beets also uses the ``BEETSDIR`` environment variable to look for configuration and data. diff --git a/testconfig.yaml b/testconfig.yaml new file mode 100644 index 000000000..bd864107f --- /dev/null +++ b/testconfig.yaml @@ -0,0 +1,10 @@ +directory: /home/jack/Music/ +library: /home/jack/Music/library.blb +import: + move: yes +paths: + default: $albumartist/$album%aunique{}/$disc-$track $title + singleton: $albumartist/$title + +ui: + color: no From 419d9a066776952d850464b8ead6b49d740098d4 Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Sat, 15 Apr 2017 11:52:09 -0400 Subject: [PATCH 4/4] Remove an accidentally-committed config --- testconfig.yaml | 10 ---------- 1 file changed, 10 deletions(-) delete mode 100644 testconfig.yaml diff --git a/testconfig.yaml b/testconfig.yaml deleted file mode 100644 index bd864107f..000000000 --- a/testconfig.yaml +++ /dev/null @@ -1,10 +0,0 @@ -directory: /home/jack/Music/ -library: /home/jack/Music/library.blb -import: - move: yes -paths: - default: $albumartist/$album%aunique{}/$disc-$track $title - singleton: $albumartist/$title - -ui: - color: no