diff --git a/source/check_update.py b/source/check_update.py index d08d77f..e5d96d6 100644 --- a/source/check_update.py +++ b/source/check_update.py @@ -5,7 +5,7 @@ import json import sys import os -VERSION_FILE_URL = "https://raw.githubusercontent.com/Faraphel/MKWF-Install/master/version" +from .definition import * def check_update(self): diff --git a/source/definition.py b/source/definition.py index 3f39d20..1d5baab 100644 --- a/source/definition.py +++ b/source/definition.py @@ -1,5 +1,8 @@ CREATE_NO_WINDOW = 0x08000000 VERSION = "0.8.1" +GITHUB_REPOSITORY = "Faraphel/MKWF-Install" +GITHUB_CONTENT_ROOT = f"https://raw.githubusercontent.com/{GITHUB_REPOSITORY}/master/" +VERSION_FILE_URL = GITHUB_CONTENT_ROOT + "version" get_filename = lambda file: ".".join(file.split(".")[:-1]) get_nodir = lambda file: file.replace("\\", "/").split("/")[-1] diff --git a/source/get_github_file.py b/source/get_github_file.py index ddd8096..65ba350 100644 --- a/source/get_github_file.py +++ b/source/get_github_file.py @@ -1,7 +1,7 @@ import requests import os -root = "https://raw.githubusercontent.com/Faraphel/MKWF-Install/master/" +from .definition import * def get_github_file(self, file): @@ -9,7 +9,7 @@ def get_github_file(self, file): returncode = 0 if self.boolvar_disable_download.get(): return 2 - dl = requests.get(root+file, allow_redirects=True, stream=True) + dl = requests.get(GITHUB_CONTENT_ROOT+file, allow_redirects=True, stream=True) if os.path.exists(file): if int(dl.headers['Content-Length']) == os.path.getsize(file): return 1 else: returncode = 3