[firstboot 11/13] Save exception to a file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 progs/firstboot |   19 +++++++++++++++++--
 1 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/progs/firstboot b/progs/firstboot
index 64fe0c2..05c2aec 100755
--- a/progs/firstboot
+++ b/progs/firstboot
@@ -23,10 +23,12 @@
 
 import optparse
 import os
+import sys
+import tempfile
+import traceback
 
 import firstboot.frontend
 import firstboot.loader
-import firstboot.interface
 
 from firstboot.constants import *
 
@@ -36,7 +38,15 @@ from firstboot.config import *
 import meh
 import meh.handler
 import meh.dump
-import meh.ui.gui
+
+
+def exception_handler(type, value, tb):
+    fd, path = tempfile.mkstemp(prefix='firstboot-', suffix='.trace')
+    fo = os.fdopen(fd, 'w')
+    traceback.print_exception(type, value, tb, None, fo)
+    fo.close()
+
+sys.excepthook = exception_handler
 
 
 if __name__ == '__main__':
@@ -72,6 +82,11 @@ if __name__ == '__main__':
         frontend.start_wm()
         frontend.merge_xres()
 
+
+    # these modules import gtk, so we need to have a display first
+    import firstboot.interface
+    import meh.ui.gui
+
     # XXX set up the interface
     config.frontend = frontend
     config.interface = firstboot.interface.Interface(opts.autoscreenshot,
-- 
1.7.3.2

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux