Skip to content

Commit

Permalink
Bump pylint to 2.6.0 (#454)
Browse files Browse the repository at this point in the history
* Bump pylint to 2.6.0

* Tweak pylint's path

* Accept pylint's advise

* Try to make pylint less confused
  • Loading branch information
emontnemery committed Jan 28, 2021
1 parent 992bdb3 commit c2ee33e
Show file tree
Hide file tree
Showing 12 changed files with 19 additions and 21 deletions.
Empty file removed __init__.py
Empty file.
2 changes: 1 addition & 1 deletion pychromecast/controllers/bubbleupnp.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class BubbleUPNPController(MediaController):

# pylint: disable=useless-super-delegation
def __init__(self):
super(BubbleUPNPController, self).__init__()
super().__init__()
self.app_id = APP_BUBBLEUPNP
self.supporting_app_id = APP_BUBBLEUPNP

Expand Down
2 changes: 1 addition & 1 deletion pychromecast/controllers/dashcast.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class DashCastController(BaseController):
# The pylint rule useless-super-delegation doesn't realize
# we are setting default values here.
def __init__(self, appNamespace=APP_NAMESPACE, appId=APP_DASHCAST):
super(DashCastController, self).__init__(appNamespace, appId)
super().__init__(appNamespace, appId)

# pylint: enable=useless-super-delegation

Expand Down
4 changes: 2 additions & 2 deletions pychromecast/controllers/media.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ class MediaController(BaseController):
""" Controller to interact with Google media namespace. """

def __init__(self):
super(MediaController, self).__init__("urn:x-cast:com.google.cast.media")
super().__init__("urn:x-cast:com.google.cast.media")

self.media_session_id = 0
self.status = MediaStatus()
Expand Down Expand Up @@ -650,6 +650,6 @@ def _send_start_play_media(

def tear_down(self):
""" Called when controller is destroyed. """
super(MediaController, self).tear_down()
super().tear_down()

self._status_listeners[:] = []
6 changes: 2 additions & 4 deletions pychromecast/controllers/multizone.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,7 @@ def __init__(self, uuid):
self._members = {}
self._status_listeners = []
self._uuid = str(uuid)
super(MultizoneController, self).__init__(
MULTIZONE_NAMESPACE, target_platform=True
)
super().__init__(MULTIZONE_NAMESPACE, target_platform=True)

def _add_member(self, uuid, name):
if uuid not in self._members:
Expand Down Expand Up @@ -303,6 +301,6 @@ def receive_message(

def tear_down(self):
""" Called when controller is destroyed. """
super(MultizoneController, self).tear_down()
super().tear_down()

self._status_listeners[:] = []
4 changes: 2 additions & 2 deletions pychromecast/controllers/plex.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ class PlexController(BaseController):
""" Controller to interact with Plex namespace. """

def __init__(self):
super(PlexController, self).__init__("urn:x-cast:plex", "9AC194DC")
super().__init__("urn:x-cast:plex", "9AC194DC")
self.app_id = "9AC194DC"
self.namespace = "urn:x-cast:plex"
self.request_id = 0
Expand Down Expand Up @@ -468,7 +468,7 @@ class PlexApiController(PlexController):
"""A controller that can use PlexAPI."""

def __init__(self, pms):
super(PlexApiController, self).__init__()
super().__init__()
self.pms = pms

def _get_current_media(self):
Expand Down
2 changes: 1 addition & 1 deletion pychromecast/controllers/spotify.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class SpotifyController(BaseController):
# The pylint rule useless-super-delegation doesn't realize
# we are setting default values here.
def __init__(self, access_token=None, expires=None):
super(SpotifyController, self).__init__(APP_NAMESPACE, APP_SPOTIFY)
super().__init__(APP_NAMESPACE, APP_SPOTIFY)

self.logger = logging.getLogger(__name__)
self.session_started = False
Expand Down
2 changes: 1 addition & 1 deletion pychromecast/controllers/supla.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class SuplaController(BaseController):
# The pylint rule useless-super-delegation doesn't realize
# we are setting default values here.
def __init__(self):
super(SuplaController, self).__init__(APP_NAMESPACE, APP_SUPLA)
super().__init__(APP_NAMESPACE, APP_SUPLA)

self.logger = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion pychromecast/controllers/yleareena.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class YleAreenaController(MediaController):

# pylint: disable=useless-super-delegation
def __init__(self):
super(YleAreenaController, self).__init__()
super().__init__()
self.app_id = APP_YLEAREENA
self.supporting_app_id = APP_YLEAREENA

Expand Down
2 changes: 1 addition & 1 deletion pychromecast/controllers/youtube.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class YouTubeController(BaseController):
""" Controller to interact with Youtube."""

def __init__(self):
super(YouTubeController, self).__init__(YOUTUBE_NAMESPACE, APP_YOUTUBE)
super().__init__(YOUTUBE_NAMESPACE, APP_YOUTUBE)
self.status_update_event = threading.Event()
self._screen_id = None
self._session = None
Expand Down
12 changes: 6 additions & 6 deletions pychromecast/socket_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def __init__(self, host, port=None, cast_type=CAST_TYPE_CHROMECAST, **kwargs):
services = kwargs.pop("services", None)
zconf = kwargs.pop("zconf", None)

super(SocketClient, self).__init__()
super().__init__()

self.daemon = True

Expand Down Expand Up @@ -424,7 +424,7 @@ def mdns_backoff(service, retry):
self.port,
err,
)
raise ChromecastConnectionError("Failed to connect")
raise ChromecastConnectionError("Failed to connect") from err

self._report_connection_status(
ConnectionStatus(
Expand Down Expand Up @@ -1042,7 +1042,7 @@ class ConnectionController(BaseController):
""" Controller to respond to connection messages. """

def __init__(self):
super(ConnectionController, self).__init__(NS_CONNECTION)
super().__init__(NS_CONNECTION)

def receive_message(self, message, data: dict):
"""
Expand All @@ -1069,7 +1069,7 @@ class HeartbeatController(BaseController):
""" Controller to respond to heartbeat messages. """

def __init__(self):
super(HeartbeatController, self).__init__(NS_HEARTBEAT, target_platform=True)
super().__init__(NS_HEARTBEAT, target_platform=True)
self.last_ping = 0
self.last_pong = time.time()

Expand Down Expand Up @@ -1134,7 +1134,7 @@ class ReceiverController(BaseController):
"""

def __init__(self, cast_type=CAST_TYPE_CHROMECAST):
super(ReceiverController, self).__init__(NS_RECEIVER, target_platform=True)
super().__init__(NS_RECEIVER, target_platform=True)

self.status = None
self.launch_failure = None
Expand Down Expand Up @@ -1343,7 +1343,7 @@ def _process_launch_error(self, data):

def tear_down(self):
""" Called when controller is destroyed. """
super(ReceiverController, self).tear_down()
super().tear_down()

self.status = None
self.launch_failure = None
Expand Down
2 changes: 1 addition & 1 deletion requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
flake8==3.8.4
pylint==2.4.4
pylint==2.6.0
black==20.8b1

0 comments on commit c2ee33e

Please sign in to comment.