-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathpet4l.py
56 lines (42 loc) · 1.6 KB
/
pet4l.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import sys
if __name__ == '__main__':
# parse input if there's `--clear[?]Data` flags
import argparse
parser = argparse.ArgumentParser(description='PET4L')
parser.add_argument('--clearAppData', dest='clearAppData', action='store_true',
help='clear all previously saved application data')
parser.add_argument('--clearTxCache', dest='clearTxCache', action='store_true',
help='clear raw transactions cache')
parser.set_defaults(clearAppData=False)
parser.set_defaults(clearTxCache=False)
args = parser.parse_args()
if getattr(sys, 'frozen', False):
# running in a bundle
sys.path.append(os.path.join(sys._MEIPASS, 'src'))
imgDir = os.path.join(sys._MEIPASS, 'img')
# if linux export qt plugins path
if sys.platform == 'linux':
os.environ['QT_QPA_PLATFORM_PLUGIN_PATH'] = os.path.join(sys._MEIPASS, 'PyQt5', 'Qt', 'plugins')
else:
# running live
sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'src'))
imgDir = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'img')
from PyQt5.QtWidgets import QApplication
from mainApp import App
# Create App
app = QApplication(sys.argv)
# --------------
# Create QMainWindow Widget
ex = App(imgDir, app, args)
# -- Launch RPC watchdog
ex.mainWindow.rpc_watchdogThread.start()
# Execute App
app.exec_()
try:
app.deleteLater()
except Exception as e:
print(e)
sys.exit()