WebFM/src/core/utils/MessageHandler.py

26 lines
564 B
Python
Raw Normal View History

2021-02-06 04:52:46 +00:00
# Python imports
2023-02-10 02:40:58 +00:00
import json
# Lib imports
2021-02-06 04:52:46 +00:00
# Application imports
2021-02-06 04:52:46 +00:00
class MessageHandler:
def __init__(self):
print("MessageHandler initialized...")
2023-02-10 02:40:58 +00:00
def create(self, type, text):
2021-02-06 04:52:46 +00:00
return '{"message": { "type": "' + type + '", "text": "' + text + '" } }'
2023-02-10 02:40:58 +00:00
def backgrounds(self, files):
return '{ "backgrounds": ' + json.dumps(files) + '}'
def thumbnails(self, files):
return '{ "thumbnails": ' + json.dumps(files) + '}'
def faves_list(self, faves):
return '{"faves_list":' + json.dumps(faves) + '}'