Ejemplo n.º 1
0
def run_traceback(level, textview_only=False, text_only=False):
    '''Two level: fatal and error'''
    from ubuntucleaner.gui import GuiBuilder

    output = StringIO.StringIO()
    exc = traceback.print_exc(file=output)

    worker = GuiBuilder('traceback.xml')

    textview = worker.get_object('%s_view' % level)

    buffer = textview.get_buffer()
    iter = buffer.get_start_iter()
    anchor = buffer.create_child_anchor(iter)
    button = Gtk.Button(label=_('Copy Error Message'))
    button.show()

    textview.add_child_at_anchor(button, anchor)

    error_text = "\nDistribution: %s\nApplication: %s\nDesktop:%s\n\n%s" % (
        system.DISTRO, system.APP, system.DESKTOP, output.getvalue())

    buffer.insert(iter, error_text)
    button.connect('clicked', on_copy_button_clicked, error_text)

    if text_only:
        return error_text

    if textview_only:
        return textview
    else:
        dialog = worker.get_object('%sDialog' % level.capitalize())
        dialog.destroy()
        output.close()
Ejemplo n.º 2
0
    def __init__(self):
        GObject.GObject.__init__(self)

        self.scan_tasks = []
        self.clean_tasks = []
        self._total_count = 0

        self.set_border_width(6)
        GuiBuilder.__init__(self, 'janitorpage.xml')
        self.pack_start(self.vbox1, True, True, 0)

        self.connect('realize', self.setup_ui_tasks)
        self.janitor_view.get_selection().connect('changed', self.on_janitor_selection_changed)

        self.show()
Ejemplo n.º 3
0
    def __init__(self):
        GObject.GObject.__init__(self)

        self.scan_tasks = []
        self.clean_tasks = []
        self._total_count = 0

        self.set_border_width(6)
        GuiBuilder.__init__(self, 'janitorpage.xml')
        self.pack_start(self.vbox1, True, True, 0)

        self.connect('realize', self.setup_ui_tasks)
        self.janitor_view.get_selection().connect('changed', self.on_janitor_selection_changed)

        self.show()
Ejemplo n.º 4
0
def run_traceback(level, textview_only=False, text_only=False):
    '''Two level: fatal and error'''
    from ubuntucleaner.gui import GuiBuilder

    output = StringIO.StringIO()
    exc = traceback.print_exc(file=output)

    worker = GuiBuilder('traceback.xml')

    textview = worker.get_object('%s_view' % level)

    buffer = textview.get_buffer()
    iter = buffer.get_start_iter()
    anchor = buffer.create_child_anchor(iter)
    button = Gtk.Button(label=_('Copy Error Message'))
    button.show()

    textview.add_child_at_anchor(button, anchor)

    error_text = "\nDistribution: %s\nApplication: %s\nDesktop:%s\n\n%s" % (system.DISTRO,
                                       system.APP,
                                       system.DESKTOP,
                                       output.getvalue())

    buffer.insert(iter, error_text)
    button.connect('clicked', on_copy_button_clicked, error_text)

    if text_only:
        return error_text

    if textview_only:
        return textview
    else:
        dialog = worker.get_object('%sDialog' % level.capitalize())
        dialog.destroy()
        output.close()
Ejemplo n.º 5
0
 def __init__(self):
     GuiBuilder.__init__(self, file_name='mainwindow.xml')
     self.load_janitor()
     self.mainwindow.show()
Ejemplo n.º 6
0
 def __init__(self):
     GuiBuilder.__init__(self, file_name='mainwindow.xml')
     self.load_janitor()
     self.mainwindow.show()