Merge pull request #417 from andy-maier/andy/fix-flake8

Fixed flake8 errors in alert.py and base.py
This commit is contained in:
Steffen Fredriksen 2019-12-31 14:08:38 +01:00 committed by GitHub
commit 31e94db88b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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.