forked from SergeyPotapov01/bot_Clash_Royale
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
40 lines (28 loc) · 965 Bytes
/
main.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
32
33
34
35
36
37
38
39
40
import sys
import json
from gui import Ui_MainWindow
from loguru import logger
from PyQt5 import QtWidgets
DEBUG = False
logger.add('log/CrownFarm.log', format='{time:YYYY-MM-DD HH:mm:ss} {level} {message}',
level='INFO', rotation='1 week', compression='zip')
if DEBUG:
logger.add('log/DEBUG.log', format='{time:HH:mm:ss} {level} {message}',
level='DEBUG', rotation='1 week', compression='zip')
__version__ = '0.3.17'
try:
with open('config/custom.json') as f:
config = json.load(f)
except FileNotFoundError:
with open('config/standart.json') as f:
config = json.load(f)
if __name__ == '__main__':
print(sys.version)
app = QtWidgets.QApplication(sys.argv)
MainWindow = QtWidgets.QMainWindow()
ui = Ui_MainWindow(config)
ui.setupUi(MainWindow)
ui.debugButton()
ui.load_setting(config)
MainWindow.show()
sys.exit(app.exec_())