[PATCH 1/4] Get rid of the accountManager and use new libreport API

Vratislav Podzimek vpodzime at redhat.com
Tue Jan 15 13:32:11 UTC 2013


While libreport supports the old API, we can get rid of some lines
by using the new one.

Signed-off-by: Vratislav Podzimek <vpodzime at redhat.com>
---
 meh/handler.py  |  5 +----
 meh/ui/gui.py   | 13 ++++---------
 python-meh.spec |  2 +-
 3 files changed, 6 insertions(+), 14 deletions(-)

diff --git a/meh/handler.py b/meh/handler.py
index 58bfc46..ffa638c 100644
--- a/meh/handler.py
+++ b/meh/handler.py
@@ -22,7 +22,6 @@ import os
 from network import hasActiveNetDev
 import signal
 import sys
-import report.accountmanager
 
 import gettext
 _ = lambda x: gettext.ldgettext("python-meh", x)
@@ -236,10 +235,8 @@ class ExceptionHandler(object):
                 #skip files we cannot read
                 continue
 
-        accountManager = report.accountmanager.AccountManager()
-
         signature = report.createPythonUnhandledExceptionSignature(**params)
 
         # We don't want to automatically quit here since the user may wish to
         # save somewhere else, debug, etc.
-        self.intf.saveExceptionWindow(accountManager, signature)
+        self.intf.saveExceptionWindow(signature)
diff --git a/meh/ui/gui.py b/meh/ui/gui.py
index fd19466..b6ee678 100644
--- a/meh/ui/gui.py
+++ b/meh/ui/gui.py
@@ -51,23 +51,18 @@ class GraphicalIntf(AbstractIntf):
         win.run()
         win.destroy()
 
-    def saveExceptionWindow(self, accountManager, signature, *args, **kwargs):
-        win = SaveExceptionWindow(accountManager, signature)
+    def saveExceptionWindow(self, signature, *args, **kwargs):
+        win = SaveExceptionWindow(signature)
         win.run()
 
 class SaveExceptionWindow(AbstractSaveExceptionWindow):
-    def __init__(self, accountManager, signature, *args, **kwargs):
-        import report.io.GTKIO
-
-        self.accountManager = accountManager
+    def __init__(self, signature, *args, **kwargs):
         self.signature = signature
 
-        self.io = report.io.GTKIO.GTKIO(self.accountManager)
-
     def run(self, *args, **kwargs):
         # Don't need to check the return value of report since it will
         # handle all the UI reporting for us.
-        report.report(self.signature, self.io)
+        report.report_problem_in_memory(self.signature, report.LIBREPORT_WAIT)
 
 class MainExceptionWindow(AbstractMainExceptionWindow):
     def __init__(self, shortTraceback=None, longTraceback=None, *args, **kwargs):
diff --git a/python-meh.spec b/python-meh.spec
index 3a6ea71..24c1649 100644
--- a/python-meh.spec
+++ b/python-meh.spec
@@ -1,6 +1,6 @@
 %{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
 
-%define libreportver 2.0.11-1
+%define libreportver 2.0.18-1
 
 Summary:  A python library for handling exceptions
 Name: python-meh
-- 
1.7.11.7



More information about the anaconda-patches mailing list