added all variables available for template objects

This commit is contained in:
Manuel Cortez 2021-12-20 16:03:21 -06:00
parent a6ecd37547
commit 2de9f8f9b3
No known key found for this signature in database
GPG Key ID: 9E0735CA15EFE790

View File

@ -5,6 +5,13 @@ import languageHandler
from string import Template
from . import utils
# Define variables that would be available for all template objects.
# This will be used for the edit template dialog.
# Available variables for tweet objects.
tweet_variables = ["date", "display_name", "screen_name", "source", "lang", "text", "image_descriptions"]
dm_variables = ["date", "sender_display_name", "sender_screen_name", "recipient_display_name", "recipient_display_name", "text"]
person_variables = ["display_name", "screen_name", "location", "description", "followers", "following", "listed", "likes", "tweets", "created_at"]
def process_date(field, relative_times=True, offset_seconds=0):
original_date = arrow.get(field, locale="en")
if relative_times == True: