Exemplo n.º 1
0
 def enterEvent(event):
     original_enter_event(event)
     try:
         from ert_gui.tools import HelpCenter
         HelpCenter.getHelpCenter("ERT").setHelpMessageLink(link)
     except AttributeError:
         pass
Exemplo n.º 2
0
    def __init__(self, help_center_name, parent=None):
        QMainWindow.__init__(self, parent, Qt.WindowStaysOnTopHint)
        palette = self.palette()
        palette.setColor(self.backgroundRole(), QColor(255, 255, 224))
        self.setPalette(palette)
        self.setAutoFillBackground(True)
        self.setMinimumWidth(300)
        self.setMinimumHeight(250)
        self.setWindowTitle("Help")
        self.setObjectName("ert-gui-help")

        central_widget = QWidget()

        layout = QVBoxLayout()
        central_widget.setLayout(layout)

        self.link_widget = QLabel()
        self.link_widget.setStyleSheet("font-weight: bold")
        self.link_widget.setMinimumHeight(20)

        self.help_widget = QLabel(HelpWindow.default_help_string)
        self.help_widget.setWordWrap(True)
        self.help_widget.setTextFormat(Qt.RichText)
        self.help_widget.linkActivated.connect(self.openHelpURL)

        layout.addWidget(self.link_widget)
        layout.addWidget(self.help_widget)
        layout.addStretch(1)

        HelpCenter.getHelpCenter(help_center_name).addListener(self)

        self.__position = None
        self.__geometry = None
        self.setCentralWidget(central_widget)
Exemplo n.º 3
0
 def enterEvent(event):
     original_enter_event(event)
     try:
         from ert_gui.tools import HelpCenter
         HelpCenter.getHelpCenter("ERT").setHelpMessageLink(link)
     except AttributeError:
         pass
Exemplo n.º 4
0
    def __init__(
        self,
        name,
        help_link="",
        icon=None,
        enabled=True,
        checkable=False,
        popup_menu=False,
    ):
        super(Tool, self).__init__()
        self.__icon = icon
        self.__name = name
        self.__parent = None
        self.__enabled = enabled
        self.__checkable = checkable
        self.__help_link = help_link
        self.__is_popup_menu = popup_menu

        self.__action = QAction(self.getIcon(), self.getName(), None)
        self.__action.setIconText(self.getName())
        self.__action.setEnabled(self.isEnabled())
        self.__action.setCheckable(checkable)
        self.__action.triggered.connect(self.trigger)

        HelpCenter.addHelpToAction(self.__action, self.getHelpLink())
Exemplo n.º 5
0
    def __init__(self, help_center_name, parent=None):
        QMainWindow.__init__(self, parent, Qt.WindowStaysOnTopHint)
        palette = self.palette()
        palette.setColor(self.backgroundRole(), QColor(255, 255, 224))
        self.setPalette(palette)
        self.setAutoFillBackground(True)
        self.setMinimumWidth(300)
        self.setMinimumHeight(250)
        self.setWindowTitle("Help")
        self.setObjectName("ert-gui-help")

        central_widget = QWidget()

        layout = QVBoxLayout()
        central_widget.setLayout(layout)

        self.link_widget = QLabel()
        self.link_widget.setStyleSheet("font-weight: bold")
        self.link_widget.setMinimumHeight(20)

        self.help_widget = QLabel(HelpWindow.default_help_string)
        self.help_widget.setWordWrap(True)
        self.help_widget.setTextFormat(Qt.RichText)
        self.help_widget.linkActivated.connect(self.openHelpURL)

        layout.addWidget(self.link_widget)
        layout.addWidget(self.help_widget)
        layout.addStretch(1)

        HelpCenter.getHelpCenter(help_center_name).addListener(self)

        self.__position = None
        self.__geometry = None
        self.setCentralWidget(central_widget)
