Skip to content

Commit

Permalink
replaced deprecated configlib function getboolean with newer getbool
Browse files Browse the repository at this point in the history
  • Loading branch information
Barakudum committed Feb 22, 2024
1 parent 7dbb827 commit 1d9c55a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/jarklin/_commands/_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
def configure_logging(config: ConfigInterface) -> None:
handlers = []

if config.getboolean('logging', 'console', fallback=True):
if config.getbool('logging', 'console', fallback=True):
handlers.append(logging.StreamHandler())
handlers[-1].setFormatter(logging.Formatter(SHORT_LOGGING_FORMAT, DEFAULT_DATEFORMAT, '{'))
handlers[-1].addFilter(PillowFilter())
Expand Down
8 changes: 4 additions & 4 deletions src/jarklin/_commands/web/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def run() -> None:
app.secret_key = config.getstr('web', 'session', 'secret_key', fallback=secrets.token_hex(64))
if baseurl != "/":
app.config['SESSION_COOKIE_PATH'] = baseurl
session_permanent = config.getboolean('web', 'session', 'permanent', fallback=True)
session_permanent = config.getbool('web', 'session', 'permanent', fallback=True)
if session_permanent:
@app.before_request
def make_session_permanent() -> None:
Expand All @@ -51,9 +51,9 @@ def make_session_permanent() -> None:
if session_lifetime:
app.permanent_session_lifetime = session_lifetime # flasks default is ~31d
app.config['SESSION_REFRESH_EACH_REQUEST'] = \
config.getboolean('web', 'session', 'refresh_each_request', fallback=False)
config.getbool('web', 'session', 'refresh_each_request', fallback=False)

if config.getboolean('web', 'gzip', fallback=True):
if config.getbool('web', 'gzip', fallback=True):
from flask_compress import Compress # no need to load unless required
Compress(app)

Expand All @@ -71,7 +71,7 @@ def make_session_permanent() -> None:
x_prefix=proxy_fix.getint('x_forwarded_prefix', fallback=0),
)

if config.getboolean('web', 'debug', fallback=False):
if config.getbool('web', 'debug', fallback=False):
app.run(
debug=True,
# host=config.getstr('web', 'host', fallback=None),
Expand Down

0 comments on commit 1d9c55a

Please sign in to comment.