# 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


import libdnf.transaction
import dnf.callback
import dnf.transaction
import dnf.util
import rpm
import os
import logging
import sys
import tempfile
import traceback
import warnings
from dnf.i18n import _, ucd

    def _shutdownOutputLogging(self):
        # reset rpm bits from recording output
        rpm.setVerbosity(rpm.RPMLOG_NOTICE)
        rpm.setLogFile(sys.stderr)
        try:
            self._writepipe.close()
        except:
            pass

    def _scriptOutput(self):
        try:
            # XXX ugly workaround of problem which started after upgrading glibc
            # from glibc-2.27-32.fc28.x86_64 to glibc-2.28-9.fc29.x86_64
            # After this upgrade nothing is read from _readpipe, so every
            # posttrans and postun scriptlet output is lost. The problem
            # only occurs when using dnf-2, dnf-3 is OK.
            # I did not find the root cause of this error yet.
            self._readpipe.seek(self._readpipe.tell())
            out = self._readpipe.read()
            if not out:
                return None
            return out
        except IOError:
            pass

    def messages(self):
        messages = self._scriptOutput()
        if messages:
            for line in messages.splitlines():

# 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/yum/rpmtrans.py
import libdnf.transaction
import dnf.callback
import dnf.transaction
import dnf.util
import rpm
import os
import logging
import sys
import tempfile
import traceback
import warnings
from dnf.i18n import _, ucd


    def _shutdownOutputLogging(self):
        # reset rpm bits from recording output
        rpm.setVerbosity(rpm.RPMLOG_NOTICE)
        rpm.setLogFile(sys.stderr)
        try:
            self._writepipe.close()
        except:
            pass

    def _scriptOutput(self):
        try:
            # XXX ugly workaround of problem which started after upgrading glibc
            # from glibc-2.27-32.fc28.x86_64 to glibc-2.28-9.fc29.x86_64
            # After this upgrade nothing is read from _readpipe, so every
            # posttrans and postun scriptlet output is lost. The problem
            # only occurs when using dnf-2, dnf-3 is OK.
            # I did not find the root cause of this error yet.
            self._readpipe.seek(self._readpipe.tell())
            out = self._readpipe.read()
            if not out:
                return None
            return out
        except IOError:
            pass

    def messages(self):
        messages = self._scriptOutput()
        if messages:
            for line in messages.splitlines():

                yield ucd(line)