-
Notifications
You must be signed in to change notification settings - Fork 0
/
BaseMethods.py
31 lines (25 loc) · 950 Bytes
/
BaseMethods.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
__author__ = 'artzab'
class BaseMethods(object):
@property
def logging(self): return self._logging
@logging.setter
def logging(self, value): self._logging = value
@property
def config(self): return self._config
@config.setter
def config(self, value): self._config = value
def __init__(self, logging=None, conf=None):
self.logging = logging
self.config = conf
def messages(self,type="DEBUG",mesg="FOOOOO", error=False):
if error and self.logging:
self.logging.Messages.append('%s: %s' % (type, mesg))
self.logging.StatusOK = False
elif error:
print ('%s: %s' % (type, mesg))
elif self.config and self._logging:
if self.config['debug']:
self.logging.Messages.append('%s: %s' % (type, mesg))
elif self.config:
if self.config['debug']:
print ('%s: %s' % (type, mesg))