# Path: pyanaconda/constants.py
# SELINUX_DEFAULT = 1
# DISPATCH_BACK = -1
# DISPATCH_FORWARD = 1
# DISPATCH_DEFAULT = None
# DISPATCH_WAITING = 2
# MAX_PART_SIZE = 1024*1024*1024
# SKIP_KEY = -50
# ADDON_PATHS = ["/usr/share/anaconda/addons"]
# DD_ALL = "/tmp/DD"
# DD_EXTRACTED = re.compile("/lib/modules/[^/]+/updates/DD/(?P<moduledir>.*/)?(?P<modulename>[^/.]+).ko.*")
# DD_FIRMWARE = "/tmp/DD/lib/firmware"
# DD_RPMS = "/tmp/DD-*"
# TRANSLATIONS_UPDATE_DIR="/tmp/updates/po"
# ANACONDA_CLEANUP = "anaconda-cleanup"
# ROOT_PATH = "/mnt/sysimage"
# MOUNT_DIR = "/mnt/install"
# DRACUT_REPODIR = "/run/install/repo"
# DRACUT_ISODIR = "/run/install/source"
# ISO_DIR = MOUNT_DIR + "/isodir"
# IMAGE_DIR = MOUNT_DIR + "/image"
# INSTALL_TREE = MOUNT_DIR + "/source"
# BASE_REPO_NAME = "anaconda"
# DEFAULT_LANG = "en_US.UTF-8"
# DEFAULT_VC_FONT = "latarcyrheb-sun16"
# DRACUT_SHUTDOWN_EJECT = "/run/initramfs/usr/lib/dracut/hooks/shutdown/99anaconda-eject.sh"
# USEVNC = _("Start VNC")
# USETEXT = _("Use text mode")
# RUNLEVELS = {3: 'multi-user.target', 5: 'graphical.target'}
# NETWORK_CONNECTION_TIMEOUT = 45  # in seconds
# DEFAULT_DBUS_TIMEOUT = -1       # use default
# THREAD_EXECUTE_STORAGE = "AnaExecuteStorageThread"
# THREAD_STORAGE = "AnaStorageThread"
# THREAD_STORAGE_WATCHER = "AnaStorageWatcher"
# THREAD_CHECK_STORAGE = "AnaCheckStorageThread"
# THREAD_CUSTOM_STORAGE_INIT = "AnaCustomStorageInit"
# THREAD_WAIT_FOR_CONNECTING_NM = "AnaWaitForConnectingNMThread"
# THREAD_PAYLOAD = "AnaPayloadThread"
# THREAD_PAYLOAD_MD = "AnaPayloadMDThread"
# THREAD_INPUT_BASENAME = "AnaInputThread"
# THREAD_SYNC_TIME_BASENAME = "AnaSyncTime"
# THREAD_EXCEPTION_HANDLING_TEST = "AnaExceptionHandlingTest"
# THREAD_LIVE_PROGRESS = "AnaLiveProgressThread"
# THREAD_SOFTWARE_WATCHER = "AnaSoftwareWatcher"
# THREAD_CHECK_SOFTWARE = "AnaCheckSoftwareThread"
# THREAD_SOURCE_WATCHER = "AnaSourceWatcher"
# THREAD_INSTALL = "AnaInstallThread"
# THREAD_CONFIGURATION = "AnaConfigurationThread"
# THREAD_FCOE = "AnaFCOEThread"
# THREAD_ISCSI_DISCOVER = "AnaIscsiDiscoverThread"
# THREAD_ISCSI_LOGIN = "AnaIscsiLoginThread"
# THREAD_GEOLOCATION_REFRESH = "AnaGeolocationRefreshThread"
# THREAD_DATE_TIME = "AnaDateTimeThread"
# THREAD_TIME_INIT = "AnaTimeInitThread"
# THREAD_DASDFMT = "AnaDasdfmtThread"
# GEOLOC_PROVIDER_FEDORA_GEOIP = "provider_fedora_geoip"
# GEOLOC_PROVIDER_HOSTIP = "provider_hostip"
# GEOLOC_PROVIDER_GOOGLE_WIFI = "provider_google_wifi"
# GEOLOC_GEOCODER_NOMINATIM = "geocoder_nominatim"
# GEOLOC_DEFAULT_PROVIDER = GEOLOC_PROVIDER_FEDORA_GEOIP
# GEOLOC_DEFAULT_GEOCODER = GEOLOC_GEOCODER_NOMINATIM
# ANACONDA_ENVIRON = "anaconda"
# FIRSTBOOT_ENVIRON = "firstboot"
# UNSUPPORTED_HW = 1 << 28
# CMDLINE_APPEND = ["modprobe.blacklist"]
# 
# Path: pyanaconda/iutil.py
# def upcase_first_letter(text):
#     """
#     Helper function that upcases the first letter of the string. Python's
#     standard string.capitalize() not only upcases the first letter but also
#     lowercases all the others. string.title() capitalizes all words in the
#     string.
# 
#     :type text: either a str or unicode object
#     :return: the given text with the first letter upcased
#     :rtype: str or unicode (depends on the input)
# 
#     """
# 
#     if not text:
#         # cannot change anything
#         return text
#     elif len(text) == 1:
#         return text.upper()
#     else:
#         return text[0].upper() + text[1:]