Exemplo n.º 6
0
    def enterEvent(self, event):
        QWidget.enterEvent(self, event)
        HelpCenter.getHelpCenter("ERT").setHelpMessageLink(self.help_link)

        # if HelpedWidget.__error_popup is None:
        #     HelpedWidget.__error_popup = ErrorPopup()

        if self.validation_message is not None:
            self.__error_popup.presentError(self, self.validation_message)
Exemplo n.º 7
0
    def showHelp(self):
        text_cursor = self.textCursor()
        user_data = text_cursor.block().userData()

        if user_data is not None:
            configuration_line = user_data.configuration_line

            if configuration_line.keyword().hasKeywordDefinition():
                HelpCenter.getHelpCenter("ERT").setHelpMessageLink("config/" + configuration_line.documentationLink())
Exemplo n.º 8
0
    def showHelp(self):
        text_cursor = self.textCursor()
        user_data = text_cursor.block().userData()

        if user_data is not None:
            configuration_line = user_data.configuration_line

            if configuration_line.keyword().hasKeywordDefinition():
                HelpCenter.getHelpCenter("ERT").setHelpMessageLink("config/" + configuration_line.documentationLink())
Exemplo n.º 9
0
    def enterEvent(self, event):
        QWidget.enterEvent(self, event)
        HelpCenter.getHelpCenter("ERT").setHelpMessageLink(self.help_link)

        # if HelpedWidget.__error_popup is None:
        #     HelpedWidget.__error_popup = ErrorPopup()

        if self.validation_message is not None:
            HelpedWidget.__error_popup.presentError(self, self.validation_message)
Exemplo n.º 10
0
def run_gui(args):
    app = QApplication(
        [])  # Early so that QT is initialized before other imports
    app.setWindowIcon(resourceIcon("application/window_icon_cutout"))

    _check_locale()

    help_center = HelpCenter("ERT")
    help_center.setHelpMessageLink("welcome_to_ert")

    splash = ErtSplash(version_string="Version {}".format(ert_gui.__version__))
    splash.show()
    splash.repaint()
    splash_screen_start_time = time.time()

    res_config = ResConfig(args.config)
    os.chdir(res_config.config_path)
    ert = EnKFMain(res_config, strict=True, verbose=args.verbose)
    configureErtNotifier(ert, args.config)

    window = _setup_main_window(args.config, ert)

    minimum_splash_screen_time = 2
    sleep_time_left = minimum_splash_screen_time - (time.time() -
                                                    splash_screen_start_time)
    if sleep_time_left > 0:
        time.sleep(sleep_time_left)

    window.show()
    splash.finish(window)
    window.activateWindow()
    window.raise_()

    ResLog.log(
        3,
        "Versions: ecl:%s    res:%s    ert:%s" %
        (ecl.__version__, res.__version__, ert_gui.__version__),
    )

    if not ert._real_enkf_main().have_observations():
        QMessageBox.warning(
            window,
            "Warning!",
            "No observations loaded. Model update algorithms disabled!",
        )

    finished_code = app.exec_()
    return finished_code
Exemplo n.º 11
0
    def __init__(self, name, help_link="", icon=None, enabled=True, checkable=False):
        super(Tool, self).__init__()
        self.__icon = icon
        self.__name = name
        self.__parent = None
        self.__enabled = enabled
        self.__checkable = checkable
        self.__help_link = help_link

        self.__action = QAction(self.getIcon(), self.getName(), None)
        self.__action.setIconText(self.getName())
        self.__action.setEnabled(self.isEnabled())
        self.__action.setCheckable(checkable)
        self.__action.triggered.connect(self.trigger)

        HelpCenter.addHelpToAction(self.__action, self.getHelpLink())
