From 8f9f418a6c121ca5415069bb363eb3c728442d10 Mon Sep 17 00:00:00 2001 From: Vlad Pronsky Date: Mon, 29 May 2023 00:42:42 +0300 Subject: [PATCH] fix lint --- Makefile | 6 ++++-- twscrape/accounts_pool.py | 4 ++-- twscrape/cli.py | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 3e5f25f..cc82b86 100644 --- a/Makefile +++ b/Makefile @@ -27,8 +27,10 @@ pylint: test: @pytest -s --cov=twscrape tests/ -get-cov: - @coverage report -m +show-cov: + @pytest -s --cov=twscrape tests/ + @coverage html + @open htmlcov/index.html act: @act --container-architecture linux/amd64 diff --git a/twscrape/accounts_pool.py b/twscrape/accounts_pool.py index 8476abd..7e4c729 100644 --- a/twscrape/accounts_pool.py +++ b/twscrape/accounts_pool.py @@ -12,8 +12,8 @@ from .utils import utc_ts def guess_delim(line: str): - l, r = [x.strip() for x in line.split("username")] - return r[0] if not l else l[-1] + lp, rp = tuple([x.strip() for x in line.split("username")]) + return rp[0] if not lp else lp[-1] class AccountsPool: diff --git a/twscrape/cli.py b/twscrape/cli.py index b0d8b25..151822b 100644 --- a/twscrape/cli.py +++ b/twscrape/cli.py @@ -76,7 +76,7 @@ def custom_help(p): cmd = msg.split("positional arguments:")[1].strip().split("\n")[0] msg = msg.replace("positional arguments:", "commands:") - msg = [x for x in msg.split("\n") if not cmd in x and not "..." in x] + msg = [x for x in msg.split("\n") if cmd not in x and "..." not in x] msg[0] = f"{msg[0]} [...]" i = 0