2002-10-20 19:55:16 +05:30
|
|
|
#
|
|
|
|
# Gramps - a GTK+/GNOME based genealogy program
|
|
|
|
#
|
2005-03-14 09:21:40 +05:30
|
|
|
# Copyright (C) 2002-2005 Donald N. Allingham
|
2002-10-20 19:55:16 +05:30
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation; either version 2 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software
|
|
|
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
#
|
|
|
|
|
2003-10-22 09:45:27 +05:30
|
|
|
# $Id$
|
|
|
|
|
2002-10-20 19:55:16 +05:30
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# Standard python modules
|
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
import cStringIO
|
|
|
|
import traceback
|
|
|
|
import sys
|
2002-12-11 10:48:47 +05:30
|
|
|
import os
|
2005-03-14 09:21:40 +05:30
|
|
|
from gettext import gettext as _
|
2002-10-20 19:55:16 +05:30
|
|
|
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# GTK/GNOME modules
|
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
2002-12-11 10:48:47 +05:30
|
|
|
import gtk
|
2002-10-20 19:55:16 +05:30
|
|
|
import gtk.glade
|
|
|
|
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# GRAMPS modules
|
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
import const
|
|
|
|
|
2002-12-11 10:48:47 +05:30
|
|
|
_release_files = [
|
|
|
|
"/etc/mandrake-release",
|
2003-06-30 08:37:24 +05:30
|
|
|
"/etc/redhat-release",
|
2003-12-19 10:03:52 +05:30
|
|
|
"/etc/fedora-release",
|
2003-06-30 08:37:24 +05:30
|
|
|
"/etc/turbolinux-release",
|
2004-12-30 02:49:18 +05:30
|
|
|
"/etc/debian_version",
|
2003-06-30 08:37:24 +05:30
|
|
|
"/etc/environment.corel",
|
2002-12-11 10:48:47 +05:30
|
|
|
"/etc/debian-release",
|
|
|
|
"/etc/SuSE-release",
|
2003-06-30 08:37:24 +05:30
|
|
|
"/etc/slackware-release",
|
2003-12-19 10:03:52 +05:30
|
|
|
"/etc/slackware-version",
|
2002-12-11 10:48:47 +05:30
|
|
|
"/etc/gentoo-release",
|
|
|
|
]
|
|
|
|
|
2002-10-20 19:55:16 +05:30
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# DisplayTrace
|
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
class DisplayTrace:
|
|
|
|
|
|
|
|
def __init__(self):
|
|
|
|
data = sys.exc_info()
|
2002-12-11 10:48:47 +05:30
|
|
|
ver = sys.version_info
|
|
|
|
|
2002-10-20 19:55:16 +05:30
|
|
|
msg = cStringIO.StringIO()
|
2002-12-11 10:48:47 +05:30
|
|
|
msg.write(_('GRAMPS has encountered an internal error.\n'
|
|
|
|
'Please copy the message below and post a bug report\n'
|
|
|
|
'at http://sourceforge.net/projects/gramps or send an\n'
|
|
|
|
'email message to gramps-bugs@lists.sourceforge.net\n\n'))
|
|
|
|
|
|
|
|
msg.write("GRAMPS : %s\n" % const.version)
|
2003-10-22 09:45:27 +05:30
|
|
|
if os.environ.has_key('LANG'):
|
|
|
|
msg.write("LANG : %s\n" % os.environ['LANG'])
|
2005-03-14 09:20:38 +05:30
|
|
|
if os.environ.has_key('LANGUAGE'):
|
|
|
|
msg.write("LANGUAGE : %s\n" % os.environ['LANGUAGE'])
|
2002-12-11 10:48:47 +05:30
|
|
|
msg.write("Python : %s.%s.%s %s\n" % (ver[0],ver[1],ver[2],ver[3]))
|
|
|
|
msg.write("GTK : %s.%s.%s\n" % gtk.gtk_version)
|
2003-06-30 08:37:24 +05:30
|
|
|
msg.write('PyGTK : %d.%d.%d\n' % gtk.pygtk_version)
|
2005-04-23 21:23:30 +05:30
|
|
|
n = '/etc/lsb-release'
|
|
|
|
if os.path.isfile(n):
|
|
|
|
f = open(n)
|
|
|
|
for line in f.readlines():
|
|
|
|
(val,text) = line.split('=')
|
|
|
|
if val == "DISTRIB_DESCRIPTION":
|
|
|
|
msg.write("OS : %s\n" % text.replace('"',''))
|
|
|
|
f.close()
|
|
|
|
else:
|
|
|
|
for n in _release_files:
|
|
|
|
if os.path.isfile(n):
|
|
|
|
try:
|
|
|
|
f = open(n)
|
|
|
|
text = f.readline()
|
|
|
|
if n.find('debian') != -1:
|
|
|
|
text = "Debian %s" % text
|
|
|
|
msg.write("OS : %s\n" % text)
|
|
|
|
f.close()
|
|
|
|
break
|
|
|
|
except:
|
|
|
|
pass
|
2002-12-11 10:48:47 +05:30
|
|
|
|
2002-10-20 19:55:16 +05:30
|
|
|
traceback.print_exception(data[0],data[1],data[2],None,msg)
|
|
|
|
|
2003-08-17 07:44:33 +05:30
|
|
|
self.glade = gtk.glade.XML(const.pluginsFile,"plugstat","gramps")
|
2002-10-20 19:55:16 +05:30
|
|
|
self.top = self.glade.get_widget("plugstat")
|
|
|
|
window = self.glade.get_widget("text")
|
2003-03-06 11:42:51 +05:30
|
|
|
self.top.set_title("%s - GRAMPS" % _('Internal Error'))
|
2002-10-20 19:55:16 +05:30
|
|
|
|
|
|
|
window.get_buffer().set_text(msg.getvalue())
|
2004-05-24 10:02:19 +05:30
|
|
|
print msg.getvalue()
|
2002-10-28 19:06:39 +05:30
|
|
|
self.glade.signal_autoconnect({'on_close_clicked':self.close})
|
2002-10-27 09:50:45 +05:30
|
|
|
|
|
|
|
def close(self,obj):
|
|
|
|
self.top.destroy()
|