forked from GiddensA/adbLogcatTool
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
44 lines (38 loc) · 1.15 KB
/
main.py
File metadata and controls
44 lines (38 loc) · 1.15 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
import os.path
from module.adbManager import *
from module.settingDefines import *
from module.shortcutModule import ShortcutModule
from module.sqlManager import *
from uilogic.mainWindow import MainWindow
from utils.UIUtils import *
def launchCheck():
firstTimeFlag = False
# 1. check adb
hasAdb = ADBManager.get_instance().CheckADB()
if not hasAdb:
ShowMessageDialog(MESSAGE_TYPE_WARNING, MESSAGE_STR_ADB_ERROR_QUIT)
sys.exit(0)
# 2. check cache dir
path = os.path.join(GetAppDataDir(), TOOLS_ROOT_DIR)
if not IsPathExsist(path):
Mkdir(path)
firstTimeFlag = True
else:
# 3. check db
path = os.path.join(path, TOOLS_DB_NAME)
if not IsDbExist(path):
firstTimeFlag = True
if firstTimeFlag:
Init_DB()
return firstTimeFlag
if __name__ == '__main__':
QApplication.setAttribute(Qt.AA_EnableHighDpiScaling)
app = QApplication(sys.argv)
if len(sys.argv) > 1:
shortcut = ShortcutModule()
sys.exit(0)
else:
firstTime = launchCheck()
window = MainWindow()
window.show(firstTime)
sys.exit(app.exec_())