Rename LibModel.format_config_key → _format_config_key

Fix #1346
This commit is contained in:
Bruno Cauet 2015-03-07 13:51:00 +01:00
parent 679b0a586b
commit e789b04c9a
2 changed files with 8 additions and 8 deletions

View file

@ -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):

View file

@ -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