Skip to content
This repository has been archived by the owner on Jan 20, 2025. It is now read-only.

Commit

Permalink
fix update dialog
Browse files Browse the repository at this point in the history
- fix initializer
- fix exec call
- fix opening link
  • Loading branch information
leminlimez committed Dec 4, 2024
1 parent 560a9b9 commit 563c426
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions controllers/web_request_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from json import JSONDecodeError
from devicemanagement.constants import Version

Nugget_Repo_URL = "https://api.github.com/repos/leminlimez/Nugget/releases/latest"
Nugget_Repo = "leminlimez/Nugget/releases/latest"

last_fetched_version: str = None

Expand All @@ -23,7 +23,7 @@ def get_latest_version() -> str:
return last_fetched_version
# fetch with web requests
try:
response = get(Nugget_Repo_URL)
response = get(f"https://api.github.com/repos/{Nugget_Repo}")
response.raise_for_status() # To raise an exception for 4xx/5xx responses

data = response.json() # Parse the JSON response
Expand Down
6 changes: 3 additions & 3 deletions gui/dialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from webbrowser import open_new_tab

from controllers.web_request_handler import Nugget_Repo_URL, get_latest_version
from controllers.web_request_handler import Nugget_Repo, get_latest_version

class GestaltDialog(QDialog):
def __init__(self, device_manager, gestalt_label, selected_file, parent=None):
Expand Down Expand Up @@ -34,7 +34,7 @@ def accept(self):

class UpdateAppDialog(QDialog):
def __init__(self, parent=None):
super.__init__(parent)
super().__init__(parent)

QBtn = (
QDialogButtonBox.Ok | QDialogButtonBox.Cancel
Expand Down Expand Up @@ -64,5 +64,5 @@ def __init__(self, parent=None):

def accept(self):
# open up the repo page
open_new_tab(Nugget_Repo_URL)
open_new_tab(f"https://github.com/{Nugget_Repo}")
super().accept()
2 changes: 1 addition & 1 deletion gui/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def __init__(self, device_manager: DeviceManager):
# Check for an update
if is_update_available(App_Version, App_Build):
# notify with prompt to download the new version from github
UpdateAppDialog()
UpdateAppDialog().exec()
# Update the app version/build number label
self.updateAppVersionLabel()

Expand Down

0 comments on commit 563c426

Please sign in to comment.