Exemplo n.º 12
0
def _start_window(ert, config):

    _check_locale()

    help_center = HelpCenter("ERT")
    help_center.setHelpMessageLink("welcome_to_ert")

    splash = ErtSplash(version_string="Version {}".format(ert_gui.__version__))
    splash.show()
    splash.repaint()
    splash_screen_start_time = time.time()

    configureErtNotifier(ert, config)

    window = _setup_main_window(config, ert)

    minimum_splash_screen_time = 2
    sleep_time_left = minimum_splash_screen_time - (time.time() -
                                                    splash_screen_start_time)
    if sleep_time_left > 0:
        time.sleep(sleep_time_left)

    window.show()
    splash.finish(window)
    window.activateWindow()
    window.raise_()

    ResLog.log(
        3,
        "Versions: ecl:%s    res:%s    ert:%s" %
        (ecl.__version__, res.__version__, ert_gui.__version__),
    )

    if not ert._real_enkf_main().have_observations():
        QMessageBox.warning(
            window,
            "Warning!",
            "No observations loaded. Model update algorithms disabled!",
        )

    return window
Exemplo n.º 13
0
def main(argv):

    app = QApplication(argv) #Early so that QT is initialized before other imports
    app.setWindowIcon(util.resourceIcon("application/window_icon_cutout"))

    if len(argv) == 1:
        config_file = QFileDialog.getOpenFileName(None, "Open Configuration File")

        config_file = str(config_file)

        if len(config_file) == 0:
            print("-----------------------------------------------------------------")
            print("-- You must supply the name of configuration file as the first --")
            print("-- commandline argument:                                       --")
            print("--                                                             --")
            print("-- bash%  gert <config_file>                                   --")
            print("--                                                             --")
            print("-- If the configuration file does not exist, gert will create  --")
            print("-- create a new configuration file.                            --")
            print("-----------------------------------------------------------------")

            sys.exit(1)
    else:
        config_file = argv[1]

    help_center = HelpCenter("ERT")
    help_center.setHelpLinkPrefix(os.getenv("ERT_SHARE_PATH") + "/gui/help/")
    help_center.setHelpMessageLink("welcome_to_ert")

    strict = True
        
    verbose = False
    verbose_var = os.getenv("ERT_VERBOSE", "False")
    lower_verbose_var = verbose_var.lower() 
    if lower_verbose_var == "true": 
        verbose = True


    if not os.path.exists(config_file):
        print("Trying to start new config")
        new_configuration_dialog = NewConfigurationDialog(config_file)
        success = new_configuration_dialog.exec_()
        if not success:
            print("Can not run without a configuration file.")
            sys.exit(1)
        else:
            config_file = new_configuration_dialog.getConfigurationPath()
            first_case_name = new_configuration_dialog.getCaseName()
            dbase_type = new_configuration_dialog.getDBaseType()
            num_realizations = new_configuration_dialog.getNumberOfRealizations()
            storage_path = new_configuration_dialog.getStoragePath()

            EnKFMain.createNewConfig(config_file, storage_path, first_case_name, dbase_type, num_realizations)
            strict = False


    if os.path.isdir(config_file):
        print("The specified configuration file is a directory!")
        sys.exit(1)


    splash = ErtSplash()
    splash.version = "Version %s" % Version.getVersion()
    splash.timestamp = Version.getBuildTime()

    splash.show()
    splash.repaint()

    now = time.time()


    ert = Ert(EnKFMain(config_file, strict=strict, verbose=verbose))
    ErtConnector.setErt(ert.ert())

    window = GertMainWindow()
    window.setWidget(SimulationPanel())

    plugin_handler = PluginHandler(ert.ert(), ert.ert().getWorkflowList().getPluginJobs(), window)

    help_tool = HelpTool("ERT", window)

    window.addDock("Configuration Summary", SummaryPanel(), area=Qt.BottomDockWidgetArea)
    window.addTool(IdeTool(os.path.basename(config_file), ert.reloadERT, help_tool))
    window.addTool(PlotTool(ert.ert()))
    window.addTool(ExportTool())
    window.addTool(WorkflowsTool())
    window.addTool(ManageCasesTool())
    window.addTool(PluginsTool(plugin_handler))
    window.addTool(LoadResultsTool())
    window.addTool(help_tool)

    sleep_time = 2 - (time.time() - now)

    if sleep_time > 0:
        time.sleep(sleep_time)

    window.show()
    splash.finish(window)
    window.activateWindow()
    window.raise_()
    finished_code = app.exec_()

    ert.ert().free()

    sys.exit(finished_code)
