summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Malcolm <dmalcolm@redhat.com>2009-12-09 18:50:17 -0500
committerDavid Malcolm <dmalcolm@redhat.com>2009-12-09 18:50:17 -0500
commit9555ec818c28c223e1c17e012431de070ff421f4 (patch)
treea33affadfb1630c1c5b37f812988cbbbdbb30ab0
parent2ff268c7eafbba9667df0d843d95cc8685115345 (diff)
downloadtriage-9555ec818c28c223e1c17e012431de070ff421f4.tar.gz
triage-9555ec818c28c223e1c17e012431de070ff421f4.tar.xz
triage-9555ec818c28c223e1c17e012431de070ff421f4.zip
Begin adding a PyGTK UI (doesn't work yet; disabled by default)
-rwxr-xr-xabrt-triage.py68
-rw-r--r--triage.glade220
2 files changed, 278 insertions, 10 deletions
diff --git a/abrt-triage.py b/abrt-triage.py
index d4dfff1..dd75c71 100755
--- a/abrt-triage.py
+++ b/abrt-triage.py
@@ -2,6 +2,9 @@
from pprint import pprint
import re
+import gtk
+import gtk.glade
+
from backtrace import Backtrace
class Bug(object):
@@ -9,6 +12,8 @@ class Bug(object):
self.bz = bz
self.id = id
self._bug = bz.getbug(id)
+ if 1:
+ pprint(self._bug.__dict__)
def get_backtrace(self):
# Get the backtrace associated with this ABRT bug, as a Backtrace instance
@@ -178,12 +183,14 @@ class Change(object):
review of the change, rather than automatically pushing blindly via XML-RPC
'''
def __init__(self,
+ bug,
newsummary=None,
newcomponent=None,
comment=None,
duplicate_id=None,
status=None,
resolution=None):
+ self.bug = bug
self.comment = comment
self.newsummary = newsummary
self.newcomponent = newcomponent
@@ -220,8 +227,9 @@ class Change(object):
return result
class Duplicate(Change):
- def __init__(self, bz, other_bug_id):
+ def __init__(self, bug, other_bug_id):
Change.__init__(self,
+ bug,
comment=(
'''Thank you for the bug report.
@@ -255,14 +263,16 @@ def get_change(bz, bug_id):
(newsummary, bt_blurb) = characterize_bt(bt, thread, script)
if script.endswith('ies4linux-gtk.py'):
- return Change(newsummary='%s running %s' % (issue, 'ies4linux-gtk.py'),
+ return Change(bug,
+ newsummary='%s running %s' % (issue, 'ies4linux-gtk.py'),
comment=('''Thank you for your report. This bug is in the ies4linux script you are using to run Internet Explorer. Fedora does not provide or support this script. We would suggest that you report the problem to the upstream project at http://www.tatanka.com.br/ies4linux/ , but it does not seem to have been updated since February 2008, so the effort may be wasted. There is unfortunately nothing the Fedora project can do to help you with this problem.'''),
status='CLOSED', resolution='CANTFIX'
)
except Duplicate, d:
return d
except NoBacktrace, e:
- return Change(newsummary='%s running %s' % (issue, script),
+ return Change(bug,
+ newsummary='%s running %s' % (issue, script),
newcomponent = srpmname,
comment=('''Thank you for the bug report.
@@ -272,7 +282,8 @@ Thank you.
''')
)
except UnsupportedComponent, e:
- return Change(newsummary='%s in %s' % (issue, e.path),
+ return Change(bug,
+ newsummary='%s in %s' % (issue, e.path),
comment=('''Thank you for the bug report.
Unfortunately the problem appears to be in %(path)s.
@@ -298,20 +309,20 @@ Reassigning component from "python" to "%(subpackage)s"
bt_blurb = bt_blurb)
if newsummary == 'Fatal error in "_XError" in /usr/share/virt-manager/virt-manager.py':
- return Duplicate(bz, 540810)
+ return Duplicate(bug, 540810)
if newsummary == 'Fatal error in "XFreeColormap" in /usr/bin/hp-systray':
- return Duplicate(bz, 543286)
+ return Duplicate(bug, 543286)
if newsummary == 'Crash in gtk_style_realize with "ClearlooksStyle"':
- return Duplicate(bz, 538799)
+ return Duplicate(bug, 538799)
- ch = Change(newsummary = newsummary,
+ ch = Change(bug,
+ newsummary = newsummary,
newcomponent = srpmname,
comment = comment
)
- print ch
print '---- BEGIN THREAD ----'
for id in sorted(thread.frames.keys()):
f = thread.frames[id]
@@ -322,13 +333,50 @@ Reassigning component from "python" to "%(subpackage)s"
print '#%i %s %s' % (id, addr, f.function)
print '---- END THREAD ----'
+ return ch
+
+class ChangeGui(object):
+ def __init__(self, change):
+ self.change = change
+
+ self._change_wnd = gtk.glade.XML ('triage.glade', 'change_window')
+ self._window = self._change_wnd.get_widget('change_window')
+ self._old_summary = self._change_wnd.get_widget('old_summary')
+ self._new_summary = self._change_wnd.get_widget('new_summary')
+ self._old_component = self._change_wnd.get_widget('old_component')
+ self._new_component = self._change_wnd.get_widget('new_component')
+ self._new_comment = self._change_wnd.get_widget('new_comment')
+
+ print self.__dict__
+ for attr in self.__dict__:
+ print attr
+ #print getattr(self, attr).__dict__
+ print self._window.__dict__
+ self._window.set_title('Proposed changes for bug %i' % self.change.bug.id)
+ self._old_summary.set_text(change.bug._bug.summary)
+ if change.newsummary:
+ self._new_summary.set_text(change.newsummary)
+ self._old_component.set_text(change.bug._bug.component)
+ if change.newcomponent:
+ self._new_component.set_text(change.newcomponent)
+ if change.comment:
+ self._new_comment.get_buffer().set_text(change.comment)
+
+
+
def main():
import bugzilla
bz=bugzilla.Bugzilla(url='https://bugzilla.redhat.com/xmlrpc.cgi')
import sys
bug_id = int(sys.argv[1])
print '---- CHANGES FOR BUG %i ----' % bug_id
- print get_change(bz, bug_id)
+ change = get_change(bz, bug_id)
+ print change
+ if False:
+ g = ChangeGui(change)
+ gtk.main()
+
+
main()
diff --git a/triage.glade b/triage.glade
new file mode 100644
index 0000000..c1db085
--- /dev/null
+++ b/triage.glade
@@ -0,0 +1,220 @@
+<?xml version="1.0"?>
+<glade-interface>
+ <!-- interface-requires gtk+ 2.16 -->
+ <!-- interface-naming-policy project-wide -->
+ <widget class="GtkWindow" id="change_window">
+ <property name="visible">True</property>
+ <child>
+ <widget class="GtkVBox" id="vbox1">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <widget class="GtkTable" id="table1">
+ <property name="visible">True</property>
+ <property name="n_rows">4</property>
+ <property name="n_columns">3</property>
+ <child>
+ <widget class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Summary</property>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label2">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Component</property>
+ </widget>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkEntry" id="old_summary">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="editable">False</property>
+ <property name="invisible_char">&#x25CF;</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkEntry" id="old_component">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="editable">False</property>
+ <property name="invisible_char">&#x25CF;</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkEntry" id="new_summary">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">&#x25CF;</property>
+ </widget>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkEntry" id="new_component">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">&#x25CF;</property>
+ </widget>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label3">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Status</property>
+ <property name="use_markup">True</property>
+ </widget>
+ <packing>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkComboBox" id="old_status">
+ <property name="visible">True</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkComboBox" id="new_status">
+ <property name="visible">True</property>
+ </widget>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label4">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Resolution</property>
+ </widget>
+ <packing>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkComboBox" id="old_resolution">
+ <property name="visible">True</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkComboBox" id="new_resolution">
+ <property name="visible">True</property>
+ </widget>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkHBox" id="hbox1">
+ <property name="visible">True</property>
+ <child>
+ <widget class="GtkLabel" id="label5">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Comment</property>
+ </widget>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkTextView" id="new_comment">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="wrap_mode">word</property>
+ </widget>
+ <packing>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkHBox" id="hbox2">
+ <property name="visible">True</property>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <widget class="GtkButton" id="cancel">
+ <property name="label">gtk-cancel</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkButton" id="apply">
+ <property name="label">gtk-apply</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </widget>
+ <packing>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+</glade-interface>