-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
49 lines (33 loc) · 1.26 KB
/
main.py
File metadata and controls
49 lines (33 loc) · 1.26 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env python3
import sys, logging, ui, yaml
from PyQt5 import QtGui, QtCore
from PyQt5.QtWidgets import QMainWindow, QApplication
class Entropy(QMainWindow):
"""
Base class
Initializes the main window. Program logic is handled in the ui class.
"""
global cfg
def __init__(self):
super().__init__()
with open("config.yml", 'r') as ymlfile:
self.cfg = yaml.load(ymlfile)
self.initUI()
def initUI(self):
logging.getLogger().setLevel(logging.DEBUG)
logging.info('Entropy.InitUI')
self.setWindowTitle('ENTROPY')
self.setWindowIcon(QtGui.QIcon('icon.png'))
self.resize(self.maximumHeight(), self.maximumWidth())
if 'frameless' in self.cfg['general']:
if self.cfg['general']['frameless'] == 'True':
self.setWindowFlags(QtCore.Qt.FramelessWindowHint)
_mdi = ui.FloatArea(self)
self.setCentralWidget(_mdi)
def resizeEvent(self, QResizeEvent):
logging.info('Entropy.resizeEvent central widget size w ' + str(self.centralWidget().width()) + " h " + str(self.centralWidget().height()))
if __name__ == '__main__':
app = QApplication(sys.argv)
ex = Entropy()
ex.show()
sys.exit(app.exec_())