refactor(Mainsail): use urllib.request instead of requests module

requests is actually not part of the python 3.8 standard library, hence we use urllib.request now, which is.

Signed-off-by: Dominik Willner <th33xitus@gmail.com>
This commit is contained in:
dw-0
2024-02-18 22:08:21 +01:00
parent 05b4ef2d18
commit 573dc7c3c9
2 changed files with 16 additions and 6 deletions

View File

@@ -24,7 +24,13 @@ from kiauh.components.moonraker.moonraker_setup import update_moonraker
from kiauh.components.moonraker.moonraker_utils import get_moonraker_status
from kiauh.core.menus import BACK_FOOTER
from kiauh.core.menus.base_menu import BaseMenu
from kiauh.utils.constants import COLOR_GREEN, RESET_FORMAT, COLOR_YELLOW, COLOR_WHITE
from kiauh.utils.constants import (
COLOR_GREEN,
RESET_FORMAT,
COLOR_YELLOW,
COLOR_WHITE,
COLOR_RED,
)
# noinspection PyUnusedLocal
@@ -159,4 +165,4 @@ class UpdateMenu(BaseMenu):
self.ms_local = f"{COLOR_GREEN}{self.ms_local}{RESET_FORMAT}"
else:
self.ms_local = f"{COLOR_YELLOW}{self.ms_local}{RESET_FORMAT}"
self.ms_remote = f"{COLOR_GREEN}{self.ms_remote}{RESET_FORMAT}"
self.ms_remote = f"{COLOR_GREEN if self.ms_remote != 'ERROR' else COLOR_RED}{self.ms_remote}{RESET_FORMAT}"