Upgrade Python syntax with pyupgrade --py3-plus

This commit is contained in:
hugovk 2018-11-26 23:10:38 +02:00 committed by Hugo
parent 742df8b674
commit ee879aa042

View file

@ -138,7 +138,7 @@ logger = logging.getLogger(__name__)
logging.getLogger(__name__).addHandler(logging.NullHandler()) logging.getLogger(__name__).addHandler(logging.NullHandler())
class _Network(object): class _Network:
""" """
A music social network website such as Last.fm or A music social network website such as Last.fm or
one with a Last.fm-compatible API. one with a Last.fm-compatible API.
@ -795,7 +795,7 @@ class LibreFMNetwork(_Network):
) )
class _ShelfCacheBackend(object): class _ShelfCacheBackend:
"""Used as a backend for caching cacheable requests.""" """Used as a backend for caching cacheable requests."""
def __init__(self, file_path=None): def __init__(self, file_path=None):
@ -816,7 +816,7 @@ class _ShelfCacheBackend(object):
self.shelf[key] = xml_string self.shelf[key] = xml_string
class _Request(object): class _Request:
"""Representing an abstract web service operation.""" """Representing an abstract web service operation."""
def __init__(self, network, method_name, params=None): def __init__(self, network, method_name, params=None):
@ -981,7 +981,7 @@ class _Request(object):
raise WSError(self.network, status, details) raise WSError(self.network, status, details)
class SessionKeyGenerator(object): class SessionKeyGenerator:
"""Methods of generating a session key: """Methods of generating a session key:
1) Web Authentication: 1) Web Authentication:
a. network = get_*_network(API_KEY, API_SECRET) a. network = get_*_network(API_KEY, API_SECRET)
@ -1104,7 +1104,7 @@ def _string_output(func):
return r return r
class _BaseObject(object): class _BaseObject:
"""An abstract webservices object.""" """An abstract webservices object."""
network = None network = None
@ -1193,7 +1193,7 @@ class _BaseObject(object):
return _extract(node, section) return _extract(node, section)
class _Chartable(object): class _Chartable:
"""Common functions for classes with charts.""" """Common functions for classes with charts."""
def __init__(self, ws_prefix): def __init__(self, ws_prefix):
@ -1264,7 +1264,7 @@ class _Chartable(object):
return seq return seq
class _Taggable(object): class _Taggable:
"""Common functions for classes with tags.""" """Common functions for classes with tags."""
def __init__(self, ws_prefix): def __init__(self, ws_prefix):
@ -1593,7 +1593,7 @@ class Album(_Opus):
__hash__ = _Opus.__hash__ __hash__ = _Opus.__hash__
def __init__(self, artist, title, network, username=None, info=None): def __init__(self, artist, title, network, username=None, info=None):
super(Album, self).__init__(artist, title, network, "album", username, info) super().__init__(artist, title, network, "album", username, info)
def get_tracks(self): def get_tracks(self):
"""Returns the list of Tracks on this album.""" """Returns the list of Tracks on this album."""
@ -2062,7 +2062,7 @@ class Track(_Opus):
__hash__ = _Opus.__hash__ __hash__ = _Opus.__hash__
def __init__(self, artist, title, network, username=None, info=None): def __init__(self, artist, title, network, username=None, info=None):
super(Track, self).__init__(artist, title, network, "track", username, info) super().__init__(artist, title, network, "track", username, info)
def get_correction(self): def get_correction(self):
"""Returns the corrected track name.""" """Returns the corrected track name."""