From a25e3d9feaca24c762dbfe520af6765bd05f9676 Mon Sep 17 00:00:00 2001 From: pseusys Date: Tue, 28 Feb 2023 13:40:45 +0100 Subject: [PATCH 1/3] file not found translation error fixed --- sources/manager_file.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/manager_file.py b/sources/manager_file.py index 741b681..424fd7e 100644 --- a/sources/manager_file.py +++ b/sources/manager_file.py @@ -28,7 +28,8 @@ class FileManager: :param file: Localization file path, related to current file (in sources root). """ - with open(join("sources", file), encoding="utf-8") as config_file: + translation_path = join("sources", file) if EM.DEBUG_RUN else file + with open(translation_path, encoding="utf-8") as config_file: data = load(config_file) FileManager._LOCALIZATION = data[EM.LOCALE] From 9f2c6e7f3cdbe8b7450c1ac8bc984cb74d750018 Mon Sep 17 00:00:00 2001 From: pseusys Date: Tue, 28 Feb 2023 17:16:25 +0100 Subject: [PATCH 2/3] file directory instead of sources --- sources/manager_file.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sources/manager_file.py b/sources/manager_file.py index 424fd7e..04f8040 100644 --- a/sources/manager_file.py +++ b/sources/manager_file.py @@ -1,5 +1,5 @@ from json import load -from os.path import join +from os.path import join, dirname from typing import Dict from manager_environment import EnvironmentManager as EM @@ -28,8 +28,7 @@ class FileManager: :param file: Localization file path, related to current file (in sources root). """ - translation_path = join("sources", file) if EM.DEBUG_RUN else file - with open(translation_path, encoding="utf-8") as config_file: + with open(join(dirname(__file__), file), encoding="utf-8") as config_file: data = load(config_file) FileManager._LOCALIZATION = data[EM.LOCALE] From 9aa0e2ac6e87df50433fdb699f4ece27f6415cee Mon Sep 17 00:00:00 2001 From: pseusys Date: Tue, 28 Feb 2023 23:38:02 +0100 Subject: [PATCH 3/3] github object not found error fixed --- sources/manager_github.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/manager_github.py b/sources/manager_github.py index 8bff82a..2ec6a1f 100644 --- a/sources/manager_github.py +++ b/sources/manager_github.py @@ -138,7 +138,6 @@ class GitHubManager: if not EM.DEBUG_RUN: DBM.i("Pushing chart to repo...") - chart_path = f"https://raw.githubusercontent.com/{GitHubManager.USER.login}/{GitHubManager.USER.login}/{GitHubManager.branch()}/{chart_path}" try: contents = GitHubManager.REPO.get_contents(chart_path) @@ -147,6 +146,8 @@ class GitHubManager: except UnknownObjectException: GitHubManager.REPO.create_file(chart_path, "Charts Added", data, committer=GitHubManager._get_author()) DBM.g("Lines of code chart created!") + + chart_path = f"https://raw.githubusercontent.com/{GitHubManager.USER.login}/{GitHubManager.USER.login}/{GitHubManager.branch()}/{chart_path}" return f"**{FM.t('Timeline')}**\n\n![Lines of Code chart]({chart_path})\n\n" else: