예제 #1
0
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('nur1labs')
    app.setOrganizationDomain('nur1labs.net')
    app.setApplicationName(APP_NAME)
    app.setProperty("AppPath", app_path)
    app.setProperty("ResPath", resources_path)
    if sys.platform != 'win32':
        app.setAttribute(qt_core.Qt.AA_DontShowIconsInMenus)

    app.setStyleSheet('QMainWindow{background-color: white;}')
    app.setStyleSheet('QDialog{background-color: white;}')

    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 code files."""
        )
        app.quit()
        return

    hub = Hub(app=app)
    ui = WebUI(app=app, hub=hub, debug=False)
    hub.setUI(ui)
    app.singleStart(ui)

    sys.exit(app.exec_())
예제 #2
0
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()
    resources_path = getResourcesPath()

    # Application setup

    app = QSingleApplication(sys.argv)
    app.setOrganizationName('Ryo')
    app.setOrganizationDomain('ryo-currency.com')
    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_())
예제 #3
0
파일: main.py 프로젝트: dcycoin/xdc-gui
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('XDC')
    app.setOrganizationDomain('www.blockchain.net.my')
    app.setApplicationName(APP_NAME)
    app.setProperty("AppPath", app_path)
    app.setProperty("ResPath", resources_path)
    if sys.platform == 'darwin':
        app.setAttribute(QtCore.Qt.AA_DontShowIconsInMenus)

    else:
        hub = Hub(app=app)
        ui = MainWebUI(app=app, hub=hub, debug=False)
        hub.setUI(ui)
        app.singleStart(ui)

        sys.exit(app.exec_())