Corect code style for main Python module. #2

Merged
mike merged 17 commits from bignose/ejabberd-auth-mastodon:wip/maintenance/code-style into master 2023-01-01 21:50:41 +11:00
Showing only changes of commit 9325300e39 - Show all commits

View file

@ -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()