From 281502576f4926dd149fe7fa93ac387e3ccd86e5 Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Sat, 3 Oct 2009 16:10:50 +0000 Subject: [PATCH] Add easy way to get version info from users without causing a crash svn: r13296 --- src/GrampsAboutDialog.py | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/src/GrampsAboutDialog.py b/src/GrampsAboutDialog.py index 2cd6130f4..0689ff0c8 100644 --- a/src/GrampsAboutDialog.py +++ b/src/GrampsAboutDialog.py @@ -28,6 +28,9 @@ # #------------------------------------------------------------------------- from gettext import gettext as _ +import os +import sys +import bsddb ##import logging ##_LOG = logging.getLogger(".GrampsAboutDialog") @@ -37,7 +40,6 @@ try: except ImportError: from _xmlplus.sax import make_parser, handler, SAXParseException - #------------------------------------------------------------------------- # # Gtk modules @@ -90,7 +92,7 @@ class GrampsAboutDialog(gtk.AboutDialog): except IOError: self.set_license("License file is missing") - self.set_comments(_(const.COMMENTS)) + self.set_comments(_(const.COMMENTS) + self.get_versions()) self.set_website_label(_('GRAMPS Homepage')) self.set_website(const.URL_HOMEPAGE) @@ -105,6 +107,33 @@ class GrampsAboutDialog(gtk.AboutDialog): self.set_logo(gtk.gdk.pixbuf_new_from_file(const.SPLASH)) self.set_modal(True) + def get_versions(self): + if hasattr(os, "uname"): + operatingsystem = os.uname()[0] + distribution = os.uname()[2] + else: + operatingsystem = sys.platform + distribution = " " + + return (("\n\n" + + "GRAMPS: %s \n" + + "Python: %s \n" + + "BSDDB: %s \n" + + "LANG: %s\n" + + "OS: %s\n" + + "Distribution: %s") + % (elipses(str(const.VERSION)), + elipses(str(sys.version).replace('\n','')), + elipses(str(bsddb.__version__)), + elipses(os.environ.get('LANG','')), + elipses(operatingsystem), + elipses(distribution))) + +def elipses(text): + if len(text) > 40: + return text[:40] + "..." + return text + #------------------------------------------------------------------------- # # AuthorParser