Completed
Push — master ( 2b2ff6...0d93d1 )
by Jerome
01:04
created

PresenterInterface   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 23
rs 10
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A info() 0 2 1
A new_project_wizard() 0 3 1
A handle() 0 2 1
A set_ui_element() 0 3 1
A load_mainframe() 0 3 1
A __init__() 0 2 1
1
import abc
2
import logging
3
4
5
class PresenterInterface:
6
    __metaclass__ = abc.ABCMeta
7
8
    def __init__(self, logger=logging.getLogger(__name__)):
9
        self.logger = logger
10
11
    def info(self, msg, *args, **kwargs):
12
        self.logger.log(logging.INFO, "Informing user with: " + str(msg), *args, **kwargs)
13
14
    def handle(self, event, *args, **kwargs):
15
        self.logger.log(logging.INFO, "Handling event : " + str(event), *args, **kwargs)
16
17
    def set_ui_element(self, ui_element, msg, *args, **kwargs):
18
        self.logger.log(logging.ERROR,
19
                        "Tried to set an UI-Element of the Interface, probably the child class hasn't implemented it yet!")
20
21
    def new_project_wizard(self, path=None):
22
        self.logger.log(logging.ERROR,
23
                        "Tried to start the Project Wizard from the Interface, probably the child class hasn't implemented it yet!")
24
25
    def load_mainframe(self, *args, **kwargs):
26
        self.logger.log(logging.ERROR,
27
                        "Tried to load the Mainframe from the Interface, probably the child class hasn't implemented it yet!")
28