Commit 2cae7884 authored by Alexander Lercher's avatar Alexander Lercher

Rest Gateway: Cleanup

Removed MessageList
parent 4a566c1b
from __future__ import annotations
class MessageList:
__instance = None
_messages = []
@staticmethod
def getInstance() -> MessageList:
""" Static access method. """
if MessageList.__instance == None:
MessageList.__instance = MessageList()
return MessageList.__instance
def __init__(self):
""" Virtually private constructor. """
if MessageList.__instance != None:
raise Exception("This class is a singleton!")
else:
MessageList.__instance = self
def appendMessage(self, message):
self._messages.append(message)
def getMessages(self):
return self._messages
\ No newline at end of file
from MessageList import MessageList
from flask import request
def echo():
return request.json
def get_messages():
messages = MessageList.getInstance().getMessages()
return str(messages)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment