# 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 logging
import rpm
    def getTsFlags(self):
        curflags = self.ts.setFlags(0)
        self.ts.setFlags(curflags)
        return curflags

    def isTsFlagSet(self, flag):
        val = self.getTsFlags()
        return bool(flag & val)

    def setScriptFd(self, fd):
        self.ts.scriptFd = fd.fileno()

    def test(self, cb, conf={}):
        """tests the ts we've setup, takes a callback function and a conf dict
           for flags and what not"""

        origflags = self.getTsFlags()
        self.addTsFlag(rpm.RPMTRANS_FLAG_TEST)
        # FIXME GARBAGE - remove once this is reimplemented elsewhere
        # KEEPING FOR API COMPLIANCE ONLY
        if conf.get('diskspacecheck') == 0:
            self.ts.setProbFilter(rpm.RPMPROB_FILTER_DISKSPACE)
        tserrors = self.ts.run(cb.callback, '')
        self.ts.setFlags(origflags)

        reserrors = []
        if tserrors is not None:
            for (descr, (etype, mount, need)) in tserrors:
                reserrors.append(descr)
            if not reserrors:

# 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/rpm/transaction.py
from dnf.i18n import _
import logging
import rpm

    def getTsFlags(self):
        curflags = self.ts.setFlags(0)
        self.ts.setFlags(curflags)
        return curflags

    def isTsFlagSet(self, flag):
        val = self.getTsFlags()
        return bool(flag & val)

    def setScriptFd(self, fd):
        self.ts.scriptFd = fd.fileno()

    def test(self, cb, conf={}):
        """tests the ts we've setup, takes a callback function and a conf dict
           for flags and what not"""

        origflags = self.getTsFlags()
        self.addTsFlag(rpm.RPMTRANS_FLAG_TEST)
        # FIXME GARBAGE - remove once this is reimplemented elsewhere
        # KEEPING FOR API COMPLIANCE ONLY
        if conf.get('diskspacecheck') == 0:
            self.ts.setProbFilter(rpm.RPMPROB_FILTER_DISKSPACE)
        tserrors = self.ts.run(cb.callback, '')
        self.ts.setFlags(origflags)

        reserrors = []
        if tserrors is not None:
            for (descr, (etype, mount, need)) in tserrors:
                reserrors.append(descr)
            if not reserrors:

                reserrors.append(_('Errors occurred during test transaction.'))