mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2024-11-22 19:28:09 -06:00
Added compose function for people in mastodon instances
This commit is contained in:
parent
b9731a3c75
commit
1d4057ac5b
@ -23,3 +23,11 @@ def compose_toot(toot, db, relative_times, show_screen_names):
|
||||
else:
|
||||
source = ""
|
||||
return [user+", ", text, ts+", ", source]
|
||||
|
||||
def compose_user(user, db, relative_times=True):
|
||||
original_date = arrow.get(user.created_at)
|
||||
if relative_times:
|
||||
ts = original_date.humanize(locale="es")
|
||||
else:
|
||||
ts = original_date.shift(hours=db["utc_offset"]).format(_("dddd, MMMM D, YYYY H:m:s"), locale="es")
|
||||
return [_("%s (@%s). %s followers, %s following, %s toots. Joined %s") % (user.display_name, user.acct, user.followers_count, user.following_count, user.statuses_count, ts)]
|
||||
|
Loading…
Reference in New Issue
Block a user