factor out double handle2internal
svn: r21127
This commit is contained in:
parent
f17f4cc0ac
commit
6fa7b75550
@ -53,7 +53,7 @@ from ..ggettext import gettext as _
|
||||
# Gramps modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ..constfunc import conv_to_unicode
|
||||
from ..constfunc import conv_to_unicode, handle2internal
|
||||
from .dbconst import *
|
||||
from . import BSDDBTxn
|
||||
from ..errors import DbError
|
||||
@ -69,17 +69,6 @@ DBERRS = (db.DBRunRecoveryError, db.DBAccessError,
|
||||
_SIGBASE = ('person', 'family', 'source', 'event', 'media',
|
||||
'place', 'repository', 'reference', 'note', 'tag', 'citation')
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Helper functions
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
# handle in database is bytes, while internally Gramps wants unicode for py3
|
||||
if sys.version_info[0] < 3:
|
||||
handle2internal = lambda x: x
|
||||
else:
|
||||
handle2internal = lambda x: conv_to_unicode(x, 'utf-8')
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# DbUndo class
|
||||
|
Loading…
Reference in New Issue
Block a user