|
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
|
|
|
|