Fixed About dialog to show proper BSDDB version
This commit is contained in:
parent
b2ed5d1cbb
commit
e4d05f301a
@ -29,12 +29,6 @@ import os
|
|||||||
import sys
|
import sys
|
||||||
import io
|
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
|
##import logging
|
||||||
##_LOG = logging.getLogger(".GrampsAboutDialog")
|
##_LOG = logging.getLogger(".GrampsAboutDialog")
|
||||||
|
|
||||||
@ -65,6 +59,20 @@ _ = glocale.translation.gettext
|
|||||||
from gramps.gen.constfunc import get_env_var
|
from gramps.gen.constfunc import get_env_var
|
||||||
from .display import display_url
|
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
|
# GrampsAboutDialog
|
||||||
@ -135,14 +143,6 @@ class GrampsAboutDialog(Gtk.AboutDialog):
|
|||||||
ellipses(operatingsystem),
|
ellipses(operatingsystem),
|
||||||
ellipses(distribution)))
|
ellipses(distribution)))
|
||||||
|
|
||||||
def ellipses(text):
|
|
||||||
"""
|
|
||||||
Ellipsize text on length 40
|
|
||||||
"""
|
|
||||||
if len(text) > 40:
|
|
||||||
return text[:40] + "..."
|
|
||||||
return text
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# AuthorParser
|
# AuthorParser
|
||||||
|
Loading…
Reference in New Issue
Block a user