humanized time delta

This commit is contained in:
spla 2024-04-03 13:22:39 +02:00
pare da93574d73
commit a1540cb4af
S'han modificat 2 arxius amb 4 adicions i 2 eliminacions

Veure arxiu

@ -1,2 +1,2 @@
Mastodon.py Mastodonplus.py
unidecode unidecode

Veure arxiu

@ -2,6 +2,8 @@ from mastodonbot import Mastodonbot
from ejabberdapi import Ejabberd from ejabberdapi import Ejabberd
from mastodon import MastodonNetworkError from mastodon import MastodonNetworkError
import sys import sys
import humanize
import datetime as dt
# main # main
@ -85,7 +87,7 @@ if __name__ == '__main__':
post += f'{bot.node_users_str} {stats.onlineusersnode}\n' post += f'{bot.node_users_str} {stats.onlineusersnode}\n'
post += f'{bot.uptime_str} {stats.uptimeseconds}\n' post += f'{bot.uptime_str} {humanize.naturaldelta(dt.timedelta(seconds=stats.uptimeseconds))}\n'
post += f'{bot.processes_str} {stats.processes}\n' post += f'{bot.processes_str} {stats.processes}\n'