From 7db29fc9bdf3403f1b05560197e39d159b6e49a3 Mon Sep 17 00:00:00 2001 From: raphael60650 Date: Sat, 19 Jun 2021 22:08:19 +0200 Subject: [PATCH] moved url to definition.py --- source/check_update.py | 2 +- source/definition.py | 3 +++ source/get_github_file.py | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) 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