import gettext
import os
import re
import langtable
import glob
import logging
from pyanaconda import constants
from pyanaconda.iutil import upcase_first_letter

    name = langtable.language_name(languageId=parts["language"],
                                   territoryId=parts.get("territory", ""),
                                   scriptId=parts.get("script", ""),
                                   languageIdQuery="en")

    return upcase_first_letter(name)

def get_native_name(locale):
    """
    Function returning native name for the given locale.

    :param locale: locale to return native name for
    :type locale: str
    :return: english name for the locale or empty string if unknown
    :rtype: st
    :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)

    name = langtable.language_name(languageId=parts["language"],
                                   territoryId=parts.get("territory", ""),
                                   scriptId=parts.get("script", ""),
                                   languageIdQuery=parts["language"],
                                   scriptIdQuery=parts.get("script", ""))


# Path: pyanaconda/constants.py
# SELINUX_DEFAULT = 1
# DISPATCH_BACK = -1
# DISPATCH_FORWARD = 1
# DISPATCH_DEFAULT = None
# DISPATCH_WAITING = 2
# MAX_PART_SIZE = 1024*1024*1024
# SKIP_KEY = -50
# ADDON_PATHS = ["/usr/share/anaconda/addons"]
# DD_ALL = "/tmp/DD"
# DD_EXTRACTED = re.compile("/lib/modules/[^/]+/updates/DD/(?P<moduledir>.*/)?(?P<modulename>[^/.]+).ko.*")
# DD_FIRMWARE = "/tmp/DD/lib/firmware"
# DD_RPMS = "/tmp/DD-*"
# TRANSLATIONS_UPDATE_DIR="/tmp/updates/po"
# ANACONDA_CLEANUP = "anaconda-cleanup"
# ROOT_PATH = "/mnt/sysimage"
# MOUNT_DIR = "/mnt/install"
# DRACUT_REPODIR = "/run/install/repo"
# DRACUT_ISODIR = "/run/install/source"
# ISO_DIR = MOUNT_DIR + "/isodir"
# IMAGE_DIR = MOUNT_DIR + "/image"
# INSTALL_TREE = MOUNT_DIR + "/source"
# BASE_REPO_NAME = "anaconda"
# DEFAULT_LANG = "en_US.UTF-8"
# DEFAULT_VC_FONT = "latarcyrheb-sun16"
# DRACUT_SHUTDOWN_EJECT = "/run/initramfs/usr/lib/dracut/hooks/shutdown/99anaconda-eject.sh"
# USEVNC = _("Start VNC")
# USETEXT = _("Use text mode")
# RUNLEVELS = {3: 'multi-user.target', 5: 'graphical.target'}
# NETWORK_CONNECTION_TIMEOUT = 45  # in seconds
# DEFAULT_DBUS_TIMEOUT = -1       # use default
# THREAD_EXECUTE_STORAGE = "AnaExecuteStorageThread"
# THREAD_STORAGE = "AnaStorageThread"
# THREAD_STORAGE_WATCHER = "AnaStorageWatcher"
# THREAD_CHECK_STORAGE = "AnaCheckStorageThread"
# THREAD_CUSTOM_STORAGE_INIT = "AnaCustomStorageInit"
# THREAD_WAIT_FOR_CONNECTING_NM = "AnaWaitForConnectingNMThread"
# THREAD_PAYLOAD = "AnaPayloadThread"
# THREAD_PAYLOAD_MD = "AnaPayloadMDThread"
# THREAD_INPUT_BASENAME = "AnaInputThread"
# THREAD_SYNC_TIME_BASENAME = "AnaSyncTime"
# THREAD_EXCEPTION_HANDLING_TEST = "AnaExceptionHandlingTest"
# THREAD_LIVE_PROGRESS = "AnaLiveProgressThread"
# THREAD_SOFTWARE_WATCHER = "AnaSoftwareWatcher"
# THREAD_CHECK_SOFTWARE = "AnaCheckSoftwareThread"
# THREAD_SOURCE_WATCHER = "AnaSourceWatcher"
# THREAD_INSTALL = "AnaInstallThread"
# THREAD_CONFIGURATION = "AnaConfigurationThread"
# THREAD_FCOE = "AnaFCOEThread"
# THREAD_ISCSI_DISCOVER = "AnaIscsiDiscoverThread"
# THREAD_ISCSI_LOGIN = "AnaIscsiLoginThread"
# THREAD_GEOLOCATION_REFRESH = "AnaGeolocationRefreshThread"
# THREAD_DATE_TIME = "AnaDateTimeThread"
# THREAD_TIME_INIT = "AnaTimeInitThread"
# THREAD_DASDFMT = "AnaDasdfmtThread"
# GEOLOC_PROVIDER_FEDORA_GEOIP = "provider_fedora_geoip"
# GEOLOC_PROVIDER_HOSTIP = "provider_hostip"
# GEOLOC_PROVIDER_GOOGLE_WIFI = "provider_google_wifi"
# GEOLOC_GEOCODER_NOMINATIM = "geocoder_nominatim"
# GEOLOC_DEFAULT_PROVIDER = GEOLOC_PROVIDER_FEDORA_GEOIP
# GEOLOC_DEFAULT_GEOCODER = GEOLOC_GEOCODER_NOMINATIM
# ANACONDA_ENVIRON = "anaconda"
# FIRSTBOOT_ENVIRON = "firstboot"
# UNSUPPORTED_HW = 1 << 28
# CMDLINE_APPEND = ["modprobe.blacklist"]
# 
# Path: pyanaconda/iutil.py
# def upcase_first_letter(text):
#     """
#     Helper function that upcases the first letter of the string. Python's
#     standard string.capitalize() not only upcases the first letter but also
#     lowercases all the others. string.title() capitalizes all words in the
#     string.
# 
#     :type text: either a str or unicode object
#     :return: the given text with the first letter upcased
#     :rtype: str or unicode (depends on the input)
# 
#     """
# 
#     if not text:
#         # cannot change anything
#         return text
#     elif len(text) == 1:
#         return text.upper()
#     else:
#         return text[0].upper() + text[1:]


# Path: pyanaconda/localization.py
import gettext
import os
import re
import langtable
import glob
import logging
from pyanaconda import constants
from pyanaconda.iutil import upcase_first_letter


    name = langtable.language_name(languageId=parts["language"],
                                   territoryId=parts.get("territory", ""),
                                   scriptId=parts.get("script", ""),
                                   languageIdQuery="en")

    return upcase_first_letter(name)

def get_native_name(locale):
    """
    Function returning native name for the given locale.

    :param locale: locale to return native name for
    :type locale: str
    :return: english name for the locale or empty string if unknown
    :rtype: st
    :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)

    name = langtable.language_name(languageId=parts["language"],
                                   territoryId=parts.get("territory", ""),
                                   scriptId=parts.get("script", ""),
                                   languageIdQuery=parts["language"],
                                   scriptIdQuery=parts.get("script", ""))


    return upcase_first_letter(name)