Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib/translationhandler.py
diff options
context:
space:
mode:
authorDaniel Girtler <blackrabbit256@gmail.com>2023-05-12 02:30:09 +1000
committerGitHub <noreply@github.com>2023-05-11 18:30:09 +0200
commit89cefb9a1c7d4c4968e7d8645149078e601c9d1c (patch)
tree12c84bdcef1b0ef3f8a21977e25c7f0f89388138 /archinstall/lib/translationhandler.py
parent6e6b850a8f687b193172aaa321d49bd2956c1d4f (diff)
Cleanup imports and unused code (#1801)
* Cleanup imports and unused code * Update build check * Keep deprecation exception * Simplify logging --------- Co-authored-by: Daniel Girtler <girtler.daniel@gmail.com>
Diffstat (limited to 'archinstall/lib/translationhandler.py')
-rw-r--r--archinstall/lib/translationhandler.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/archinstall/lib/translationhandler.py b/archinstall/lib/translationhandler.py
index 0d74f974..5f0f0695 100644
--- a/archinstall/lib/translationhandler.py
+++ b/archinstall/lib/translationhandler.py
@@ -1,14 +1,14 @@
from __future__ import annotations
import json
-import logging
import os
import gettext
from dataclasses import dataclass
from pathlib import Path
from typing import List, Dict, Any, TYPE_CHECKING, Optional
-from .exceptions import TranslationError
+
+from .output import error, debug
if TYPE_CHECKING:
_: Any
@@ -80,8 +80,8 @@ class TranslationHandler:
language = Language(abbr, lang, translation, percent, translated_lang)
languages.append(language)
- except FileNotFoundError as error:
- raise TranslationError(f"Could not locate language file for '{lang}': {error}")
+ except FileNotFoundError as err:
+ raise FileNotFoundError(f"Could not locate language file for '{lang}': {err}")
return languages
@@ -89,12 +89,12 @@ class TranslationHandler:
"""
Set the provided font as the new terminal font
"""
- from .general import SysCommand, log
+ from .general import SysCommand
try:
- log(f'Setting font: {font}', level=logging.DEBUG)
+ debug(f'Setting font: {font}')
SysCommand(f'setfont {font}')
except Exception:
- log(f'Unable to set font {font}', level=logging.ERROR)
+ error(f'Unable to set font {font}')
def _load_language_mappings(self) -> List[Dict[str, Any]]:
"""