Exemplo n.º 14
0
 def enterEvent(event):
     original_enter_event(event)
     HelpCenter.getHelpCenter("ERT").setHelpMessageLink(link)
Exemplo n.º 15
0
 def enterEvent(event):
     original_enter_event(event)
     HelpCenter.getHelpCenter("ERT").setHelpMessageLink(link)
Exemplo n.º 16
0
def main(argv):
    app = QApplication(argv) #Early so that QT is initialized before other imports
    app.setWindowIcon(util.resourceIcon("application/window_icon_cutout"))

    splash = QSplashScreen(resourceImage("newsplash"), Qt.WindowStaysOnTopHint)
    splash.show()
    splash.showMessage("Starting up...", Qt.AlignLeft, Qt.white)
    app.processEvents()

    help_center = HelpCenter("ERT")
    help_center.setHelpLinkPrefix(os.getenv("ERT_SHARE_PATH") + "/gui/help/")
    help_center.setHelpMessageLink("welcome_to_ert")

    splash.showMessage("Bootstrapping...", Qt.AlignLeft, Qt.white)
    app.processEvents()

    strict = True
    site_config = os.getenv("ERT_SITE_CONFIG")
    if len(argv) == 1:
        print("-----------------------------------------------------------------")
        print("-- You must supply the name of configuration file as the first --")
        print("-- commandline argument:                                       --")
        print("--                                                             --")
        print("-- bash%  gert <config_file>                                   --")
        print("--                                                             --")
        print("-- If the configuration file does not exist, gert will create  --")
        print("-- create a new configuration file.                            --")
        print("-----------------------------------------------------------------")
    else:
        enkf_config = argv[1]
        if not os.path.exists(enkf_config):
            print("Trying to start new config")
            new_configuration_dialog = NewConfigurationDialog(enkf_config)
            success = new_configuration_dialog.exec_()
            if not success:
                print("Can not run without a configuration file.")
                sys.exit(1)
            else:
                enkf_config = new_configuration_dialog.getConfigurationPath()
                first_case_name = new_configuration_dialog.getCaseName()
                dbase_type = new_configuration_dialog.getDBaseType()
                num_realizations = new_configuration_dialog.getNumberOfRealizations()
                storage_path = new_configuration_dialog.getStoragePath()

                EnKFMain.createNewConfig(enkf_config, storage_path, first_case_name, dbase_type, num_realizations)
                strict = False

        ert = Ert(EnKFMain(enkf_config, site_config=site_config, strict=strict))
        ErtConnector.setErt(ert.ert())


        splash.showMessage("Creating GUI...", Qt.AlignLeft, Qt.white)
        app.processEvents()


        window = GertMainWindow()
        window.setWidget(SimulationPanel())

        help_tool = HelpTool("ERT", window)

        window.addDock("Configuration Summary", SummaryPanel(), area=Qt.BottomDockWidgetArea)
        window.addTool(IdeTool(os.path.basename(enkf_config), ert.reloadERT, help_tool))
        window.addTool(PlotTool())
        window.addTool(ExportTool())
        window.addTool(WorkflowsTool())
        window.addTool(ManageCasesTool())
        window.addTool(help_tool)


        splash.showMessage("Communicating with ERT...", Qt.AlignLeft, Qt.white)
        app.processEvents()

        window.show()
        splash.finish(window)

        sys.exit(app.exec_())
Exemplo n.º 17
0
 def enterEvent(event):
     original_enter_event(event)
     try:
         HelpCenter.getHelpCenter("ERT").setHelpMessageLink(link)
     except AttributeError:
         pass
Exemplo n.º 18
0
 def enterEvent(event):
     original_enter_event(event)
     try:
         HelpCenter.getHelpCenter("ERT").setHelpMessageLink(link)
     except AttributeError:
         pass
