# Path: ubuntucleaner/gui/gtk.py
# @log_func(log)
# def post_ui(func):
#     def func_wrapper(*args, **kwargs):
#         Gdk.threads_enter()
#         func(*args, **kwargs)
#         Gdk.threads_leave()
# 
#     return func_wrapper
# 
# Path: ubuntucleaner/settings/debug.py
# def log_func(log):
#     def wrap(func):
#         def func_wrapper(*args, **kwargs):
#             log.debug("%s:" % func)
#             for i, arg in enumerate(args):
#                 log.debug("\targs-%d: %s" % (i + 1, arg))
#             for k, v in enumerate(kwargs):
#                 log.debug("\tdict args-%d: %s: %s" % (k, v, kwargs[v]))
#             return func(*args, **kwargs)
#         return func_wrapper
#     return wrap


import logging
import apt
import apt_pkg
import aptdaemon.client
import aptdaemon.errors
from aptdaemon.enums import *
from aptdaemon.gtk3widgets import AptErrorDialog, AptProgressDialog, AptConfirmDialog
from gi.repository import Gtk, Gdk
from defer import inline_callbacks
from ubuntucleaner.gui.gtk import post_ui
from ubuntucleaner.settings.debug import log_func
        self._signals.append(sig)
        if attach:
            yield self._transaction.attach()
        else:
            if self.debconf:
                yield self._transaction.set_debconf_frontend("gnome")
            try:
                deferred = self._transaction.run()
                yield deferred
            except Exception as error:
                error_handler(error)
                self._transaction.emit('finished', '')
                yield deferred
        self.show_all()

    def _on_finished(self, transaction, status, close, show_error):
        if close:
            self.hide()
            if status == EXIT_FAILED and show_error:
                Gdk.threads_enter()
                err_dia = AptErrorDialog(self._transaction.error, self)
                err_dia.run()
                err_dia.hide()
                Gdk.threads_leave()
        self.emit("finished")


class AptWorker(object):
    cache = None


# Path: ubuntucleaner/gui/gtk.py
# @log_func(log)
# def post_ui(func):
#     def func_wrapper(*args, **kwargs):
#         Gdk.threads_enter()
#         func(*args, **kwargs)
#         Gdk.threads_leave()
# 
#     return func_wrapper
# 
# Path: ubuntucleaner/settings/debug.py
# def log_func(log):
#     def wrap(func):
#         def func_wrapper(*args, **kwargs):
#             log.debug("%s:" % func)
#             for i, arg in enumerate(args):
#                 log.debug("\targs-%d: %s" % (i + 1, arg))
#             for k, v in enumerate(kwargs):
#                 log.debug("\tdict args-%d: %s: %s" % (k, v, kwargs[v]))
#             return func(*args, **kwargs)
#         return func_wrapper
#     return wrap


# Path: ubuntucleaner/utils/package.py
import logging
import apt
import apt_pkg
import aptdaemon.client
import aptdaemon.errors
from aptdaemon.enums import *
from aptdaemon.gtk3widgets import AptErrorDialog, AptProgressDialog, AptConfirmDialog
from gi.repository import Gtk, Gdk
from defer import inline_callbacks
from ubuntucleaner.gui.gtk import post_ui
from ubuntucleaner.settings.debug import log_func

        self._signals.append(sig)
        if attach:
            yield self._transaction.attach()
        else:
            if self.debconf:
                yield self._transaction.set_debconf_frontend("gnome")
            try:
                deferred = self._transaction.run()
                yield deferred
            except Exception as error:
                error_handler(error)
                self._transaction.emit('finished', '')
                yield deferred
        self.show_all()

    def _on_finished(self, transaction, status, close, show_error):
        if close:
            self.hide()
            if status == EXIT_FAILED and show_error:
                Gdk.threads_enter()
                err_dia = AptErrorDialog(self._transaction.error, self)
                err_dia.run()
                err_dia.hide()
                Gdk.threads_leave()
        self.emit("finished")


class AptWorker(object):
    cache = None


    @log_func(log)