From 9325300e391d086fad1173d5ab2aa1a70457b7c8 Mon Sep 17 00:00:00 2001 From: Ben Finney Date: Mon, 19 Dec 2022 09:26:03 +1100 Subject: [PATCH] Wrap long statements across multiple lines. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PEP 8 specifies: * Limit all lines to a maximum of 79 characters. * The preferred way of wrapping long lines is by using Python’s implied line continuation inside parentheses, brackets and braces. Long lines can be broken over multiple lines by wrapping expressions in parentheses. These should be used in preference to using a backslash for line continuation. --- auth-mastodon.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/auth-mastodon.py b/auth-mastodon.py index efc9714..3084213 100644 --- a/auth-mastodon.py +++ b/auth-mastodon.py @@ -47,7 +47,13 @@ try: # Connect to the DB, set autocommit and readonly otherwise postgresql seems to have a # tendency to keep things "idle in transaction" and table locks eventually grind # Mastodon to a halt. We don't make any changes anyway. - database = psycopg2.connect(host=db_host, user=db_user, password=db_pass, database=db_name, port=db_port) + database = psycopg2.connect( + host=db_host, + user=db_user, + password=db_pass, + database=db_name, + port=db_port, + ) database.set_session(readonly=True, autocommit=True) logging.debug(database.get_dsn_parameters()) except: @@ -103,7 +109,9 @@ def ejabberd_out(bool): token = genanswer(bool) - logging.debug("sent bytes: %#x %#x %#x %#x" % (token[0], token[1], token[2], token[3])) + logging.debug( + "sent bytes: %#x %#x %#x %#x" + % (token[0], token[1], token[2], token[3])) sys.stdout.buffer.write(token) sys.stdout.buffer.flush()