-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
executable file
·63 lines (56 loc) · 2.23 KB
/
main.py
File metadata and controls
executable file
·63 lines (56 loc) · 2.23 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# -*- coding: utf-8 -*-
#
# Author: Alessandro Zangari ([email protected])
# Copyright: © Copyright 2020 Alessandro Zangari, Università degli Studi di Padova
# License: GPL-3.0-or-later
# Date: 2020-10-04
# Version: 1.0
#
# This file is part of DataMole.
#
# DataMole is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# any later version.
#
# DataMole is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with DataMole. If not, see <https://www.gnu.org/licenses/>.
import sys
from PySide2 import QtCore
from PySide2.QtCore import QFile
from PySide2.QtWidgets import QApplication
from dataMole import flogging
# noinspection PyUnresolvedReferences
from dataMole import qt_resources
if __name__ == '__main__':
print('dataMole v. 0.1')
print('Built on Python', sys.version)
# Set up logger, QApp
app = QApplication([])
flogging.setUpRootLogger()
rootFmt = '%(asctime)s:%(levelname)s:%(module)s.%(funcName)s:%(lineno)d:%(message)s'
flogging.setUpLogger(name='app', folder='app', fmt=rootFmt, level=flogging.LEVEL)
flogging.setUpLogger(name='ops', folder='operations', fmt='%(message)s', level=flogging.INFO)
QtCore.qInstallMessageHandler(flogging.qtMessageHandler)
styleFile = QFile(':/resources/style.css')
styleFile.open(QFile.ReadOnly)
styleStr: str = str(styleFile.readAll(), encoding='utf-8')
app.setStyleSheet(styleStr)
styleFile.close()
# Initialize globals and mainWindow
from dataMole import gui
mw = gui.window.MainWindow()
# Create status bar
gui.statusBar = gui.widgets.statusbar.StatusBar(mw)
mw.setStatusBar(gui.statusBar)
gui.notifier = gui.widgets.notifications.Notifier(mw)
# Set notifier in main window for update
mw.notifier = gui.notifier
gui.notifier.mNotifier.updatePosition()
mw.show()
sys.exit(app.exec_())