mirror of
https://github.com/beetbox/beets.git
synced 2025-12-27 02:52:33 +01:00
handle metaclasses with six
This commit is contained in:
parent
e57b7faf69
commit
83f6ba3ce4
2 changed files with 4 additions and 5 deletions
|
|
@ -25,6 +25,7 @@ from tempfile import NamedTemporaryFile
|
|||
from six.moves.urllib.parse import urlencode
|
||||
from beets import logging
|
||||
from beets import util
|
||||
import six
|
||||
|
||||
# Resizing methods
|
||||
PIL = 1
|
||||
|
|
@ -159,10 +160,9 @@ class Shareable(type):
|
|||
return self._instance
|
||||
|
||||
|
||||
class ArtResizer(object):
|
||||
class ArtResizer(six.with_metaclass(Shareable, object)):
|
||||
"""A singleton class that performs image resizes.
|
||||
"""
|
||||
__metaclass__ = Shareable
|
||||
|
||||
def __init__(self):
|
||||
"""Create a resizer object with an inferred method.
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ from importlib import import_module
|
|||
from beets.util.confit import ConfigValueError
|
||||
from beets import ui
|
||||
from beets.plugins import BeetsPlugin
|
||||
import six
|
||||
|
||||
|
||||
METASYNC_MODULE = 'beetsplug.metasync'
|
||||
|
|
@ -35,9 +36,7 @@ SOURCES = {
|
|||
}
|
||||
|
||||
|
||||
class MetaSource(object):
|
||||
__metaclass__ = ABCMeta
|
||||
|
||||
class MetaSource(six.with_metaclass(ABCMeta, object)):
|
||||
def __init__(self, config, log):
|
||||
self.item_types = {}
|
||||
self.config = config
|
||||
|
|
|
|||
Loading…
Reference in a new issue