From a1540cb4af2c68f4b3d522f0d76fe0aab37e4c80 Mon Sep 17 00:00:00 2001 From: spla Date: Wed, 3 Apr 2024 13:22:39 +0200 Subject: [PATCH] humanized time delta --- requirements.txt | 2 +- xmpp.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index bdfcd87..17e26e9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ -Mastodon.py +Mastodonplus.py unidecode diff --git a/xmpp.py b/xmpp.py index 22db82e..6addc1f 100644 --- a/xmpp.py +++ b/xmpp.py @@ -2,6 +2,8 @@ from mastodonbot import Mastodonbot from ejabberdapi import Ejabberd from mastodon import MastodonNetworkError import sys +import humanize +import datetime as dt # main @@ -85,7 +87,7 @@ if __name__ == '__main__': 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'