handle metaclasses with six

This commit is contained in:
Johnny Robeson 2016-06-20 04:53:44 -04:00
parent e57b7faf69
commit 83f6ba3ce4
2 changed files with 4 additions and 5 deletions

View file

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

View file

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