mirror of
https://github.com/beetbox/beets.git
synced 2025-12-15 21:14:19 +01:00
don't use __slots__
Apparently, that's *just* for footprint optimization. Not to be used for constraining the attribute set: http://stackoverflow.com/questions/472000/python-slots
This commit is contained in:
parent
e669868896
commit
6884fc230f
1 changed files with 4 additions and 8 deletions
|
|
@ -122,12 +122,11 @@ class ImportConfig(object):
|
|||
be used in a "write-once" way -- everything is set up initially and
|
||||
then never touched again.
|
||||
"""
|
||||
__slots__ = ['lib', 'paths', 'resume', 'logfile', 'color', 'quiet',
|
||||
'quiet_fallback', 'copy', 'write', 'art', 'delete',
|
||||
'choose_match_func', 'should_resume_func', 'threaded',
|
||||
'autot']
|
||||
_fields = ['lib', 'paths', 'resume', 'logfile', 'color', 'quiet',
|
||||
'quiet_fallback', 'copy', 'write', 'art', 'delete',
|
||||
'choose_match_func', 'should_resume_func', 'threaded', 'autot']
|
||||
def __init__(self, **kwargs):
|
||||
for slot in self.__slots__:
|
||||
for slot in self._fields:
|
||||
setattr(self, slot, kwargs[slot])
|
||||
|
||||
|
||||
|
|
@ -137,9 +136,6 @@ class ImportTask(object):
|
|||
"""Represents a single directory to be imported along with its
|
||||
intermediate state.
|
||||
"""
|
||||
__slots__ = ['toppath', 'path', 'items', 'sentinel',
|
||||
'cur_artist', 'cur_album', 'candidates', 'rec',
|
||||
'choice_flag', 'info']
|
||||
def __init__(self, toppath, path=None, items=None):
|
||||
self.toppath = toppath
|
||||
self.path = path
|
||||
|
|
|
|||
Loading…
Reference in a new issue