Corect code style for main Python module. #2
1 changed files with 10 additions and 2 deletions
|
@ -47,7 +47,13 @@ try:
|
||||||
# Connect to the DB, set autocommit and readonly otherwise postgresql seems to have a
|
# 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
|
# tendency to keep things "idle in transaction" and table locks eventually grind
|
||||||
# Mastodon to a halt. We don't make any changes anyway.
|
# 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)
|
database.set_session(readonly=True, autocommit=True)
|
||||||
logging.debug(database.get_dsn_parameters())
|
logging.debug(database.get_dsn_parameters())
|
||||||
except:
|
except:
|
||||||
|
@ -103,7 +109,9 @@ def ejabberd_out(bool):
|
||||||
|
|
||||||
token = genanswer(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.write(token)
|
||||||
sys.stdout.buffer.flush()
|
sys.stdout.buffer.flush()
|
||||||
|
|
Loading…
Reference in a new issue