From 5c49ef231a8a4b89e12797aa2f2ad90aec5863fb Mon Sep 17 00:00:00 2001 From: Jakob Cornell Date: Tue, 27 Sep 2022 23:29:28 -0500 Subject: [PATCH] Fix config entry name to match documentation --- strikebot/setup.cfg | 2 +- strikebot/src/strikebot/__main__.py | 2 +- strikebot/src/strikebot/updates.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/strikebot/setup.cfg b/strikebot/setup.cfg index 2165396..40c9f03 100644 --- a/strikebot/setup.cfg +++ b/strikebot/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = strikebot -version = 0.0.4 +version = 0.0.5 [options] package_dir = diff --git a/strikebot/src/strikebot/__main__.py b/strikebot/src/strikebot/__main__.py index da645b9..fc80e23 100644 --- a/strikebot/src/strikebot/__main__.py +++ b/strikebot/src/strikebot/__main__.py @@ -137,7 +137,7 @@ update_retention = dt.timedelta(seconds = main_cfg.getfloat("update retention ti ws_parity_time = dt.timedelta(seconds = main_cfg.getfloat("WS parity time")) ws_pool_size = main_cfg.getint("WS pool size") ws_silent_limit = dt.timedelta(seconds = main_cfg.getfloat("WS silent limit")) -ws_warmup = dt.timedelta(seconds = main_cfg.getfloat("WS warmup seconds")) +ws_warmup = dt.timedelta(seconds = main_cfg.getfloat("WS warmup time")) db_cfg = parser["db connect params"] diff --git a/strikebot/src/strikebot/updates.py b/strikebot/src/strikebot/updates.py index 5e5d73d..31d9cd0 100644 --- a/strikebot/src/strikebot/updates.py +++ b/strikebot/src/strikebot/updates.py @@ -86,7 +86,7 @@ def parse_update(payload_data: dict, curr_count: Optional[int], bot_user: str) - def _parse_from_lines(lines: list[str], curr_count: Optional[int], bot_user: str) -> ParsedUpdate: command = next( - filter(None, (_parse_command(l, bot_user) for l in lines)), + (cmd for l in lines if (cmd := _parse_command(l, bot_user))), None ) if lines: @@ -134,7 +134,7 @@ def _parse_from_lines(lines: list[str], curr_count: Optional[int], bot_user: str if parts in partials: # missing any of last two digits typo = True - elif parts in [p[: -1] + [p[-1] + goal_parts[0]] + goal_parts[1 :] for p in partials]: + elif any(parts == p[: -1] + [p[-1] + goal_parts[0]] + goal_parts[1 :] for p in partials): # double paste typo = True -- 2.30.2