Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pre-commit.ci] pre-commit autoupdate #503

Merged
merged 2 commits into from
Apr 2, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
pre-commit-ci[bot] committed Apr 1, 2024
commit 75cce9018e2d4e67935cb6e6a07632cc8d8d3d69
12 changes: 6 additions & 6 deletions daphne/cli.py
Original file line number Diff line number Diff line change
@@ -270,16 +270,16 @@ def run(self, args):
websocket_connect_timeout=args.websocket_connect_timeout,
websocket_handshake_timeout=args.websocket_connect_timeout,
application_close_timeout=args.application_close_timeout,
action_logger=AccessLogGenerator(access_log_stream)
if access_log_stream
else None,
action_logger=(
AccessLogGenerator(access_log_stream) if access_log_stream else None
),
root_path=args.root_path,
verbosity=args.verbosity,
proxy_forwarded_address_header=self._get_forwarded_host(args=args),
proxy_forwarded_port_header=self._get_forwarded_port(args=args),
proxy_forwarded_proto_header="X-Forwarded-Proto"
if args.proxy_headers
else None,
proxy_forwarded_proto_header=(
"X-Forwarded-Proto" if args.proxy_headers else None
),
server_name=args.server_name,
)
self.server.run()
8 changes: 5 additions & 3 deletions daphne/http_protocol.py
Original file line number Diff line number Diff line change
@@ -286,9 +286,11 @@ def handle_reply(self, message):
"path": uri,
"status": self.code,
"method": self.method.decode("ascii", "replace"),
"client": "%s:%s" % tuple(self.client_addr)
if self.client_addr
else None,
"client": (
"%s:%s" % tuple(self.client_addr)
if self.client_addr
else None
),
"time_taken": self.duration(),
"size": self.sentLength,
},
24 changes: 12 additions & 12 deletions daphne/ws_protocol.py
Original file line number Diff line number Diff line change
@@ -115,9 +115,9 @@ def applicationCreateWorked(self, application_queue):
"connecting",
{
"path": self.request.path,
"client": "%s:%s" % tuple(self.client_addr)
if self.client_addr
else None,
"client": (
"%s:%s" % tuple(self.client_addr) if self.client_addr else None
),
},
)

@@ -138,9 +138,9 @@ def onOpen(self):
"connected",
{
"path": self.request.path,
"client": "%s:%s" % tuple(self.client_addr)
if self.client_addr
else None,
"client": (
"%s:%s" % tuple(self.client_addr) if self.client_addr else None
),
},
)

@@ -175,9 +175,9 @@ def onClose(self, wasClean, code, reason):
"disconnected",
{
"path": self.request.path,
"client": "%s:%s" % tuple(self.client_addr)
if self.client_addr
else None,
"client": (
"%s:%s" % tuple(self.client_addr) if self.client_addr else None
),
},
)

@@ -242,9 +242,9 @@ def serverReject(self):
"rejected",
{
"path": self.request.path,
"client": "%s:%s" % tuple(self.client_addr)
if self.client_addr
else None,
"client": (
"%s:%s" % tuple(self.client_addr) if self.client_addr else None
),
},
)