# 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.i18n import _
import dnf.util
import errno
import fnmatch
import json
import logging
import os
import re
        return default

    @staticmethod
    def _write_json_db(json_path, content):
        with open(json_path, 'w') as f:
            json.dump(content, f)


class RepoPersistor(JSONDB):
    """Persistent data kept for repositories.

    Is arch/releasever specific and stores to cachedir.

    """

    def __init__(self, cachedir):
        self.cachedir = cachedir
        self.db_path = os.path.join(self.cachedir, "expired_repos.json")
        self.expired_to_add = set()
        self.reset_last_makecache = False

    @property
    def _last_makecache_path(self):
        return os.path.join(self.cachedir, "last_makecache")

    def get_expired_repos(self):
        try:
            self._check_json_db(self.db_path)
            return set(self._get_json_db(self.db_path))
        except OSError as e:

# 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/persistor.py
from dnf.i18n import _
import dnf.util
import errno
import fnmatch
import json
import logging
import os
import re

        return default

    @staticmethod
    def _write_json_db(json_path, content):
        with open(json_path, 'w') as f:
            json.dump(content, f)


class RepoPersistor(JSONDB):
    """Persistent data kept for repositories.

    Is arch/releasever specific and stores to cachedir.

    """

    def __init__(self, cachedir):
        self.cachedir = cachedir
        self.db_path = os.path.join(self.cachedir, "expired_repos.json")
        self.expired_to_add = set()
        self.reset_last_makecache = False

    @property
    def _last_makecache_path(self):
        return os.path.join(self.cachedir, "last_makecache")

    def get_expired_repos(self):
        try:
            self._check_json_db(self.db_path)
            return set(self._get_json_db(self.db_path))
        except OSError as e:

            logger.warning(_("Failed to load expired repos cache: %s"), e)