diff --git a/gui.py b/gui.py index df2039cc..de6a4dcd 100644 --- a/gui.py +++ b/gui.py @@ -131,18 +131,29 @@ def check_update(self): # Auf Update prüfen if update_available(): url = f"https://github.com/iamnotturner/vaccipy/releases/tag/{get_latest_version()}" - - msg = QtWidgets.QMessageBox() - msg.setIcon(QtWidgets.QMessageBox.Warning) - msg.setWindowTitle("Alte Version!") - msg.setText("Bitte Update installieren") - msg.setInformativeText(f"Die Terminsuche funktioniert möglicherweise nicht, da du eine alte Version verwendest ({get_current_version()})") - msg.addButton(msg.Close) - btn_download = msg.addButton("Download", msg.ApplyRole) - - btn_download.clicked.connect(lambda: open_browser(url)) - - msg.exec_() + + if get_current_version() != 'source': + msg = QtWidgets.QMessageBox() + msg.setIcon(QtWidgets.QMessageBox.Warning) + msg.setWindowTitle("Alte Version!") + msg.setText("Bitte Update installieren") + msg.setInformativeText(f"Die Terminsuche funktioniert möglicherweise nicht, da du eine alte Version verwendest ({get_current_version()})") + msg.addButton(msg.Close) + btn_download = msg.addButton("Download", msg.ApplyRole) + btn_download.clicked.connect(lambda: open_browser(url)) + msg.exec_() + + else: + msg = QtWidgets.QMessageBox() + msg.setIcon(QtWidgets.QMessageBox.information) + msg.setWindowTitle("Sourcecode") + msg.setText("Updateprüfung nicht möglich!") + msg.setInformativeText("Du benutzt die nicht paketierten Skripte von Github. Die Terminsuche funktioniert möglicherweise nicht, da die Version veraltet sein könnten.") + msg.addButton(msg.Close) + btn_download = msg.addButton("Download", msg.ApplyRole) + btn_download.clicked.connect(lambda: open_browser(url)) + msg.exec_() + except Exception as error: # warum auch immer konnte nicht überprüft werden # einfach nichts machen diff --git a/tools/utils.py b/tools/utils.py index c0108a6d..bc336502 100644 --- a/tools/utils.py +++ b/tools/utils.py @@ -149,12 +149,9 @@ def get_grouped_impfzentren() -> dict: return result def update_available(): - - # 2 Zeichen Puffer für zukünftige Versionssprünge current_version = get_current_version() latest_version = get_latest_version() - - + if latest_version.strip() == current_version.strip(): return False else: diff --git a/version.txt b/version.txt new file mode 100644 index 00000000..5a18cd2f --- /dev/null +++ b/version.txt @@ -0,0 +1 @@ +source