def main():
if getattr(sys, "frozen", False) and sys.platform in ['win32','cygwin','win64']:
# and now redirect all default streams to DummyStream:
sys.stdout = DummyStream()
sys.stderr = DummyStream()
sys.stdin = DummyStream()
sys.__stdout__ = DummyStream()
sys.__stderr__ = DummyStream()
sys.__stdin__ = DummyStream()
# Get application path
app_path = getAppPath()
if sys.platform == 'darwin' and hasattr(sys, 'frozen'):
resources_path = os.path.normpath(os.path.abspath(os.path.join(app_path, "..", "Resources")))
else:
resources_path = os.path.normpath(os.path.abspath(os.path.join(app_path, "Resources")))
# Application setup
app = QSingleApplication(sys.argv)
app.setOrganizationName('Sumokoin')
app.setOrganizationDomain('www.sumokoin.org')
app.setApplicationName(APP_NAME)
app.setProperty("AppPath", app_path)
app.setProperty("ResPath", resources_path)
if sys.platform == 'darwin':
app.setAttribute(QtCore.Qt.AA_DontShowIconsInMenus)
if not _check_file_integrity(app):
QMessageBox.critical(None, "Application Fatal Error", """<b>File integrity check failed!</b>
<br><br>This could be a result of unknown (maybe, malicious) action<br> to wallet code files.""")
app.quit()
else:
hub = Hub(app=app)
ui = MainWebUI(app=app, hub=hub, debug=False)
hub.setUI(ui)
app.singleStart(ui)
sys.exit(app.exec_())
评论列表
文章目录