diff --git a/beets/library.py b/beets/library.py index bd88136f1..139cdfec0 100644 --- a/beets/library.py +++ b/beets/library.py @@ -259,7 +259,7 @@ class LibModel(dbcore.Model): """Shared concrete functionality for Items and Albums. """ - format_config_key = None + _format_config_key = None """Config key that specifies how an instance should be formatted. """ @@ -282,7 +282,7 @@ class LibModel(dbcore.Model): def __format__(self, spec): if not spec: - spec = beets.config[self.format_config_key].get(unicode) + spec = beets.config[self._format_config_key].get(unicode) result = self.evaluate_template(spec) if isinstance(spec, bytes): # if spec is a byte string then we must return a one as well @@ -444,7 +444,7 @@ class Item(LibModel): _sorts = {'artist': SmartArtistSort} - format_config_key = 'format_item' + _format_config_key = 'format_item' @classmethod def _getters(cls): @@ -877,7 +877,7 @@ class Album(LibModel): """List of keys that are set on an album's items. """ - format_config_key = 'format_album' + _format_config_key = 'format_album' @classmethod def _getters(cls): diff --git a/beets/ui/__init__.py b/beets/ui/__init__.py index 85c5e4824..335129af2 100644 --- a/beets/ui/__init__.py +++ b/beets/ui/__init__.py @@ -637,7 +637,7 @@ class CommonOptionsParser(optparse.OptionParser, object): value = fmt or value and unicode(value) or '' parser.values.format = value if target: - config[target.format_config_key].set(value) + config[target._format_config_key].set(value) else: if self._album_flags: if parser.values.album: @@ -648,10 +648,10 @@ class CommonOptionsParser(optparse.OptionParser, object): target = library.Album else: target = library.Item - config[target.format_config_key].set(value) + config[target._format_config_key].set(value) else: - config[library.Item.format_config_key].set(value) - config[library.Album.format_config_key].set(value) + config[library.Item._format_config_key].set(value) + config[library.Album._format_config_key].set(value) def add_path_option(self, flags=('-p', '--path')): """Add a -p/--path option to display the path instead of the default