-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcustomwarnings.py
executable file
·34 lines (25 loc) · 1.06 KB
/
customwarnings.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# vim:ts=4:sw=4:tw=0:sts=4:et
from enum import Enum
# Definition of warnings
class DataCheckWarningLevel(Enum):
ERROR = 1
WARNING = 2
INFO = 3
class DataCheckEntityType(Enum):
BIOBANK = 'Biobank'
COLLECTION = 'Collection'
CONTACT = 'Contact'
NETWORK = 'Network'
class DataCheckWarning:
def __init__(self, dataCheckID : str, recipients : str, NN : str, level : DataCheckWarningLevel, directoryEntityID : str, directoryEntityType : DataCheckEntityType, message : str, action : str = '', emailTo : str = ''):
self.dataCheckID = dataCheckID
self.recipients = recipients
self.NN = NN
self.level = level
self.directoryEntityID = directoryEntityID
self.directoryEntityType = directoryEntityType
self.message = message
self.action = action
self.emailTo = emailTo
def dump(self):
print(self.directoryEntityType.value + " " + self.directoryEntityID + " " + self.dataCheckID + "/" + self.level.name + ": " + self.message + " " + self.action + " " + self.emailTo)