Exemplo n.º 19
0
def main(argv):
    app = QApplication(argv)  # Early so that QT is initialized before other imports
    app.setWindowIcon(resourceIcon("application/window_icon_cutout"))

    # There seems to be a setlocale() call deep down in the initialization of
    # QApplication, if the user has set the LC_NUMERIC environment variables to
    # a locale with decimalpoint different from "." the application will fail
    # hard quite quickly.
    current_locale = QLocale()
    decimal_point = str(current_locale.decimalPoint())
    if decimal_point != ".":
        msg = """
** WARNING: You are using a locale with decimalpoint: '{}' - the ert application is
            written with the assumption that '.' is used as decimalpoint, and chances
            are that something will break if you continue with this locale. It is highly
            reccomended that you set the decimalpoint to '.' using one of the environment
            variables 'LANG', LC_ALL', or 'LC_NUMERIC' to either the 'C' locale or
            alternatively a locale which uses '.' as decimalpoint.\n""".format(decimal_point)

        sys.stderr.write(msg)


    if len(argv) == 1:
        config_file = QFileDialog.getOpenFileName(None, "Open Configuration File")

        config_file = str(config_file)

        if len(config_file) == 0:
            print("-----------------------------------------------------------------")
            print("-- You must supply the name of configuration file as the first --")
            print("-- commandline argument:                                       --")
            print("--                                                             --")
            print("-- bash%  gert <config_file>                                   --")
            print("--                                                             --")
            print("-- If the configuration file does not exist, gert will create  --")
            print("-- create a new configuration file.                            --")
            print("-----------------------------------------------------------------")

            sys.exit(1)
    else:
        config_file = argv[1]

    help_center = HelpCenter("ERT")
    help_center.setHelpLinkPrefix(ert_share_path + "/gui/help/")
    help_center.setHelpMessageLink("welcome_to_ert")

    strict = True

    verbose = False
    verbose_var = os.getenv("ERT_VERBOSE", "False")
    lower_verbose_var = verbose_var.lower()
    if lower_verbose_var == "true":
        verbose = True

    if not os.path.exists(config_file):
        print("Trying to start new config")
        new_configuration_dialog = NewConfigurationDialog(config_file)
        success = new_configuration_dialog.exec_()
        if not success:
            print("Can not run without a configuration file.")
            sys.exit(1)
        else:
            config_file = new_configuration_dialog.getConfigurationPath()
            dbase_type = new_configuration_dialog.getDBaseType()
            num_realizations = new_configuration_dialog.getNumberOfRealizations()
            storage_path = new_configuration_dialog.getStoragePath()

            EnKFMain.createNewConfig(config_file, storage_path, dbase_type, num_realizations)
            strict = False

    if os.path.isdir(config_file):
        print("The specified configuration file is a directory!")
        sys.exit(1)

    splash = ErtSplash()
    version = ErtVersion( )
    splash.version = "Version %s" % version.versionString()

    splash.timestamp = version.getBuildTime()

    splash.show()
    splash.repaint()

    now = time.time()

    res_config = ResConfig(config_file)
    os.chdir( res_config.config_path )
    ert = EnKFMain(res_config, strict=strict, verbose=verbose)
    ert_gui.configureErtNotifier(ert, config_file)

    window = GertMainWindow()
    window.setWidget(SimulationPanel())

    plugin_handler = PluginHandler(ert, ert.getWorkflowList().getPluginJobs(), window)

    help_tool = HelpTool("ERT", window)

    window.addDock("Configuration Summary", SummaryPanel(), area=Qt.BottomDockWidgetArea)
    window.addTool(IdeTool(os.path.basename(config_file), help_tool))
    window.addTool(PlotTool())
    window.addTool(ExportTool())
    window.addTool(WorkflowsTool())
    window.addTool(ManageCasesTool())
    window.addTool(PluginsTool(plugin_handler))
    window.addTool(RunAnalysisTool())
    window.addTool(LoadResultsTool())
    window.addTool(help_tool)

    sleep_time = 2 - (time.time() - now)

    if sleep_time > 0:
        time.sleep(sleep_time)

    window.show()
    splash.finish(window)
    window.activateWindow()
    window.raise_()
    ResLog.log(3, "Versions ecl:%s  res:%s   ert:%s" % (EclVersion( ), ResVersion( ), ErtVersion( )))
    finished_code = app.exec_()
    sys.exit(finished_code)
