Skip to content
This repository has been archived by the owner on Jul 9, 2024. It is now read-only.

Commit

Permalink
Fix version #380 (#382)
Browse files Browse the repository at this point in the history
* Create version.txt

* Update utils - removed empty lines/comments

* Added output if source files are used.

* Update gui.py
  • Loading branch information
stefanogito authored Jun 8, 2021
1 parent 412b3e7 commit 9028a25
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 16 deletions.
35 changes: 23 additions & 12 deletions gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 1 addition & 4 deletions tools/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
source

0 comments on commit 9028a25

Please sign in to comment.