# 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.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/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.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)