39 lines
No EOL
657 B
Python
39 lines
No EOL
657 B
Python
from abc import ABCMeta, abstractmethod
|
|
from collections import namedtuple
|
|
|
|
from six import add_metaclass
|
|
|
|
class GlobalMessage(
|
|
namedtuple('GlobalMessage', [
|
|
'uuid',
|
|
'content',
|
|
'severity',
|
|
'media_type_name',
|
|
])):
|
|
|
|
def to_dict(self):
|
|
return {
|
|
'uuid': self.uuid,
|
|
'content': self.content,
|
|
'severity': self.severity,
|
|
'media_type': self.media_type_name,
|
|
}
|
|
|
|
|
|
|
|
@add_metaclass(ABCMeta)
|
|
class GlobalMessageDataInterface(object):
|
|
|
|
@abstractmethod
|
|
def get_all_messages(self):
|
|
pass
|
|
|
|
@abstractmethod
|
|
def create_message(self):
|
|
pass
|
|
|
|
@abstractmethod
|
|
def delete_message(self):
|
|
pass
|
|
|
|
|