def get_locale_console_fonts(locale): """Function returning preferred console fonts for the given locale. :param str locale: locale string :return: list of preferred console fonts :rtype: list of strings :raise InvalidLocaleSpec: if an invalid locale is given (see is_valid_langcode) """ raise_on_invalid_locale(locale) return langtable.list_consolefonts(languageId=locale)
def get_locale_console_fonts(locale): """ Function returning preferred console fonts for the given locale. :param str locale: locale string (see LANGCODE_RE) :return: list of preferred console fonts :rtype: list of strings :raise InvalidLocaleSpec: if an invalid locale is given (see LANGCODE_RE) """ parts = parse_langcode(locale) if "language" not in parts: raise InvalidLocaleSpec("'%s' is not a valid locale" % locale) return langtable.list_consolefonts(languageId=parts["language"], territoryId=parts.get("territory", ""), scriptId=parts.get("script", ""))
def get_locale_console_fonts(locale): """ Function returning preferred console fonts for the given locale. :param str locale: locale string (see LANGCODE_RE) :return: list of preferred console fonts :rtype: list of strings :raise InvalidLocaleSpec: if an invalid locale is given (see LANGCODE_RE) """ parts = parse_langcode(locale) if "language" not in parts: raise InvalidLocaleSpec("'%s' is not a valid locale" % locale) return langtable.list_consolefonts(languageId=parts["language"], territoryId=parts.get("territory", ""), scriptId=parts.get("script", ""))