diff --git a/iblrig/base_tasks.py b/iblrig/base_tasks.py index 3e918f464..250a5ef67 100644 --- a/iblrig/base_tasks.py +++ b/iblrig/base_tasks.py @@ -80,8 +80,9 @@ def __init__(self, subject=None, task_parameter_file=None, file_hardware_setting BaseSession.checked_for_update = True update_status, remote_version = check_for_updates() if update_status is True: - print(f"\nUpdate to iblrig {remote_version} is available! Please update using 'git pull'.\n") - + print(f"\nUpdate to iblrig {remote_version} is available!\n" + f"Please update by issuing:\n\n" + f" pip install --upgrade -e .\n") while True: print("- Press [Enter] to exit IBL Rig and perform the update right away.\n" "- Enter 'I will update later' to continue without updating.") diff --git a/iblrig/gui/wizard.py b/iblrig/gui/wizard.py index 758a75f9d..99bd79709 100644 --- a/iblrig/gui/wizard.py +++ b/iblrig/gui/wizard.py @@ -8,6 +8,7 @@ import yaml import traceback import webbrowser +from random import choice from PyQt5 import QtWidgets, QtCore, uic from PyQt5.QtWidgets import QStyle @@ -153,13 +154,18 @@ def __init__(self, *args, **kwargs): def check_for_update(self): update_available, remote_version = check_for_updates() if update_available == 1: + cmdBox = QtWidgets.QLineEdit('pip install --upgrade -e .') + cmdBox.setReadOnly(True) msgBox = QtWidgets.QMessageBox(parent=self) msgBox.setWindowTitle("Update Notice") - msgBox.setText(f"Update toiblrig {remote_version} is available.") - msgBox.setInformativeText("Please update using 'git pull'.") + msgBox.setText(f"Update to iblrig {remote_version} is available.\n\n" + f"Please update iblrig by issuing:") msgBox.setStandardButtons(QtWidgets.QMessageBox.Ok) msgBox.setIcon(QtWidgets.QMessageBox().Information) - msgBox.findChild(QtWidgets.QPushButton).setText('Yes, I promise!') + msgBox.layout().addWidget(cmdBox, 1, 2) + msgBox.findChild(QtWidgets.QPushButton).setText( + choice(['Yes, I promise!', 'I will do so immediately!', + 'Straight away!', 'Of course I will!'])) msgBox.exec_() self.setDisabled(False) self.statusbar.showMessage(f"iblrig v{remote_version}")