Fixed flake8 errors in alert.py and base.py

Signed-off-by: Andreas Maier <andreas.r.maier@gmx.de>
This commit is contained in:
Andreas Maier 2019-12-31 14:06:56 +01:00
parent d20f9bea4b
commit c132a6dcb8
2 changed files with 8 additions and 9 deletions

View file

@ -57,10 +57,10 @@ class AlertListener(threading.Thread):
def _onMessage(self, *args):
""" Called when websocket message is received.
In earlier releases, websocket-client returned a tuple of two parameters: a websocket.app.WebSocketApp object
and the message as a STR. Current releases appear to only return the message.
In earlier releases, websocket-client returned a tuple of two parameters: a websocket.app.WebSocketApp
object and the message as a STR. Current releases appear to only return the message.
We are assuming the last argument in the tuple is the message.
This is to support compatibility with current and previous releases of websocket-client.
This is to support compatibility with current and previous releases of websocket-client.
"""
message = args[-1]
try:
@ -73,10 +73,10 @@ class AlertListener(threading.Thread):
def _onError(self, *args): # pragma: no cover
""" Called when websocket error is received.
In earlier releases, websocket-client returned a tuple of two parameters: a websocket.app.WebSocketApp object
and the error. Current releases appear to only return the error.
We are assuming the last argument in the tuple is the message.
This is to support compatibility with current and previous releases of websocket-client.
In earlier releases, websocket-client returned a tuple of two parameters: a websocket.app.WebSocketApp
object and the error. Current releases appear to only return the error.
We are assuming the last argument in the tuple is the message.
This is to support compatibility with current and previous releases of websocket-client.
"""
err = args[-1]
log.error('AlertListener Error: %s' % err)

View file

@ -429,7 +429,6 @@ class PlexPartialObject(PlexObject):
"""
return self._server.history(maxresults=maxresults, mindate=mindate, ratingKey=self.ratingKey)
# The photo tag cant be built atm. TODO
# def arts(self):
# part = '%s/arts' % self.key
@ -582,7 +581,7 @@ class Playable(object):
time, state)
self._server.query(key)
self.reload()
def updateTimeline(self, time, state='stopped', duration=None):
""" Set the timeline progress for this video.