# Path: dnf/yum/misc.py
# def re_glob(s):
# def re_full_search_needed(s):
# def get_default_chksum_type():
#     def __init__(self, iter=None):
#     def __iter__(self):
#     def __getitem__(self, item):
#     def all_lists(self):
#     def merge_lists(self, other):
# def procgpgkey(rawkey):
# def keyInstalled(ts, keyid, timestamp):
# def import_key_to_pubring(rawkey, keyid, gpgdir=None, make_ro_copy=True):
# def getCacheDir():
# def seq_max_split(seq, max_entries):
# def unlink_f(filename):
# def stat_f(filename, ignore_EACCES=False):
# def _getloginuid():
# def getloginuid():
# def decompress(filename, dest=None, check_timestamps=False):
# def read_in_items_from_dot_dir(thisglob, line_as_list=True):
# class GenericHolder(object):
# 
# Path: dnf/i18n.py
# class UnicodeStream(object):
#     def __init__(self, stream, encoding):
#     def write(self, s):
#     def __getattr__(self, name):
# def _full_ucd_support(encoding):
# def _guess_encoding():
# def setup_locale():
# def setup_stdout():
# def ucd_input(ucstring):
# def ucd(obj):
# def _exact_width_char(uchar):
# def chop_str(msg, chop=None):
# def exact_width(msg):
# def fill_exact_width(msg, fill, chop=None, left=True, prefix='', suffix=''):
# def textwrap_fill(text, width=70, initial_indent='', subsequent_indent=''):
#     def _indent_at_beg(line):
# def select_short_long(width, msg_short, msg_long):
# def translation(name):
#     def ucd_wrapper(fnc):
# def pgettext(context, message):
# _, P_ = translation("dnf")
# C_ = pgettext


from dnf.yum import misc
from dnf.i18n import ucd, _
from dnf.pycomp import basestring, urlparse
import fnmatch
import dnf.conf.substitutions
import dnf.const
import dnf.exceptions
import dnf.pycomp
import dnf.util
import hawkey
import logging
import os
import libdnf.conf
import libdnf.repo
import tempfile
PRIO_PLUGINDEFAULT = libdnf.conf.Option.Priority_PLUGINDEFAULT
PRIO_PLUGINCONFIG = libdnf.conf.Option.Priority_PLUGINCONFIG
PRIO_COMMANDLINE = libdnf.conf.Option.Priority_COMMANDLINE
PRIO_RUNTIME = libdnf.conf.Option.Priority_RUNTIME

logger = logging.getLogger('dnf')


class BaseConfig(object):
    """Base class for storing configuration definitions.

       Subclass when creating your own definitions.

    """

    def __init__(self, config=None, section=None, parser=None):
        self.__dict__["_config"] = config
        self._section = section

    def __getattr__(self, name):
        if "_config" not in self.__dict__:
            raise AttributeError("'{}' object has no attribute '{}'".format(self.__class__, name))
        option = getattr(self._config, name)
        if option is None:
            return None
        try:
            value = option().getValue()
        except Exception as ex:
            return None
        if isinstance(value, str):

# Path: dnf/yum/misc.py
# def re_glob(s):
# def re_full_search_needed(s):
# def get_default_chksum_type():
#     def __init__(self, iter=None):
#     def __iter__(self):
#     def __getitem__(self, item):
#     def all_lists(self):
#     def merge_lists(self, other):
# def procgpgkey(rawkey):
# def keyInstalled(ts, keyid, timestamp):
# def import_key_to_pubring(rawkey, keyid, gpgdir=None, make_ro_copy=True):
# def getCacheDir():
# def seq_max_split(seq, max_entries):
# def unlink_f(filename):
# def stat_f(filename, ignore_EACCES=False):
# def _getloginuid():
# def getloginuid():
# def decompress(filename, dest=None, check_timestamps=False):
# def read_in_items_from_dot_dir(thisglob, line_as_list=True):
# class GenericHolder(object):
# 
# Path: dnf/i18n.py
# class UnicodeStream(object):
#     def __init__(self, stream, encoding):
#     def write(self, s):
#     def __getattr__(self, name):
# def _full_ucd_support(encoding):
# def _guess_encoding():
# def setup_locale():
# def setup_stdout():
# def ucd_input(ucstring):
# def ucd(obj):
# def _exact_width_char(uchar):
# def chop_str(msg, chop=None):
# def exact_width(msg):
# def fill_exact_width(msg, fill, chop=None, left=True, prefix='', suffix=''):
# def textwrap_fill(text, width=70, initial_indent='', subsequent_indent=''):
#     def _indent_at_beg(line):
# def select_short_long(width, msg_short, msg_long):
# def translation(name):
#     def ucd_wrapper(fnc):
# def pgettext(context, message):
# _, P_ = translation("dnf")
# C_ = pgettext


# Path: dnf/conf/config.py
from dnf.yum import misc
from dnf.i18n import ucd, _
from dnf.pycomp import basestring, urlparse
import fnmatch
import dnf.conf.substitutions
import dnf.const
import dnf.exceptions
import dnf.pycomp
import dnf.util
import hawkey
import logging
import os
import libdnf.conf
import libdnf.repo
import tempfile

PRIO_PLUGINDEFAULT = libdnf.conf.Option.Priority_PLUGINDEFAULT
PRIO_PLUGINCONFIG = libdnf.conf.Option.Priority_PLUGINCONFIG
PRIO_COMMANDLINE = libdnf.conf.Option.Priority_COMMANDLINE
PRIO_RUNTIME = libdnf.conf.Option.Priority_RUNTIME

logger = logging.getLogger('dnf')


class BaseConfig(object):
    """Base class for storing configuration definitions.

       Subclass when creating your own definitions.

    """

    def __init__(self, config=None, section=None, parser=None):
        self.__dict__["_config"] = config
        self._section = section

    def __getattr__(self, name):
        if "_config" not in self.__dict__:
            raise AttributeError("'{}' object has no attribute '{}'".format(self.__class__, name))
        option = getattr(self._config, name)
        if option is None:
            return None
        try:
            value = option().getValue()
        except Exception as ex:
            return None
        if isinstance(value, str):

            return ucd(value)