Exemple #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('Galluscoin')
    app.setOrganizationDomain('www.galluscoin.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_())
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

    abspath = os.path.abspath(__file__)
    app_path = os.path.dirname(abspath)
    #os.chdir(app_path)
    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('Ombre')
    app.setOrganizationDomain('www.ombre.io')
    app.setApplicationName(APP_NAME)
    app.setProperty("AppPath", app_path)
    app.setProperty("ResPath", resources_path)
    if sys.platform == 'darwin':
        app.setAttribute(QtCore.Qt.AA_DontShowIconsInMenus)

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

    sys.exit(app.exec_())