Exemplo n.º 20
0
def main(argv):
    app = QApplication(
        argv)  # Early so that QT is initialized before other imports
    app.setWindowIcon(resourceIcon("application/window_icon_cutout"))

    # There seems to be a setlocale() call deep down in the initialization of
    # QApplication, if the user has set the LC_NUMERIC environment variables to
    # a locale with decimalpoint different from "." the application will fail
    # hard quite quickly.
    current_locale = QLocale()
    decimal_point = str(current_locale.decimalPoint())
    if decimal_point != ".":
        msg = """
** WARNING: You are using a locale with decimalpoint: '{}' - the ert application is
            written with the assumption that '.' is used as decimalpoint, and chances
            are that something will break if you continue with this locale. It is highly
            reccomended that you set the decimalpoint to '.' using one of the environment
            variables 'LANG', LC_ALL', or 'LC_NUMERIC' to either the 'C' locale or
            alternatively a locale which uses '.' as decimalpoint.\n""".format(
            decimal_point)

        sys.stderr.write(msg)

    if len(argv) == 1:
        config_file = QFileDialog.getOpenFileName(None,
                                                  "Open Configuration File")

        config_file = str(config_file)

        if len(config_file) == 0:
            print(
                "-----------------------------------------------------------------"
            )
            print(
                "-- You must supply the name of configuration file as the first --"
            )
            print(
                "-- commandline argument:                                       --"
            )
            print(
                "--                                                             --"
            )
            print(
                "-- bash%  gert <config_file>                                   --"
            )
            print(
                "--                                                             --"
            )
            print(
                "-- If the configuration file does not exist, gert will create  --"
            )
            print(
                "-- create a new configuration file.                            --"
            )
            print(
                "-----------------------------------------------------------------"
            )

            sys.exit(1)
    else:
        config_file = argv[1]

    help_center = HelpCenter("ERT")
    help_center.setHelpMessageLink("welcome_to_ert")

    strict = True

    verbose = False
    verbose_var = os.getenv("ERT_VERBOSE", "False")
    lower_verbose_var = verbose_var.lower()
    if lower_verbose_var == "true":
        verbose = True

    if not os.path.exists(config_file):
        print("Trying to start new config")
        new_configuration_dialog = NewConfigurationDialog(config_file)
        success = new_configuration_dialog.exec_()
        if not success:
            print("Can not run without a configuration file.")
            sys.exit(1)
        else:
            config_file = new_configuration_dialog.getConfigurationPath()
            dbase_type = new_configuration_dialog.getDBaseType()
            num_realizations = new_configuration_dialog.getNumberOfRealizations(
            )
            storage_path = new_configuration_dialog.getStoragePath()

            EnKFMain.createNewConfig(config_file, storage_path, dbase_type,
                                     num_realizations)
            strict = False

    if os.path.isdir(config_file):
        print("The specified configuration file is a directory!")
        sys.exit(1)

    splash = ErtSplash()
    splash.version = "Version %s" % ert_gui.__version__

    splash.show()
    splash.repaint()

    now = time.time()

    res_config = ResConfig(config_file)
    os.chdir(res_config.config_path)
    ert = EnKFMain(res_config, strict=strict, verbose=verbose)
    ert_gui.configureErtNotifier(ert, config_file)

    window = GertMainWindow()
    window.setWidget(SimulationPanel())

    plugin_handler = PluginHandler(ert,
                                   ert.getWorkflowList().getPluginJobs(),
                                   window)

    help_tool = HelpTool("ERT", window)

    window.addDock("Configuration Summary",
                   SummaryPanel(),
                   area=Qt.BottomDockWidgetArea)
    window.addTool(IdeTool(os.path.basename(config_file), help_tool))
    window.addTool(PlotTool())
    window.addTool(ExportTool())
    window.addTool(WorkflowsTool())
    window.addTool(ManageCasesTool())
    window.addTool(PluginsTool(plugin_handler))
    window.addTool(RunAnalysisTool())
    window.addTool(LoadResultsTool())
    window.addTool(help_tool)
    window.adjustSize()
    sleep_time = 2 - (time.time() - now)

    if sleep_time > 0:
        time.sleep(sleep_time)

    window.show()
    splash.finish(window)
    window.activateWindow()
    window.raise_()
    ResLog.log(
        3, "Versions: ecl:%s    res:%s    ert:%s" %
        (ecl.__version__, res.__version__, ert_gui.__version__))

    if not ert._real_enkf_main().have_observations():
        em = QMessageBox.warning(
            window, "Warning!",
            "No observations loaded. Model update algorithms disabled!")

    finished_code = app.exec_()
    sys.exit(finished_code)
