diff --git a/docs/installation.rst b/docs/installation.rst index 9075d450a..234d6b6c6 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -124,23 +124,9 @@ versions for dependencies. :: (mssenv) $ msui -Update ------- - -Builtin Update +Update Methods .............. -Since version 5.0 we provide a feature for updating MSS by the UI or the command line -After you started the MSS UI it informs you after a while if there is a new update available. -From the command line you can trigger this update feature by :: - - (mssenv) $ msui --update - - - -Other Methods -............. - For updating an existing MSS installation to the current version, it is best to install it into a new environment. If your current version is not far behind the new version you could try the `mamba update mss` as described. diff --git a/mslib/mscolab/app/__init__.py b/mslib/mscolab/app/__init__.py index 374383e1c..1e9fe719e 100644 --- a/mslib/mscolab/app/__init__.py +++ b/mslib/mscolab/app/__init__.py @@ -25,6 +25,7 @@ """ import os +import logging import sqlalchemy from flask_migrate import Migrate @@ -34,7 +35,11 @@ from flask import Flask, url_for from mslib.mscolab.conf import mscolab_settings from flask_sqlalchemy import SQLAlchemy -from mslib.utils import prefix_route +from mslib.utils import prefix_route, release_info + +message, update = release_info.check_for_new_release() +if update: + logging.warning(message) DOCS_SERVER_PATH = os.path.dirname(os.path.abspath(mslib.__file__)) diff --git a/mslib/mscolab/mscolab.py b/mslib/mscolab/mscolab.py index 445dc2f7c..e3b521872 100644 --- a/mslib/mscolab/mscolab.py +++ b/mslib/mscolab/mscolab.py @@ -45,7 +45,6 @@ from mslib.mscolab.server import APP from mslib.mscolab.utils import create_files from mslib.utils import setup_logging -from mslib.utils.qt import Worker, Updater def handle_start(args): @@ -358,7 +357,6 @@ def handle_sso_metadata_init(repo_exists): def main(): parser = argparse.ArgumentParser() parser.add_argument("-v", "--version", help="show version", action="store_true", default=False) - parser.add_argument("--update", help="Updates MSS to the newest version", action="store_true", default=False) subparsers = parser.add_subparsers(help='Available actions', dest='action') @@ -407,16 +405,6 @@ def main(): except git.exc.InvalidGitRepositoryError: repo_exists = False - updater = Updater() - if args.update: - updater.on_update_available.connect(lambda old, new: updater.update_mss()) - updater.on_log_update.connect(lambda s: print(s.replace("\n", ""))) - updater.on_status_update.connect(lambda s: print(s.replace("\n", ""))) - updater.run() - while Worker.workers: - list(Worker.workers)[0].wait() - sys.exit() - if args.action == "start": handle_start(args) diff --git a/mslib/msui/msui.py b/mslib/msui/msui.py index 0a4c4108e..b15bab1aa 100644 --- a/mslib/msui/msui.py +++ b/mslib/msui/msui.py @@ -42,7 +42,6 @@ from mslib.msui import constants from mslib.utils import setup_logging from mslib.msui.icons import icons -from mslib.utils.qt import Worker, Updater from mslib.utils.config import read_config_file from PyQt5 import QtGui, QtCore, QtWidgets @@ -62,7 +61,6 @@ def main(tutorial_mode=False): parser.add_argument("--debug", help="show debugging log messages on console", action="store_true", default=False) parser.add_argument("--logfile", help="Specify logfile location. Set to empty string to disable.", action="store", default=os.path.join(constants.MSUI_CONFIG_PATH, "msui.log")) - parser.add_argument("--update", help="Updates MSS to the newest version", action="store_true", default=False) args = parser.parse_args() @@ -74,16 +72,6 @@ def main(tutorial_mode=False): print("Version:", __version__) sys.exit() - if args.update: - updater = Updater() - updater.on_update_available.connect(lambda old, new: updater.update_mss()) - updater.on_log_update.connect(lambda s: print(s.replace("\n", ""))) - updater.on_status_update.connect(lambda s: print(s.replace("\n", ""))) - updater.run() - while Worker.workers: - list(Worker.workers)[0].wait() - sys.exit() - setup_logging(args) logging.info("MSS Version: %s", __version__) diff --git a/mslib/msui/msui_mainwindow.py b/mslib/msui/msui_mainwindow.py index f1ec9768b..99a0ea409 100644 --- a/mslib/msui/msui_mainwindow.py +++ b/mslib/msui/msui_mainwindow.py @@ -46,11 +46,11 @@ from mslib.msui import flighttrack as ft from mslib.msui import tableview, topview, sideview, linearview from mslib.msui import constants, editor, mscolab -from mslib.msui.updater import UpdaterUI from mslib.plugins.io.csv import load_from_csv, save_to_csv from mslib.msui.icons import icons, python_powered from mslib.utils.qt import get_open_filenames, get_save_filename, show_popup from mslib.utils.config import read_config_file, config_loader +from mslib.utils import release_info from PyQt5 import QtGui, QtCore, QtWidgets from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas @@ -408,6 +408,7 @@ def __init__(self, parent=None): super().__init__(parent) self.setupUi(self) self.lblVersion.setText(f"Version: {__version__}") + self.lblNewVersion.setText(f"{release_info.check_for_new_release()[0]}") self.milestone_url = f'https://github.com/Open-MSS/MSS/issues?q=is%3Aclosed+milestone%3A{__version__[:-1]}' self.lblChanges.setText(f'New Features and Changes') blub = QtGui.QPixmap(python_powered()) @@ -532,10 +533,6 @@ def __init__(self, mscolab_data_dir=None, tutorial_mode=False, *args): self.mscolab.signal_render_new_permission.connect( lambda op_id, path: self.signal_render_new_permission.emit(op_id, path)) - # Don't start the updater during a test run of msui - if "pytest" not in sys.modules: - self.updater = UpdaterUI(self) - self.actionUpdater.triggered.connect(self.updater.show) self.openOperationsGb.hide() def bring_main_window_to_front(self): diff --git a/mslib/msui/qt5/ui_about_dialog.py b/mslib/msui/qt5/ui_about_dialog.py index 32d6a9f15..46725b0ff 100644 --- a/mslib/msui/qt5/ui_about_dialog.py +++ b/mslib/msui/qt5/ui_about_dialog.py @@ -2,9 +2,10 @@ # Form implementation generated from reading ui file 'ui_about_dialog.ui' # -# Created by: PyQt5 UI code generator 5.12.3 +# Created by: PyQt5 UI code generator 5.15.9 # -# WARNING! All changes made in this file will be lost! +# WARNING: Any manual changes made to this file will be lost when pyuic5 is +# run again. Do not edit this file unless you know what you are doing. from PyQt5 import QtCore, QtGui, QtWidgets @@ -13,7 +14,7 @@ class Ui_AboutMSUIDialog(object): def setupUi(self, AboutMSUIDialog): AboutMSUIDialog.setObjectName("AboutMSUIDialog") - AboutMSUIDialog.resize(1052, 600) + AboutMSUIDialog.resize(1052, 771) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) @@ -82,6 +83,9 @@ def setupUi(self, AboutMSUIDialog): self.lblChanges.setObjectName("lblChanges") self.horizontalLayout_2.addWidget(self.lblChanges) self.verticalLayout_2.addLayout(self.horizontalLayout_2) + self.lblNewVersion = QtWidgets.QLabel(AboutMSUIDialog) + self.lblNewVersion.setObjectName("lblNewVersion") + self.verticalLayout_2.addWidget(self.lblNewVersion) spacerItem2 = QtWidgets.QSpacerItem(20, 10, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Preferred) self.verticalLayout_2.addItem(spacerItem2) self.lblLicense = QtWidgets.QLabel(AboutMSUIDialog) @@ -109,7 +113,7 @@ def setupUi(self, AboutMSUIDialog): self.verticalLayout.addLayout(self.verticalLayout_2) self.retranslateUi(AboutMSUIDialog) - self.btOK.clicked.connect(AboutMSUIDialog.accept) + self.btOK.clicked.connect(AboutMSUIDialog.accept) # type: ignore QtCore.QMetaObject.connectSlotsByName(AboutMSUIDialog) def retranslateUi(self, AboutMSUIDialog): @@ -120,25 +124,26 @@ def retranslateUi(self, AboutMSUIDialog): self.textBrowser.setHtml(_translate("AboutMSUIDialog", "\n" "
\n" -"Please read the reference documentation:
\n" -"Bauer, R., Grooß, J.-U., Ungermann, J., Bär, M., Geldenhuys, M., and Hoffmann, L.: The Mission Support
\n" -"System (MSS v7.0.4) and its use in planning for the SouthTRAC aircraft campaign, Geosci.
\n" -"Model Dev., 15, 8983–8997, https://doi.org/10.5194/gmd-15-8983-2022, 2022.
\n" -"Rautenhaus, M., Bauer, G., and Doernbrack, A.: A web service based tool to plan
\n" -"atmospheric research flights, Geosci. Model Dev., 5,55-71, https://doi.org/10.5194/gmd-5-55-2012, 2012.
\n" -"and the paper\'s Supplement (which includes a tutorial) before using the application. The documents are available at:
\n" -"* http://www.geosci-model-dev.net/5/55/2012/gmd-5-55-2012.pdf
\n" -"* http://www.geosci-model-dev.net/5/55/2012/gmd-5-55-2012-supplement.pdf
\n" -"\n" -"
When using this software, please be so kind and acknowledge its use by citing the above mentioned reference documentation in publications, presentations, reports, etc. that you create. Thank you very much.
")) +"\n" +"Please read the reference documentation:
\n" +"Bauer, R., Grooß, J.-U., Ungermann, J., Bär, M., Geldenhuys, M., and Hoffmann, L.: The Mission Support
\n" +"System (MSS v7.0.4) and its use in planning for the SouthTRAC aircraft campaign, Geosci.
\n" +"Model Dev., 15, 8983–8997, https://doi.org/10.5194/gmd-15-8983-2022, 2022.
\n" +"Rautenhaus, M., Bauer, G., and Doernbrack, A.: A web service based tool to plan
\n" +"atmospheric research flights, Geosci. Model Dev., 5,55-71, https://doi.org/10.5194/gmd-5-55-2012, 2012.
\n" +"and the paper\'s Supplement (which includes a tutorial) before using the application. The documents are available at:
\n" +"* http://www.geosci-model-dev.net/5/55/2012/gmd-5-55-2012.pdf
\n" +"* http://www.geosci-model-dev.net/5/55/2012/gmd-5-55-2012-supplement.pdf
\n" +"\n" +"
When using this software, please be so kind and acknowledge its use by citing the above mentioned reference documentation in publications, presentations, reports, etc. that you create. Thank you very much.