Fix config entry name to match documentation
authorJakob Cornell <jakob+gpg@jcornell.net>
Wed, 28 Sep 2022 04:29:28 +0000 (23:29 -0500)
committerJakob Cornell <jakob+gpg@jcornell.net>
Wed, 28 Sep 2022 23:13:47 +0000 (18:13 -0500)
strikebot/setup.cfg
strikebot/src/strikebot/__main__.py
strikebot/src/strikebot/updates.py

index 21653964d9ce734e87517e9d0d4d90a1fa6264fd..40c9f0357c6880d457829d22197c4dee1859756f 100644 (file)
@@ -1,6 +1,6 @@
 [metadata]
 name = strikebot
-version = 0.0.4
+version = 0.0.5
 
 [options]
 package_dir =
index da645b93eedf8f7ae24abc69867cc778fde8d537..fc80e23947a04006283212d84d9ce763e58da1ca 100644 (file)
@@ -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"]
index 5e5d73d4ebef755cc6b3854eb0c49401eafd600f..31d9cd03960a1497828221781beefdfdf00c6f1d 100644 (file)
@@ -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