Exemplo n.º 21
0
def main(argv):
    app = QApplication(argv) #Early so that QT is initialized before other imports
    app.setWindowIcon(util.resourceIcon("application/window_icon_cutout"))

    splash = ErtSplash()
    splash.version = "Version %s" % Version.getVersion()
    splash.timestamp = Version.getBuildTime()

    splash.show()
    splash.repaint()
    
    now = time.time()

    help_center = HelpCenter("ERT")
    help_center.setHelpLinkPrefix(os.getenv("ERT_SHARE_PATH") + "/gui/help/")
    help_center.setHelpMessageLink("welcome_to_ert")

    strict = True
    site_config = os.getenv("ERT_SITE_CONFIG")
    if len(argv) == 1:
        print("-----------------------------------------------------------------")
        print("-- You must supply the name of configuration file as the first --")
        print("-- commandline argument:                                       --")
        print("--                                                             --")
        print("-- bash%  gert <config_file>                                   --")
        print("--                                                             --")
        print("-- If the configuration file does not exist, gert will create  --")
        print("-- create a new configuration file.                            --")
        print("-----------------------------------------------------------------")
    else:
        enkf_config = argv[1]
        if not os.path.exists(enkf_config):
            print("Trying to start new config")
            new_configuration_dialog = NewConfigurationDialog(enkf_config)
            success = new_configuration_dialog.exec_()
            if not success:
                print("Can not run without a configuration file.")
                sys.exit(1)
            else:
                enkf_config = new_configuration_dialog.getConfigurationPath()
                first_case_name = new_configuration_dialog.getCaseName()
                dbase_type = new_configuration_dialog.getDBaseType()
                num_realizations = new_configuration_dialog.getNumberOfRealizations()
                storage_path = new_configuration_dialog.getStoragePath()

                EnKFMain.createNewConfig(enkf_config, storage_path, first_case_name, dbase_type, num_realizations)
                strict = False

        ert = Ert(EnKFMain(enkf_config, site_config=site_config, strict=strict))
        ErtConnector.setErt(ert.ert())

        window = GertMainWindow()
        window.setWidget(SimulationPanel())

        help_tool = HelpTool("ERT", window)

        window.addDock("Configuration Summary", SummaryPanel(), area=Qt.BottomDockWidgetArea)
        window.addTool(IdeTool(os.path.basename(enkf_config), ert.reloadERT, help_tool))
        window.addTool(PlotTool())
        window.addTool(ExportTool())
        window.addTool(WorkflowsTool(ert.reloadERT))
        window.addTool(ManageCasesTool())
        window.addTool(LoadResultsTool())
        window.addTool(help_tool)

        sleep_time = 2 - (time.time() - now)

        if sleep_time > 0:
            time.sleep(sleep_time)

        window.show()
        splash.finish(window)
        window.activateWindow()
        window.raise_()
        finished_code = app.exec_()

        ert.ert().free()

        sys.exit(finished_code)