Black take two; Moving excludes into setup.cfg

This commit is contained in:
James Barnsley
2020-02-06 10:44:49 +13:00
parent 588879bf95
commit 4331e6bbf8
5 changed files with 47 additions and 35 deletions

BIN
.coverage

Binary file not shown.

View File

@ -811,9 +811,7 @@ class IrisCore(pykka.ThreadingActor):
self.broadcast(
data={
"method": "queue_metadata_changed",
"params": {
"queue_metadata": self.queue_metadata
},
"params": {"queue_metadata": self.queue_metadata},
}
)
@ -865,9 +863,7 @@ class IrisCore(pykka.ThreadingActor):
self.broadcast(
data={
"method": "commands_changed",
"params": {
"commands": self.commands
},
"params": {"commands": self.commands},
}
)
@ -886,7 +882,9 @@ class IrisCore(pykka.ThreadingActor):
error = {
"message": "Command failed",
"description": "Could not find command by ID "
+ '"' + str(data["id"]) + '"',
+ '"'
+ str(data["id"])
+ '"',
}
else:
command = self.commands[str(data["id"])]
@ -1030,9 +1028,7 @@ class IrisCore(pykka.ThreadingActor):
self.broadcast(
data={
"method": "spotify_token_changed",
"params": {
"spotify_token": self.spotify_token
},
"params": {"spotify_token": self.spotify_token},
}
)

View File

@ -101,13 +101,10 @@ class WebsocketHandler(tornado.websocket.WebSocketHandler):
),
)
else:
getattr(
iris,
message["method"])(
getattr(iris, message["method"])(
ioloop=self.ioloop,
data=params,
callback=lambda response,
error=False: self.handle_result(
callback=lambda response, error=False: self.handle_result(
id=id,
method=message["method"],
response=response,
@ -214,17 +211,12 @@ class HttpHandler(tornado.web.RequestHandler):
),
)
else:
getattr(
iris,
slug)(
getattr(iris, slug)(
ioloop=self.ioloop,
request=self,
callback=lambda response,
error=False: self.handle_result(
id=id,
method=slug,
response=response,
error=error),
callback=lambda response, error=False: self.handle_result(
id=id, method=slug, response=response, error=error
),
)
except Exception as e:
logger.error(str(e))
@ -264,17 +256,12 @@ class HttpHandler(tornado.web.RequestHandler):
),
)
else:
getattr(
iris,
slug)(
getattr(iris, slug)(
data=params,
request=self.request,
callback=lambda response=False,
error=False: self.handle_result(
id=id,
method=slug,
response=response,
error=error),
callback=lambda response=False, error=False: self.handle_result(
id=id, method=slug, response=response, error=error
),
)
except tornado.web.HTTPError:

View File

@ -64,7 +64,6 @@ mopidy.ext =
[flake8]
application-import-names = mopidy_iris, tests
max-line-length = 80
exclude = .git, .tox, build
select =
# Regular flake8 rules
C, E, F, W
@ -83,3 +82,33 @@ ignore =
W503
# B305: .next() is not a thing on Python 3 (used by playback controller)
B305
exclude =
.circleci,
.git,
.tox,
.vscode,
docs,
tests,
src,
node_modules,
build_tools,
docker,
Screenshots
[check-manifest]
ignore =
build_tools
build_tools/*
docker
docker/*
Screenshots
Screenshots/*
src
src/*
.circleci
.circleci/*
.dockerignore
.htaccess
.vscode
.vscode/*
.dockerignore

View File

@ -36,4 +36,4 @@ ignore =
[testenv:flake8]
deps = .[lint]
commands = python -m flake8 --show-source --statistics
commands = python -m flake8 --show-source --statistics