FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 04-01-2011, 10:05 AM
Martin Gracik
 
Default Save exception to a file

---
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@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 08:27 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org