From 37e7ead1e2a07a45577d2bd069132159c886602b Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Thu, 14 May 2015 12:48:55 -0400 Subject: [PATCH] Fixed About dialog to show proper BSDDB version --- gramps/gui/aboutdialog.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/gramps/gui/aboutdialog.py b/gramps/gui/aboutdialog.py index 7ab181cc2..a80e3f26b 100644 --- a/gramps/gui/aboutdialog.py +++ b/gramps/gui/aboutdialog.py @@ -29,12 +29,6 @@ import os import sys import io -try: - import bsddb3 as bsddb ## ok, in try/except - BSDDB_STR = ellipses(str(bsddb.__version__) + " " + str(bsddb.db.version())) -except: - BSDDB_STR = 'not found' - ##import logging ##_LOG = logging.getLogger(".GrampsAboutDialog") @@ -65,6 +59,20 @@ _ = glocale.translation.gettext from gramps.gen.constfunc import get_env_var from .display import display_url +def ellipses(text): + """ + Ellipsize text on length 40 + """ + if len(text) > 40: + return text[:40] + "..." + return text + +try: + import bsddb3 as bsddb ## ok, in try/except + BSDDB_STR = ellipses(str(bsddb.__version__) + " " + str(bsddb.db.version())) +except: + BSDDB_STR = 'not found' + #------------------------------------------------------------------------- # # GrampsAboutDialog @@ -135,14 +143,6 @@ class GrampsAboutDialog(Gtk.AboutDialog): ellipses(operatingsystem), ellipses(distribution))) -def ellipses(text): - """ - Ellipsize text on length 40 - """ - if len(text) > 40: - return text[:40] + "..." - return text - #------------------------------------------------------------------------- # # AuthorParser