зеркало из
https://github.com/viginum-datalab/twscrape.git
synced 2025-10-29 13:06:13 +02:00
cli: sort account by last_used
Этот коммит содержится в:
родитель
86d10b19dc
Коммит
0f56055cb1
@ -242,7 +242,7 @@ class AccountsPool:
|
||||
|
||||
old_time = datetime(1970, 1, 1).replace(tzinfo=timezone.utc)
|
||||
items = sorted(items, key=lambda x: x["username"].lower())
|
||||
items = sorted(items, key=lambda x: x["last_used"] or old_time, reverse=True)
|
||||
items = sorted(items, key=lambda x: x["total_req"], reverse=True)
|
||||
items = sorted(items, key=lambda x: x["active"], reverse=True)
|
||||
items = sorted(items, key=lambda x: x["last_used"] or old_time, reverse=True)
|
||||
# items = sorted(items, key=lambda x: x["total_req"], reverse=True)
|
||||
return items
|
||||
|
||||
@ -155,6 +155,9 @@ def print_table(rows: list[dict]):
|
||||
if isinstance(x, int):
|
||||
return f"{x:,}"
|
||||
|
||||
if isinstance(x, datetime):
|
||||
return x.isoformat().split("+")[0].replace("T", " ")
|
||||
|
||||
return str(x)
|
||||
|
||||
keys = list(rows[0].keys())
|
||||
|
||||
Загрузка…
x
Ссылка в новой задаче
Block a user