Compare commits
173 Commits
v4.0.0-alp
...
v4.0.0-alp
Author | SHA1 | Date | |
---|---|---|---|
|
80db60b332 | ||
|
c06e8d3b64 | ||
|
c19c5e2569 | ||
|
992b161798 | ||
|
2dee2c4d77 | ||
|
96440156bd | ||
|
588089954a | ||
|
7e749a9e25 | ||
|
3e0fd433b5 | ||
|
8a4732a5d2 | ||
|
8371684a98 | ||
|
2828211c6a | ||
|
bf67b3e114 | ||
|
d01f7bf7df | ||
|
1d2b143be9 | ||
|
debf8b601a | ||
|
bcef9fc868 | ||
|
fae194d1a0 | ||
|
7aa1c2bbde | ||
|
2528da2f2d | ||
|
8ea29ede81 | ||
|
4ca0c9f8c9 | ||
|
5a8a7479dd | ||
|
c3f39e7d40 | ||
|
5235a6a6ac | ||
|
62475bbc87 | ||
|
a33eb1d799 | ||
|
6e73fc8924 | ||
|
06b8b291f8 | ||
|
98fa69b717 | ||
|
7c9ec32d22 | ||
|
e1fb1c5b14 | ||
|
7541dd5b2e | ||
|
e8bad4d4c8 | ||
|
d704d9ac4b | ||
|
d334e0043f | ||
|
dede164e69 | ||
|
f309f210d1 | ||
|
ebe1d0139c | ||
|
ebcd0bb119 | ||
|
fc8eb4f445 | ||
|
3ae8e5cc1e | ||
|
a03877e8c9 | ||
|
357eb8af19 | ||
|
c91eec3d5f | ||
|
870f80fc83 | ||
|
3ee5b1dec4 | ||
|
c37bfc9dbe | ||
|
bb494a56ca | ||
|
4a512c7347 | ||
|
e6034cde4b | ||
|
5e9837d484 | ||
|
57fcc67498 | ||
|
3872899ebc | ||
|
ad20c91b4f | ||
|
5df0c7d3ee | ||
|
daae9242bf | ||
|
114a71c13c | ||
|
7d7cc6f789 | ||
|
b99e2e29df | ||
|
44f065eabf | ||
|
b126aa1fc3 | ||
|
e2860c99f6 | ||
|
6cd609941f | ||
|
4a23da9500 | ||
|
73cdf3d86f | ||
|
d24586eb34 | ||
|
158a5f93fb | ||
|
7ff24aa9d1 | ||
|
bb2bcc4185 | ||
|
c8254b1c68 | ||
|
8d06298921 | ||
|
4621970783 | ||
|
123a6e0ecf | ||
|
3d0fa7a00a | ||
|
400523c7f3 | ||
|
0bbbc76852 | ||
|
252d2932df | ||
|
bffb6767aa | ||
|
0c07855f37 | ||
|
088c97106f | ||
|
bfa28faf55 | ||
|
8222d4c04c | ||
|
879c48f57d | ||
|
7127f8f2da | ||
|
db9daced3c | ||
|
c42cb6beee | ||
|
efa53a0537 | ||
|
bbf16cb40c | ||
|
d62ff6059e | ||
|
f3361500c0 | ||
|
df1157e9d4 | ||
|
11ad512f2d | ||
|
fd559d0d80 | ||
|
7a894d9a41 | ||
|
b6b3fb8680 | ||
|
755b653925 | ||
|
592f68ab6e | ||
|
0986d69429 | ||
|
98898ddb71 | ||
|
8cbba85cf1 | ||
|
c01846fb84 | ||
|
fccfdecd03 | ||
|
3f408af0fa | ||
|
8cea2e239a | ||
|
221c30976f | ||
|
e28e114c95 | ||
|
3788d52107 | ||
|
740c7036d7 | ||
|
eeaf8697f0 | ||
|
3fabbe1ecb | ||
|
d10d572002 | ||
|
3d0fa69bd0 | ||
|
a84d51d6b7 | ||
|
88831f8398 | ||
|
945bec0d6c | ||
|
dfb6be488d | ||
|
22bcc94ec0 | ||
|
d02f6a3fb1 | ||
|
76eae75da2 | ||
|
657d8e233f | ||
|
5bb9581b15 | ||
|
d6c4298ff4 | ||
|
260170ce36 | ||
|
801f1b77aa | ||
|
d5dfa05ff9 | ||
|
808002d419 | ||
|
4dc0f01137 | ||
|
aa7e0b49e4 | ||
|
3c103143a6 | ||
|
ef65c893ea | ||
|
566c3fb32b | ||
|
db1bd1e114 | ||
|
866796f5dc | ||
|
fdf740b35c | ||
|
1500556d99 | ||
|
5e4b2d3bdc | ||
|
880e6c44e7 | ||
|
4068bebb3e | ||
|
0465b9cf37 | ||
|
fed5cc6a71 | ||
|
69800680a3 | ||
|
a3a758fd13 | ||
|
eadae6dbc9 | ||
|
3ee843917e | ||
|
43c49238f5 | ||
|
641155478f | ||
|
6ca692e33a | ||
|
41fdca39dd | ||
|
bb3ac61359 | ||
|
a00a5ba32d | ||
|
efdb6e9fd5 | ||
|
ff12fdc4a3 | ||
|
3ef8a88a11 | ||
|
117b5b6594 | ||
|
6a5a78eee0 | ||
|
ba28adea94 | ||
|
17f938c978 | ||
|
54034d4811 | ||
|
45fc795964 | ||
|
0d9884186a | ||
|
e593d753ee | ||
|
2cd6aa43e4 | ||
|
7c82a5df48 | ||
|
23baca2f09 | ||
|
02fd2409c5 | ||
|
3b4496a808 | ||
|
235a1e72fd | ||
|
1af985dbc7 | ||
|
378f24272c | ||
|
6bc5bcf644 | ||
|
efbd0e95dd | ||
|
45a6524247 |
@@ -1,4 +1,4 @@
|
||||
"UNSTABLE Gramps 4.0.0 Alpha4 release.
|
||||
"UNSTABLE Gramps 4.0.0 Alpha5 release.
|
||||
|
||||
This is a technology preview to allow plugin writers and packagers-installer
|
||||
writers to update their plugins and scripts. This release is not production
|
||||
|
@@ -52,11 +52,11 @@ SPHINXBUILD = 'sphinx-build'
|
||||
if sys.platform == 'win32':
|
||||
pythonCmd = os.path.join(sys.prefix, 'bin', 'python.exe')
|
||||
sphinxCmd = os.path.join(sys.prefix, 'bin', 'sphinx-build.exe')
|
||||
elif sys.platform == 'linux2' or os.name == 'darwin':
|
||||
elif sys.platform in ['linux2', 'darwin', 'cygwin']:
|
||||
pythonCmd = os.path.join(sys.prefix, 'bin', 'python')
|
||||
sphinxCmd = SPHINXBUILD
|
||||
else:
|
||||
print ("ERROR: unknown system, don't know sphinx, ... commands")
|
||||
print ("Update Man ERROR: unknown system, don't know sphinx, ... commands")
|
||||
sys.exit(0)
|
||||
|
||||
def tests():
|
||||
|
@@ -42,11 +42,11 @@ SPHINXBUILD = 'sphinx-build'
|
||||
if sys.platform == 'win32':
|
||||
pythonCmd = os.path.join(sys.prefix, 'bin', 'python.exe')
|
||||
sphinxCmd = os.path.join(sys.prefix, 'bin', 'sphinx-build.exe')
|
||||
elif sys.platform == 'linux2' or os.name == 'darwin':
|
||||
elif sys.platform in ['linux2', 'darwin', 'cygwin']:
|
||||
pythonCmd = os.path.join(sys.prefix, 'bin', 'python')
|
||||
sphinxCmd = SPHINXBUILD
|
||||
else:
|
||||
print ("ERROR: unknown system, don't know sphinx, ... commands")
|
||||
print ("Update Docs ERROR: unknown system, don't know sphinx, ... commands")
|
||||
sys.exit(0)
|
||||
|
||||
def tests():
|
||||
|
@@ -39,7 +39,8 @@ Module responsible for handling the command line arguments for GRAMPS.
|
||||
from __future__ import print_function
|
||||
import os
|
||||
import sys
|
||||
from gramps.gen.ggettext import gettext as _
|
||||
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
@@ -185,9 +186,9 @@ class ArgHandler(object):
|
||||
else:
|
||||
# Need to convert to system file encoding before printing
|
||||
# For non latin characters in path/file/user names
|
||||
print(msg1.encode(sys.getfilesystemencoding()), file=sys.stderr)
|
||||
print(msg1.encode(sys.stdout.encoding, 'backslashreplace'), file=sys.stderr)
|
||||
if msg2 is not None:
|
||||
print(msg2.encode(sys.getfilesystemencoding()), file=sys.stderr)
|
||||
print(msg2.encode(sys.stdout.encoding, 'backslashreplace'), file=sys.stderr)
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
# Argument parser: sorts out given arguments
|
||||
@@ -294,7 +295,7 @@ class ArgHandler(object):
|
||||
else:
|
||||
ask = input
|
||||
ans = ask(_('OK to overwrite? (yes/no) ') \
|
||||
.encode(sys.getfilesystemencoding()))
|
||||
.encode(sys.stdout.encoding, 'backslashreplace'))
|
||||
except EOFError:
|
||||
print()
|
||||
sys.exit(0)
|
||||
@@ -408,26 +409,26 @@ class ArgHandler(object):
|
||||
|
||||
if self.list:
|
||||
print(_('List of known family trees in your database path\n').\
|
||||
encode(sys.getfilesystemencoding()))
|
||||
encode(sys.stdout.encoding, 'backslashreplace'))
|
||||
for name, dirname in sorted(self.dbman.family_tree_list(),
|
||||
key=lambda pair: pair[0].lower()):
|
||||
|
||||
print((_("%(full_DB_path)s with name \"%(f_t_name)s\"") % \
|
||||
{'full_DB_path' : dirname,
|
||||
'f_t_name' : name}).encode(sys.getfilesystemencoding()))
|
||||
'f_t_name' : name}).encode(sys.stdout.encoding, 'backslashreplace'))
|
||||
sys.exit(0)
|
||||
|
||||
if self.list_more:
|
||||
print(_('Gramps Family Trees:').encode(sys.getfilesystemencoding()))
|
||||
print(_('Gramps Family Trees:').encode(sys.stdout.encoding, 'backslashreplace'))
|
||||
summary_list = self.dbman.family_tree_summary()
|
||||
for summary in sorted(summary_list,
|
||||
key=lambda sum: sum["Family tree"].lower()):
|
||||
print(_("Family Tree \"%s\":").\
|
||||
encode(sys.getfilesystemencoding()) % summary["Family tree"])
|
||||
print(_("Family Tree \"%s\":") % summary["Family tree"].\
|
||||
encode(sys.stdout.encoding, 'backslashreplace'))
|
||||
for item in sorted(summary):
|
||||
if item != "Family tree":
|
||||
print((" %s: %s" % (item, summary[item])).\
|
||||
encode(sys.getfilesystemencoding()))
|
||||
encode(sys.stdout.encoding, 'backslashreplace'))
|
||||
sys.exit(0)
|
||||
|
||||
self.__open_action()
|
||||
@@ -442,7 +443,7 @@ class ArgHandler(object):
|
||||
for expt in self.exports:
|
||||
# Need to convert path/filename to str before printing
|
||||
# For non latin characters in Windows path/file/user names
|
||||
fn = expt[0].encode(sys.getfilesystemencoding())
|
||||
fn = expt[0].encode(sys.stdout.encoding, 'backslashreplace')
|
||||
fmt = str(expt[1])
|
||||
print(_("Exporting: file %(filename)s, "
|
||||
"format %(format)s.") % \
|
||||
@@ -480,7 +481,7 @@ class ArgHandler(object):
|
||||
self.imp_db_path, title = self.dbman.create_new_db_cli()
|
||||
else:
|
||||
self.imp_db_path = get_empty_tempdir("import_dbdir") \
|
||||
.encode(sys.getfilesystemencoding())
|
||||
.encode(sys.stdout.encoding, 'backslashreplace')
|
||||
newdb = DbBsddb()
|
||||
newdb.write_version(self.imp_db_path)
|
||||
|
||||
@@ -494,7 +495,7 @@ class ArgHandler(object):
|
||||
sys.exit(0)
|
||||
|
||||
for imp in self.imports:
|
||||
fn = imp[0].encode(sys.getfilesystemencoding())
|
||||
fn = imp[0].encode(sys.stdout.encoding, 'backslashreplace')
|
||||
fmt = str(imp[1])
|
||||
msg = _("Importing: file %(filename)s, format %(format)s.") % \
|
||||
{'filename' : fn, 'format' : fmt}
|
||||
@@ -623,10 +624,10 @@ class ArgHandler(object):
|
||||
# Print cli report name ([item[0]), GUI report name (item[4])
|
||||
if len(pdata.id) <= 25:
|
||||
print(" %s%s- %s" % ( pdata.id, " " * (26 - len(pdata.id)),
|
||||
pdata.name.encode(sys.getfilesystemencoding())), file=sys.stderr)
|
||||
pdata.name.encode(sys.stdout.encoding, 'backslashreplace')), file=sys.stderr)
|
||||
else:
|
||||
print(" %s\t- %s" % (pdata.id,
|
||||
pdata.name.encode(sys.getfilesystemencoding())), file=sys.stderr)
|
||||
pdata.name.encode(sys.stdout.encoding, 'backslashreplace')), file=sys.stderr)
|
||||
|
||||
elif action == "tool":
|
||||
from gramps.gui.plug import tool
|
||||
@@ -664,10 +665,10 @@ class ArgHandler(object):
|
||||
# Print cli report name ([item[0]), GUI report name (item[4])
|
||||
if len(pdata.id) <= 25:
|
||||
print(" %s%s- %s" % ( pdata.id, " " * (26 - len(pdata.id)),
|
||||
pdata.name.encode(sys.getfilesystemencoding())), file=sys.stderr)
|
||||
pdata.name.encode(sys.stdout.encoding, 'backslashreplace')), file=sys.stderr)
|
||||
else:
|
||||
print(" %s\t- %s" % (pdata.id,
|
||||
pdata.name.encode(sys.getfilesystemencoding())), file=sys.stderr)
|
||||
pdata.name.encode(sys.stdout.encoding, 'backslashreplace')), file=sys.stderr)
|
||||
|
||||
elif action == "book":
|
||||
try:
|
||||
|
@@ -39,7 +39,8 @@ Module responsible for handling the command line arguments for GRAMPS.
|
||||
from __future__ import print_function
|
||||
import sys
|
||||
import getopt
|
||||
from gramps.gen.ggettext import gettext as _
|
||||
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
import logging
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
@@ -292,7 +293,7 @@ class ArgParser(object):
|
||||
self.list_more = True
|
||||
elif option in ('-s','--show'):
|
||||
print ("Gramps config settings from %s:" % \
|
||||
config.filename.encode(sys.getfilesystemencoding()))
|
||||
config.filename.encode(sys.stdout.encoding, 'backslashreplace'))
|
||||
for section in config.data:
|
||||
for setting in config.data[section]:
|
||||
print ("%s.%s=%s" % (
|
||||
@@ -402,7 +403,7 @@ class ArgParser(object):
|
||||
"""
|
||||
if self.help:
|
||||
# Convert Help messages to file system encoding before printing
|
||||
print (_HELP.encode(sys.getfilesystemencoding()))
|
||||
print (_HELP.encode(sys.stdout.encoding, 'backslashreplace'))
|
||||
sys.exit(0)
|
||||
|
||||
def print_usage(self):
|
||||
@@ -411,5 +412,5 @@ class ArgParser(object):
|
||||
"""
|
||||
if self.usage:
|
||||
# Convert Help messages to file system encoding before printing
|
||||
print (_USAGE.encode(sys.getfilesystemencoding()))
|
||||
print (_USAGE.encode(sys.stdout.encoding, 'backslashreplace'))
|
||||
sys.exit(0)
|
||||
|
@@ -44,7 +44,6 @@ else:
|
||||
from urllib.parse import urlparse
|
||||
from urllib.request import urlopen, url2pathname
|
||||
import tempfile
|
||||
from gramps.gen.ggettext import gettext as _
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# set up logging
|
||||
@@ -58,6 +57,8 @@ LOG = logging.getLogger(".clidbman")
|
||||
# gramps modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
from gramps.gen.db import DbBsddb
|
||||
from gramps.gen.plug import BasePluginManager
|
||||
from gramps.gen.config import config
|
||||
@@ -147,8 +148,8 @@ class CLIDbManager(object):
|
||||
from gramps.gen.db import META, PERSON_TBL
|
||||
env = db.DBEnv()
|
||||
flags = db.DB_CREATE | db.DB_PRIVATE |\
|
||||
db.DB_INIT_MPOOL | db.DB_INIT_LOCK |\
|
||||
db.DB_INIT_LOG | db.DB_INIT_TXN | db.DB_THREAD
|
||||
db.DB_INIT_MPOOL |\
|
||||
db.DB_INIT_LOG | db.DB_INIT_TXN
|
||||
try:
|
||||
env.open(file_name, flags)
|
||||
except:
|
||||
@@ -158,8 +159,9 @@ class CLIDbManager(object):
|
||||
try:
|
||||
dbmap1.open(fname, META, db.DB_HASH, db.DB_RDONLY)
|
||||
except:
|
||||
env.close()
|
||||
return "Unknown", "Unknown"
|
||||
version = dbmap1.get('version', default=None)
|
||||
version = dbmap1.get(b'version', default=None)
|
||||
dbmap1.close()
|
||||
dbmap2 = dbshelve.DBShelf(env)
|
||||
fname = os.path.join(file_name, PERSON_TBL + ".db")
|
||||
@@ -191,7 +193,7 @@ class CLIDbManager(object):
|
||||
retval["Locked?"] = "no"
|
||||
retval["DB version"] = version
|
||||
if sys.version_info[0] < 3:
|
||||
retval["Family tree"] = name.encode(sys.getfilesystemencoding())
|
||||
retval["Family tree"] = name.encode(glocale.getfilesystemencoding())
|
||||
else:
|
||||
retval["Family tree"] = name
|
||||
retval["Path"] = dirpath
|
||||
@@ -206,7 +208,7 @@ class CLIDbManager(object):
|
||||
# make the default directory if it does not exist
|
||||
dbdir = os.path.expanduser(config.get('behavior.database-path'))
|
||||
if sys.version_info[0] < 3:
|
||||
dbdir = dbdir.encode(sys.getfilesystemencoding())
|
||||
dbdir = dbdir.encode(glocale.getfilesystemencoding())
|
||||
db_ok = make_dbdir(dbdir)
|
||||
|
||||
self.current_names = []
|
||||
@@ -217,6 +219,7 @@ class CLIDbManager(object):
|
||||
if os.path.isfile(path_name):
|
||||
file = open(path_name)
|
||||
name = file.readline().strip()
|
||||
file.close()
|
||||
|
||||
(tval, last) = time_val(dirpath)
|
||||
(enable, stock_id) = self.icon_values(dirpath, self.active,
|
||||
@@ -413,7 +416,7 @@ def make_dbdir(dbdir):
|
||||
if not os.path.isdir(dbdir):
|
||||
os.makedirs(dbdir)
|
||||
except (IOError, OSError) as msg:
|
||||
msg = conv_to_unicode(str(msg), sys.getfilesystemencoding())
|
||||
msg = conv_to_unicode(str(msg), glocale.getfilesystemencoding())
|
||||
LOG.error(_("\nERROR: Wrong database path in Edit Menu->Preferences.\n"
|
||||
"Open preferences and set correct database path.\n\n"
|
||||
"Details: Could not make database directory:\n %s\n\n") % msg)
|
||||
@@ -442,7 +445,7 @@ def find_next_db_dir():
|
||||
base = "%x" % int(time.time())
|
||||
dbdir = os.path.expanduser(config.get('behavior.database-path'))
|
||||
if sys.version_info[0] < 3:
|
||||
dbdir = dbdir.encode(sys.getfilesystemencoding())
|
||||
dbdir = dbdir.encode(glocale.getfilesystemencoding())
|
||||
new_path = os.path.join(dbdir, base)
|
||||
if not os.path.isdir(new_path):
|
||||
break
|
||||
@@ -485,7 +488,7 @@ def find_locker_name(dirpath):
|
||||
# Convert username to unicode according to system encoding
|
||||
# Otherwise problems with non ASCII characters in
|
||||
# username in Windows
|
||||
username = conv_to_unicode(username, sys.getfilesystemencoding())
|
||||
username = conv_to_unicode(username, glocale.getfilesystemencoding())
|
||||
# feature request 2356: avoid genitive form
|
||||
last = _("Locked by %s") % username
|
||||
ifile.close()
|
||||
|
@@ -35,7 +35,8 @@ Provides also two small base classes: CLIDbLoader, CLIManager
|
||||
#-------------------------------------------------------------------------
|
||||
from __future__ import print_function
|
||||
|
||||
from gramps.gen.ggettext import gettext as _
|
||||
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
import os
|
||||
import sys
|
||||
|
||||
@@ -296,10 +297,10 @@ def startcli(errors, argparser):
|
||||
#already errors encountered. Show first one on terminal and exit
|
||||
# Convert error message to file system encoding before print
|
||||
errmsg = _('Error encountered: %s') % errors[0][0]
|
||||
errmsg = errmsg.encode(sys.getfilesystemencoding())
|
||||
errmsg = errmsg.encode(sys.stdout.encoding, 'backslashreplace')
|
||||
print(errmsg)
|
||||
errmsg = _(' Details: %s') % errors[0][1]
|
||||
errmsg = errmsg.encode(sys.getfilesystemencoding())
|
||||
errmsg = errmsg.encode(sys.stdout.encoding, 'backslashreplace')
|
||||
print(errmsg)
|
||||
sys.exit(1)
|
||||
|
||||
@@ -307,10 +308,10 @@ def startcli(errors, argparser):
|
||||
# Convert error message to file system encoding before print
|
||||
errmsg = _('Error encountered in argument parsing: %s') \
|
||||
% argparser.errors[0][0]
|
||||
errmsg = errmsg.encode(sys.getfilesystemencoding())
|
||||
errmsg = errmsg.encode(sys.stdout.encoding, 'backslashreplace')
|
||||
print(errmsg)
|
||||
errmsg = _(' Details: %s') % argparser.errors[0][1]
|
||||
errmsg = errmsg.encode(sys.getfilesystemencoding())
|
||||
errmsg = errmsg.encode(sys.stdout.encoding, 'backslashreplace')
|
||||
print(errmsg)
|
||||
sys.exit(1)
|
||||
|
||||
|
@@ -35,7 +35,8 @@
|
||||
#-------------------------------------------------------------------------
|
||||
from __future__ import print_function
|
||||
|
||||
from gramps.gen.ggettext import gettext as _
|
||||
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
import traceback
|
||||
import os
|
||||
import sys
|
||||
@@ -570,11 +571,11 @@ class CommandLineReport(object):
|
||||
# Make the output nicer to read, assume a tab has 8 spaces
|
||||
tabs = '\t\t' if len(key) < 10 else '\t'
|
||||
optmsg = " %s%s%s (%s)" % (key, tabs, opt[1], opt[0])
|
||||
print(optmsg.encode(sys.getfilesystemencoding()))
|
||||
print(optmsg.encode(sys.stdout.encoding, 'backslashreplace'))
|
||||
else:
|
||||
optmsg = " %s%s%s" % (key, tabs,
|
||||
_('(no help available)'))
|
||||
print(optmsg.encode(sys.getfilesystemencoding()))
|
||||
print(optmsg.encode(sys.stdout.encoding, 'backslashreplace'))
|
||||
print((_(" Use '%(donottranslate)s' to see description "
|
||||
"and acceptable values") %
|
||||
{'donottranslate' : "show=option"}))
|
||||
@@ -587,10 +588,10 @@ class CommandLineReport(object):
|
||||
if isinstance(vals, (list, tuple)):
|
||||
for val in vals:
|
||||
optmsg = " %s" % val
|
||||
print(optmsg.encode(sys.getfilesystemencoding()))
|
||||
print(optmsg.encode(sys.stdout.encoding, 'backslashreplace'))
|
||||
else:
|
||||
optmsg = " %s" % opt[2]
|
||||
print(optmsg.encode(sys.getfilesystemencoding()))
|
||||
print(optmsg.encode(sys.stdout.encoding, 'backslashreplace'))
|
||||
|
||||
else:
|
||||
#there was a show option given, but the option is invalid
|
||||
|
@@ -38,7 +38,8 @@ import sys
|
||||
# Gramps Modules
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
from gramps.gen.ggettext import gettext as _
|
||||
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
from gramps.gen.user import User
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
|
@@ -41,7 +41,8 @@ import logging
|
||||
# Gramps imports
|
||||
#
|
||||
#---------------------------------------------------------------
|
||||
from .ggettext import gettext as _
|
||||
from .const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
from .const import HOME_DIR, USER_HOME, VERSION_DIR
|
||||
from .utils.configmanager import ConfigManager
|
||||
|
||||
|
@@ -42,7 +42,6 @@ import uuid
|
||||
# Gramps modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from .ggettext import sgettext as _
|
||||
from .svn_revision import get_svn_revision
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
@@ -94,6 +93,12 @@ APP_GRAMPS_PKG = "application/x-gramps-package"
|
||||
APP_GENEWEB = "application/x-geneweb"
|
||||
APP_VCARD = ["text/x-vcard", "text/x-vcalendar"]
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# system paths
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
LOCALE_DIR = "@LOCALE_DIR@"
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Platforms
|
||||
@@ -170,7 +175,7 @@ if sys.version_info[0] < 3:
|
||||
ROOT_DIR = os.path.abspath(os.path.join(os.path.dirname(
|
||||
unicode(__file__, sys.getfilesystemencoding())), os.pardir))
|
||||
|
||||
#VERSION += get_svn_revision(ROOT_DIR)
|
||||
VERSION += get_svn_revision(ROOT_DIR)
|
||||
|
||||
#
|
||||
# Glade files
|
||||
@@ -213,6 +218,14 @@ LOGO = os.path.join(IMAGE_DIR, "logo.png")
|
||||
SPLASH = os.path.join(IMAGE_DIR, "splash.jpg")
|
||||
|
||||
LICENSE_FILE = os.path.join(DOC_DIR, 'COPYING')
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Init Localization
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from gramps.gen.utils.grampslocale import GrampsLocale
|
||||
GRAMPS_LOCALE = GrampsLocale()
|
||||
_ = GRAMPS_LOCALE.get_translation().sgettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -24,8 +24,15 @@
|
||||
Class handling language-specific selection for date parser and displayer.
|
||||
"""
|
||||
|
||||
from __future__ import print_function
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# set up logging
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
import logging
|
||||
|
||||
from ..const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().sgettext
|
||||
# import prerequisites for localized handlers
|
||||
from ._datehandler import (LANG, LANG_SHORT, LANG_TO_PARSER, LANG_TO_DISPLAY,
|
||||
register_datehandler)
|
||||
@@ -59,7 +66,7 @@ try:
|
||||
else:
|
||||
parser = LANG_TO_PARSER[LANG_SHORT]()
|
||||
except:
|
||||
print("Date parser for", LANG, "not available, using default")
|
||||
logging.warning(_("Date parser for '%s' not available, using default") % LANG)
|
||||
parser = LANG_TO_PARSER["C"]()
|
||||
|
||||
# Initialize global displayer
|
||||
@@ -75,7 +82,7 @@ try:
|
||||
else:
|
||||
displayer = LANG_TO_DISPLAY[LANG_SHORT](val)
|
||||
except:
|
||||
print("Date displayer for", LANG, "not available, using default")
|
||||
logging.warning(_("Date displayer for '%s' not available, using default") % LANG)
|
||||
displayer = LANG_TO_DISPLAY["C"](val)
|
||||
|
||||
|
||||
|
@@ -25,6 +25,8 @@ import locale
|
||||
import sys
|
||||
from ..constfunc import mac, win, conv_to_unicode
|
||||
|
||||
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
||||
|
||||
"""
|
||||
Some OS environments do not support the locale.nl_langinfo() method
|
||||
of determing month names and other date related information.
|
||||
@@ -40,8 +42,9 @@ if sys.version_info[0] < 3:
|
||||
else:
|
||||
#locale returns unicode in python 3
|
||||
to_uni = lambda x, y: x
|
||||
codeset = glocale.encoding
|
||||
|
||||
try:
|
||||
codeset = locale.nl_langinfo(locale.CODESET)
|
||||
|
||||
month_to_int = {
|
||||
to_uni(locale.nl_langinfo(locale.MON_1), codeset).lower() : 1,
|
||||
@@ -137,69 +140,64 @@ try:
|
||||
|
||||
except:
|
||||
import time
|
||||
codeset = None
|
||||
if win() or mac():
|
||||
codeset = locale.getlocale()[1]
|
||||
if codeset is None:
|
||||
codeset = locale.getpreferredencoding()
|
||||
|
||||
month_to_int = {
|
||||
to_uni(time.strftime('%B',(0,1,1,1,1,1,1,1,1)), codeset).lower() : 1,
|
||||
to_uni(time.strftime('%b',(0,1,1,1,1,1,1,1,1)), codeset).lower() : 1,
|
||||
to_uni(time.strftime('%B',(0,2,1,1,1,1,1,1,1)), codeset).lower() : 2,
|
||||
to_uni(time.strftime('%b',(0,2,1,1,1,1,1,1,1)), codeset).lower() : 2,
|
||||
to_uni(time.strftime('%B',(0,3,1,1,1,1,1,1,1)), codeset).lower() : 3,
|
||||
to_uni(time.strftime('%b',(0,3,1,1,1,1,1,1,1)), codeset).lower() : 3,
|
||||
to_uni(time.strftime('%B',(0,4,1,1,1,1,1,1,1)), codeset).lower() : 4,
|
||||
to_uni(time.strftime('%b',(0,4,1,1,1,1,1,1,1)), codeset).lower() : 4,
|
||||
to_uni(time.strftime('%B',(0,5,1,1,1,1,1,1,1)), codeset).lower() : 5,
|
||||
to_uni(time.strftime('%b',(0,5,1,1,1,1,1,1,1)), codeset).lower() : 5,
|
||||
to_uni(time.strftime('%B',(0,6,1,1,1,1,1,1,1)), codeset).lower() : 6,
|
||||
to_uni(time.strftime('%b',(0,6,1,1,1,1,1,1,1)), codeset).lower() : 6,
|
||||
to_uni(time.strftime('%B',(0,7,1,1,1,1,1,1,1)), codeset).lower() : 7,
|
||||
to_uni(time.strftime('%b',(0,7,1,1,1,1,1,1,1)), codeset).lower() : 7,
|
||||
to_uni(time.strftime('%B',(0,8,1,1,1,1,1,1,1)), codeset).lower() : 8,
|
||||
to_uni(time.strftime('%b',(0,8,1,1,1,1,1,1,1)), codeset).lower() : 8,
|
||||
to_uni(time.strftime('%B',(0,9,1,1,1,1,1,1,1)), codeset).lower() : 9,
|
||||
to_uni(time.strftime('%b',(0,9,1,1,1,1,1,1,1)), codeset).lower() : 9,
|
||||
to_uni(time.strftime('%B',(0,10,1,1,1,1,1,1,1)), codeset).lower() : 10,
|
||||
to_uni(time.strftime('%b',(0,10,1,1,1,1,1,1,1)), codeset).lower() : 10,
|
||||
to_uni(time.strftime('%B',(0,11,1,1,1,1,1,1,1)), codeset).lower() : 11,
|
||||
to_uni(time.strftime('%b',(0,11,1,1,1,1,1,1,1)), codeset).lower() : 11,
|
||||
to_uni(time.strftime('%B',(0,12,1,1,1,1,1,1,1)), codeset).lower() : 12,
|
||||
to_uni(time.strftime('%b',(0,12,1,1,1,1,1,1,1)), codeset).lower() : 12,
|
||||
to_uni(time.strftime('%B',(1,1,1,1,1,1,1,1,1)), codeset).lower() : 1,
|
||||
to_uni(time.strftime('%b',(1,1,1,1,1,1,1,1,1)), codeset).lower() : 1,
|
||||
to_uni(time.strftime('%B',(1,2,1,1,1,1,1,1,1)), codeset).lower() : 2,
|
||||
to_uni(time.strftime('%b',(1,2,1,1,1,1,1,1,1)), codeset).lower() : 2,
|
||||
to_uni(time.strftime('%B',(1,3,1,1,1,1,1,1,1)), codeset).lower() : 3,
|
||||
to_uni(time.strftime('%b',(1,3,1,1,1,1,1,1,1)), codeset).lower() : 3,
|
||||
to_uni(time.strftime('%B',(1,4,1,1,1,1,1,1,1)), codeset).lower() : 4,
|
||||
to_uni(time.strftime('%b',(1,4,1,1,1,1,1,1,1)), codeset).lower() : 4,
|
||||
to_uni(time.strftime('%B',(1,5,1,1,1,1,1,1,1)), codeset).lower() : 5,
|
||||
to_uni(time.strftime('%b',(1,5,1,1,1,1,1,1,1)), codeset).lower() : 5,
|
||||
to_uni(time.strftime('%B',(1,6,1,1,1,1,1,1,1)), codeset).lower() : 6,
|
||||
to_uni(time.strftime('%b',(1,6,1,1,1,1,1,1,1)), codeset).lower() : 6,
|
||||
to_uni(time.strftime('%B',(1,7,1,1,1,1,1,1,1)), codeset).lower() : 7,
|
||||
to_uni(time.strftime('%b',(1,7,1,1,1,1,1,1,1)), codeset).lower() : 7,
|
||||
to_uni(time.strftime('%B',(1,8,1,1,1,1,1,1,1)), codeset).lower() : 8,
|
||||
to_uni(time.strftime('%b',(1,8,1,1,1,1,1,1,1)), codeset).lower() : 8,
|
||||
to_uni(time.strftime('%B',(1,9,1,1,1,1,1,1,1)), codeset).lower() : 9,
|
||||
to_uni(time.strftime('%b',(1,9,1,1,1,1,1,1,1)), codeset).lower() : 9,
|
||||
to_uni(time.strftime('%B',(1,10,1,1,1,1,1,1,1)), codeset).lower() : 10,
|
||||
to_uni(time.strftime('%b',(1,10,1,1,1,1,1,1,1)), codeset).lower() : 10,
|
||||
to_uni(time.strftime('%B',(1,11,1,1,1,1,1,1,1)), codeset).lower() : 11,
|
||||
to_uni(time.strftime('%b',(1,11,1,1,1,1,1,1,1)), codeset).lower() : 11,
|
||||
to_uni(time.strftime('%B',(1,12,1,1,1,1,1,1,1)), codeset).lower() : 12,
|
||||
to_uni(time.strftime('%b',(1,12,1,1,1,1,1,1,1)), codeset).lower() : 12,
|
||||
}
|
||||
|
||||
long_months = (
|
||||
"",
|
||||
to_uni(time.strftime('%B',(0,1,1,1,1,1,1,1,1)), codeset),
|
||||
to_uni(time.strftime('%B',(0,2,1,1,1,1,1,1,1)), codeset),
|
||||
to_uni(time.strftime('%B',(0,3,1,1,1,1,1,1,1)), codeset),
|
||||
to_uni(time.strftime('%B',(0,4,1,1,1,1,1,1,1)), codeset),
|
||||
to_uni(time.strftime('%B',(0,5,1,1,1,1,1,1,1)), codeset),
|
||||
to_uni(time.strftime('%B',(0,6,1,1,1,1,1,1,1)), codeset),
|
||||
to_uni(time.strftime('%B',(0,7,1,1,1,1,1,1,1)), codeset),
|
||||
to_uni(time.strftime('%B',(0,8,1,1,1,1,1,1,1)), codeset),
|
||||
to_uni(time.strftime('%B',(0,9,1,1,1,1,1,1,1)), codeset),
|
||||
to_uni(time.strftime('%B',(0,10,1,1,1,1,1,1,1)), codeset),
|
||||
to_uni(time.strftime('%B',(0,11,1,1,1,1,1,1,1)), codeset),
|
||||
to_uni(time.strftime('%B',(0,12,1,1,1,1,1,1,1)), codeset),
|
||||
to_uni(time.strftime('%B',(1,1,1,1,1,1,1,1,1)), codeset),
|
||||
to_uni(time.strftime('%B',(1,2,1,1,1,1,1,1,1)), codeset),
|
||||
to_uni(time.strftime('%B',(1,3,1,1,1,1,1,1,1)), codeset),
|
||||
to_uni(time.strftime('%B',(1,4,1,1,1,1,1,1,1)), codeset),
|
||||
to_uni(time.strftime('%B',(1,5,1,1,1,1,1,1,1)), codeset),
|
||||
to_uni(time.strftime('%B',(1,6,1,1,1,1,1,1,1)), codeset),
|
||||
to_uni(time.strftime('%B',(1,7,1,1,1,1,1,1,1)), codeset),
|
||||
to_uni(time.strftime('%B',(1,8,1,1,1,1,1,1,1)), codeset),
|
||||
to_uni(time.strftime('%B',(1,9,1,1,1,1,1,1,1)), codeset),
|
||||
to_uni(time.strftime('%B',(1,10,1,1,1,1,1,1,1)), codeset),
|
||||
to_uni(time.strftime('%B',(1,11,1,1,1,1,1,1,1)), codeset),
|
||||
to_uni(time.strftime('%B',(1,12,1,1,1,1,1,1,1)), codeset),
|
||||
)
|
||||
|
||||
short_months = (
|
||||
"",
|
||||
to_uni(time.strftime('%b',(0,1,1,1,1,1,1,1,1)), codeset),
|
||||
to_uni(time.strftime('%b',(0,2,1,1,1,1,1,1,1)), codeset),
|
||||
to_uni(time.strftime('%b',(0,3,1,1,1,1,1,1,1)), codeset),
|
||||
to_uni(time.strftime('%b',(0,4,1,1,1,1,1,1,1)), codeset),
|
||||
to_uni(time.strftime('%b',(0,5,1,1,1,1,1,1,1)), codeset),
|
||||
to_uni(time.strftime('%b',(0,6,1,1,1,1,1,1,1)), codeset),
|
||||
to_uni(time.strftime('%b',(0,7,1,1,1,1,1,1,1)), codeset),
|
||||
to_uni(time.strftime('%b',(0,8,1,1,1,1,1,1,1)), codeset),
|
||||
to_uni(time.strftime('%b',(0,9,1,1,1,1,1,1,1)), codeset),
|
||||
to_uni(time.strftime('%b',(0,10,1,1,1,1,1,1,1)), codeset),
|
||||
to_uni(time.strftime('%b',(0,11,1,1,1,1,1,1,1)), codeset),
|
||||
to_uni(time.strftime('%b',(0,12,1,1,1,1,1,1,1)), codeset),
|
||||
to_uni(time.strftime('%b',(1,1,1,1,1,1,1,1,1)), codeset),
|
||||
to_uni(time.strftime('%b',(1,2,1,1,1,1,1,1,1)), codeset),
|
||||
to_uni(time.strftime('%b',(1,3,1,1,1,1,1,1,1)), codeset),
|
||||
to_uni(time.strftime('%b',(1,4,1,1,1,1,1,1,1)), codeset),
|
||||
to_uni(time.strftime('%b',(1,5,1,1,1,1,1,1,1)), codeset),
|
||||
to_uni(time.strftime('%b',(1,6,1,1,1,1,1,1,1)), codeset),
|
||||
to_uni(time.strftime('%b',(1,7,1,1,1,1,1,1,1)), codeset),
|
||||
to_uni(time.strftime('%b',(1,8,1,1,1,1,1,1,1)), codeset),
|
||||
to_uni(time.strftime('%b',(1,9,1,1,1,1,1,1,1)), codeset),
|
||||
to_uni(time.strftime('%b',(1,10,1,1,1,1,1,1,1)), codeset),
|
||||
to_uni(time.strftime('%b',(1,11,1,1,1,1,1,1,1)), codeset),
|
||||
to_uni(time.strftime('%b',(1,12,1,1,1,1,1,1,1)), codeset),
|
||||
)
|
||||
|
||||
# Gramps day number: Sunday => 1, Monday => 2, etc
|
||||
@@ -213,24 +211,24 @@ except:
|
||||
# just a dummy.
|
||||
long_days = (
|
||||
"",
|
||||
to_uni(time.strftime('%A',(0,1,1,1,1,1,6,1,1)), codeset), # Sunday
|
||||
to_uni(time.strftime('%A',(0,1,1,1,1,1,0,1,1)), codeset), # Monday
|
||||
to_uni(time.strftime('%A',(0,1,1,1,1,1,1,1,1)), codeset), # Tuesday
|
||||
to_uni(time.strftime('%A',(0,1,1,1,1,1,2,1,1)), codeset), # Wednesday
|
||||
to_uni(time.strftime('%A',(0,1,1,1,1,1,3,1,1)), codeset), # Thursday
|
||||
to_uni(time.strftime('%A',(0,1,1,1,1,1,4,1,1)), codeset), # Friday
|
||||
to_uni(time.strftime('%A',(0,1,1,1,1,1,5,1,1)), codeset), # Saturday
|
||||
to_uni(time.strftime('%A',(1,1,1,1,1,1,6,1,1)), codeset), # Sunday
|
||||
to_uni(time.strftime('%A',(1,1,1,1,1,1,0,1,1)), codeset), # Monday
|
||||
to_uni(time.strftime('%A',(1,1,1,1,1,1,1,1,1)), codeset), # Tuesday
|
||||
to_uni(time.strftime('%A',(1,1,1,1,1,1,2,1,1)), codeset), # Wednesday
|
||||
to_uni(time.strftime('%A',(1,1,1,1,1,1,3,1,1)), codeset), # Thursday
|
||||
to_uni(time.strftime('%A',(1,1,1,1,1,1,4,1,1)), codeset), # Friday
|
||||
to_uni(time.strftime('%A',(1,1,1,1,1,1,5,1,1)), codeset), # Saturday
|
||||
)
|
||||
|
||||
short_days = (
|
||||
"",
|
||||
to_uni(time.strftime('%a',(0,1,1,1,1,1,6,1,1)), codeset), # Sunday
|
||||
to_uni(time.strftime('%a',(0,1,1,1,1,1,0,1,1)), codeset), # Monday
|
||||
to_uni(time.strftime('%a',(0,1,1,1,1,1,1,1,1)), codeset), # Tuesday
|
||||
to_uni(time.strftime('%a',(0,1,1,1,1,1,2,1,1)), codeset), # Wednesday
|
||||
to_uni(time.strftime('%a',(0,1,1,1,1,1,3,1,1)), codeset), # Thursday
|
||||
to_uni(time.strftime('%a',(0,1,1,1,1,1,4,1,1)), codeset), # Friday
|
||||
to_uni(time.strftime('%a',(0,1,1,1,1,1,5,1,1)), codeset), # Saturday
|
||||
to_uni(time.strftime('%a',(1,1,1,1,1,1,6,1,1)), codeset), # Sunday
|
||||
to_uni(time.strftime('%a',(1,1,1,1,1,1,0,1,1)), codeset), # Monday
|
||||
to_uni(time.strftime('%a',(1,1,1,1,1,1,1,1,1)), codeset), # Tuesday
|
||||
to_uni(time.strftime('%a',(1,1,1,1,1,1,2,1,1)), codeset), # Wednesday
|
||||
to_uni(time.strftime('%a',(1,1,1,1,1,1,3,1,1)), codeset), # Thursday
|
||||
to_uni(time.strftime('%a',(1,1,1,1,1,1,4,1,1)), codeset), # Friday
|
||||
to_uni(time.strftime('%a',(1,1,1,1,1,1,5,1,1)), codeset), # Saturday
|
||||
)
|
||||
|
||||
# depending on the locale, the value returned for 20th Feb 2009 could be
|
||||
|
@@ -32,7 +32,8 @@ from this class.
|
||||
# Python libraries
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ..ggettext import gettext as _
|
||||
from ..const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -198,8 +198,8 @@ if __name__ == "__main__":
|
||||
x = db.DBEnv()
|
||||
print("3")
|
||||
x.open('/tmp', db.DB_CREATE | db.DB_PRIVATE |\
|
||||
db.DB_INIT_MPOOL | db.DB_INIT_LOCK |\
|
||||
db.DB_INIT_LOG | db.DB_INIT_TXN | db.DB_THREAD)
|
||||
db.DB_INIT_MPOOL |\
|
||||
db.DB_INIT_LOG | db.DB_INIT_TXN)
|
||||
print("4")
|
||||
d = dbshelve.DBShelf(x)
|
||||
print("5")
|
||||
|
@@ -27,7 +27,8 @@
|
||||
# Standard python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ..ggettext import gettext as _
|
||||
from ..const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
|
||||
class DbException(Exception):
|
||||
|
@@ -40,7 +40,6 @@ else:
|
||||
import pickle
|
||||
import time
|
||||
import random
|
||||
import locale
|
||||
import os
|
||||
from sys import maxsize
|
||||
|
||||
@@ -49,7 +48,8 @@ if config.get('preferences.use-bsddb3') or sys.version_info[0] >= 3:
|
||||
from bsddb3 import db
|
||||
else:
|
||||
from bsddb import db
|
||||
from ..ggettext import gettext as _
|
||||
from ..const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
import re
|
||||
|
||||
import logging
|
||||
@@ -80,6 +80,7 @@ from . import (BsddbBaseCursor, DbReadBase)
|
||||
from ..utils.id import create_id
|
||||
from ..errors import DbError
|
||||
from ..constfunc import UNITYPE, STRTYPE, cuni
|
||||
from ..const import GRAMPS_LOCALE as glocale
|
||||
|
||||
LOG = logging.getLogger(DBLOGNAME)
|
||||
LOG = logging.getLogger(".citation")
|
||||
@@ -1641,7 +1642,7 @@ class DbBsddbRead(DbReadBase, Callback):
|
||||
def __sortbyperson_key(self, handle):
|
||||
if isinstance(handle, UNITYPE):
|
||||
handle = handle.encode('utf-8')
|
||||
return locale.strxfrm(find_surname(handle,
|
||||
return glocale.sort_key(find_surname(handle,
|
||||
self.person_map.get(handle)))
|
||||
|
||||
def __sortbyplace(self, first, second):
|
||||
@@ -1649,13 +1650,13 @@ class DbBsddbRead(DbReadBase, Callback):
|
||||
first = first.encode('utf-8')
|
||||
if isinstance(second, UNITYPE):
|
||||
second = second.encode('utf-8')
|
||||
return locale.strcoll(self.place_map.get(first)[2],
|
||||
return glocale.strcoll(self.place_map.get(first)[2],
|
||||
self.place_map.get(second)[2])
|
||||
|
||||
def __sortbyplace_key(self, place):
|
||||
if isinstance(place, UNITYPE):
|
||||
place = place.encode('utf-8')
|
||||
return locale.strxfrm(self.place_map.get(place)[2])
|
||||
return glocale.sort_key(self.place_map.get(place)[2])
|
||||
|
||||
def __sortbysource(self, first, second):
|
||||
if isinstance(first, UNITYPE):
|
||||
@@ -1664,13 +1665,13 @@ class DbBsddbRead(DbReadBase, Callback):
|
||||
second = second.encode('utf-8')
|
||||
source1 = cuni(self.source_map[first][2])
|
||||
source2 = cuni(self.source_map[second][2])
|
||||
return locale.strcoll(source1, source2)
|
||||
return glocale.strcoll(source1, source2)
|
||||
|
||||
def __sortbysource_key(self, key):
|
||||
if isinstance(key, UNITYPE):
|
||||
key = key.encode('utf-8')
|
||||
source = cuni(self.source_map[key][2])
|
||||
return locale.strxfrm(source)
|
||||
return glocale.sort_key(source)
|
||||
|
||||
def __sortbycitation(self, first, second):
|
||||
if isinstance(first, UNITYPE):
|
||||
@@ -1679,13 +1680,13 @@ class DbBsddbRead(DbReadBase, Callback):
|
||||
second = second.encode('utf-8')
|
||||
citation1 = cuni(self.citation_map[first][3])
|
||||
citation2 = cuni(self.citation_map[second][3])
|
||||
return locale.strcoll(citation1, citation2)
|
||||
return glocale.strcoll(citation1, citation2)
|
||||
|
||||
def __sortbycitation_key(self, key):
|
||||
if isinstance(key, UNITYPE):
|
||||
key = key.encode('utf-8')
|
||||
citation = cuni(self.citation_map[key][3])
|
||||
return locale.strxfrm(citation)
|
||||
return glocale.sort_key(citation)
|
||||
|
||||
def __sortbymedia(self, first, second):
|
||||
if isinstance(first, UNITYPE):
|
||||
@@ -1694,13 +1695,13 @@ class DbBsddbRead(DbReadBase, Callback):
|
||||
second = second.encode('utf-8')
|
||||
media1 = self.media_map[first][4]
|
||||
media2 = self.media_map[second][4]
|
||||
return locale.strcoll(media1, media2)
|
||||
return glocale.strcoll(media1, media2)
|
||||
|
||||
def __sortbymedia_key(self, key):
|
||||
if isinstance(key, UNITYPE):
|
||||
key = key.encode('utf-8')
|
||||
media = self.media_map[key][4]
|
||||
return locale.strxfrm(media)
|
||||
return glocale.sort_key(media)
|
||||
|
||||
def __sortbytag(self, first, second):
|
||||
if isinstance(first, UNITYPE):
|
||||
@@ -1709,13 +1710,13 @@ class DbBsddbRead(DbReadBase, Callback):
|
||||
second = second.encode('utf-8')
|
||||
tag1 = self.tag_map[first][1]
|
||||
tag2 = self.tag_map[second][1]
|
||||
return locale.strcoll(tag1, tag2)
|
||||
return glocale.strcoll(tag1, tag2)
|
||||
|
||||
def __sortbytag_key(self, key):
|
||||
if isinstance(key, UNITYPE):
|
||||
key = key.encode('utf-8')
|
||||
tag = self.tag_map[key][1]
|
||||
return locale.strxfrm(tag)
|
||||
return glocale.sort_key(tag)
|
||||
|
||||
def set_mediapath(self, path):
|
||||
"""Set the default media path for database, path should be utf-8."""
|
||||
|
@@ -46,7 +46,8 @@ if config.get('preferences.use-bsddb3') or sys.version_info[0] >= 3:
|
||||
from bsddb3 import db
|
||||
else:
|
||||
from bsddb import db
|
||||
from ..ggettext import gettext as _
|
||||
from ..const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -30,8 +30,9 @@ import time
|
||||
import logging
|
||||
LOG = logging.getLogger(".citation")
|
||||
|
||||
from ..ggettext import gettext as _
|
||||
from ..constfunc import cuni, UNITYPE
|
||||
from ..const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
from ..constfunc import cuni
|
||||
|
||||
"""
|
||||
methods to upgrade a database from version 13 to current version
|
||||
|
@@ -40,13 +40,11 @@ else:
|
||||
import pickle
|
||||
import os
|
||||
import time
|
||||
import locale
|
||||
import bisect
|
||||
from functools import wraps
|
||||
import logging
|
||||
from sys import maxsize
|
||||
|
||||
from ..ggettext import gettext as _
|
||||
from ..config import config
|
||||
if config.get('preferences.use-bsddb3') or sys.version_info[0] >= 3:
|
||||
from bsddb3 import dbshelve, db
|
||||
@@ -77,10 +75,12 @@ from . import (DbBsddbRead, DbWriteBase, BSDDBTxn,
|
||||
find_byte_surname, find_surname_name, DbUndoBSDDB as DbUndo)
|
||||
from .dbconst import *
|
||||
from ..utils.callback import Callback
|
||||
from ..utils.cast import (conv_unicode_tosrtkey, conv_dbstr_to_unicode)
|
||||
from ..utils.cast import conv_dbstr_to_unicode
|
||||
from ..updatecallback import UpdateCallback
|
||||
from ..errors import DbError
|
||||
from ..constfunc import win, conv_to_unicode, cuni, UNITYPE, handle2internal
|
||||
from ..const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
_LOG = logging.getLogger(DBLOGNAME)
|
||||
LOG = logging.getLogger(".citation")
|
||||
@@ -495,8 +495,8 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
|
||||
|
||||
# The DB_PRIVATE flag must go if we ever move to multi-user setup
|
||||
env_flags = db.DB_CREATE | db.DB_PRIVATE |\
|
||||
db.DB_INIT_MPOOL | db.DB_INIT_LOCK |\
|
||||
db.DB_INIT_LOG | db.DB_INIT_TXN | db.DB_THREAD
|
||||
db.DB_INIT_MPOOL |\
|
||||
db.DB_INIT_LOG | db.DB_INIT_TXN
|
||||
|
||||
# As opposed to before, we always try recovery on databases
|
||||
env_flags |= db.DB_RECOVER
|
||||
@@ -1135,11 +1135,6 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
|
||||
self.transaction_abort(self.transaction)
|
||||
self.env.txn_checkpoint()
|
||||
|
||||
lockstats = self.env.lock_stat()
|
||||
_LOG.debug("lock occupancy: %d%%, locked object occupancy: %d%%" % (
|
||||
round(lockstats['maxnlocks']*100/lockstats['maxlocks']),
|
||||
round(lockstats['maxnobjects']*100/lockstats['maxobjects'])))
|
||||
|
||||
self.__close_metadata()
|
||||
self.name_group.close()
|
||||
self.surnames.close()
|
||||
@@ -1498,7 +1493,7 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
|
||||
self.emit('person-groupname-rebuild', (name, grouppar))
|
||||
|
||||
def sort_surname_list(self):
|
||||
self.surname_list.sort(key=conv_unicode_tosrtkey)
|
||||
self.surname_list.sort(key=glocale.sort_key)
|
||||
|
||||
@catch_db_error
|
||||
def build_surname_list(self):
|
||||
@@ -1510,7 +1505,7 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
|
||||
#TODO GTK3: Why double conversion? Convert to a list of str objects!
|
||||
self.surname_list = sorted(
|
||||
map(conv_dbstr_to_unicode, set(self.surnames.keys())),
|
||||
key=conv_unicode_tosrtkey)
|
||||
key=glocale.sort_key)
|
||||
|
||||
def add_to_surname_list(self, person, batch_transaction):
|
||||
"""
|
||||
@@ -2055,8 +2050,8 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
|
||||
|
||||
# The DB_PRIVATE flag must go if we ever move to multi-user setup
|
||||
env_flags = db.DB_CREATE | db.DB_PRIVATE |\
|
||||
db.DB_INIT_MPOOL | db.DB_INIT_LOCK |\
|
||||
db.DB_INIT_LOG | db.DB_INIT_TXN | db.DB_THREAD
|
||||
db.DB_INIT_MPOOL |\
|
||||
db.DB_INIT_LOG | db.DB_INIT_TXN
|
||||
|
||||
# As opposed to before, we always try recovery on databases
|
||||
env_flags |= db.DB_RECOVER
|
||||
|
@@ -53,8 +53,8 @@ Specific symbols for parts of a name are defined:
|
||||
# Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ..ggettext import sgettext as _
|
||||
import sys
|
||||
from ..const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().sgettext
|
||||
import re
|
||||
import logging
|
||||
LOG = logging.getLogger(".gramps.gen")
|
||||
|
@@ -40,6 +40,7 @@ import collections
|
||||
from ._filterparser import FilterParser
|
||||
from ..plug import BasePluginManager
|
||||
from ..constfunc import STRTYPE
|
||||
from ..const import GRAMPS_LOCALE as glocale
|
||||
|
||||
PLUGMAN = BasePluginManager.get_instance()
|
||||
#-------------------------------------------------------------------------
|
||||
@@ -124,7 +125,7 @@ class FilterList(object):
|
||||
return l.replace('"', '"')
|
||||
|
||||
def save(self):
|
||||
f = open(self.file.encode(sys.getfilesystemencoding()), 'w')
|
||||
f = open(self.file.encode(glocale.getfilesystemencoding()), 'w')
|
||||
f.write("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n")
|
||||
f.write('<filters>\n')
|
||||
for namespace in self.filter_namespaces:
|
||||
|
@@ -28,7 +28,8 @@
|
||||
from __future__ import print_function, unicode_literals
|
||||
|
||||
from xml.sax import handler
|
||||
from ..ggettext import gettext as _
|
||||
from ..const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -26,7 +26,8 @@
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ...ggettext import gettext as _
|
||||
from ...const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
import re
|
||||
import time
|
||||
|
||||
|
@@ -25,7 +25,8 @@
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ...ggettext import gettext as _
|
||||
from ...const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -25,7 +25,8 @@
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ...ggettext import gettext as _
|
||||
from ...const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -26,7 +26,8 @@
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ...ggettext import gettext as _
|
||||
from ...const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -25,7 +25,8 @@
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ...ggettext import gettext as _
|
||||
from ...const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -28,7 +28,8 @@
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ...ggettext import gettext as _
|
||||
from ...const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -26,7 +26,8 @@
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ...ggettext import gettext as _
|
||||
from ...const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -28,7 +28,8 @@
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ...ggettext import gettext as _
|
||||
from ...const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -29,7 +29,8 @@
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ...ggettext import gettext as _
|
||||
from ...const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -26,7 +26,8 @@
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
import re
|
||||
from ...ggettext import gettext as _
|
||||
from ...const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -25,7 +25,8 @@
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ...ggettext import gettext as _
|
||||
from ...const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -25,7 +25,8 @@
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ...ggettext import gettext as _
|
||||
from ...const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -26,7 +26,8 @@
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ...ggettext import gettext as _
|
||||
from ...const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -28,7 +28,8 @@
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ...ggettext import gettext as _
|
||||
from ...const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -26,7 +26,8 @@
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ...ggettext import gettext as _
|
||||
from ...const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -27,7 +27,8 @@ Rule that checks for an object with a particular tag.
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ...ggettext import gettext as _
|
||||
from ...const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -25,7 +25,8 @@
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ...ggettext import gettext as _
|
||||
from ...const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -23,7 +23,8 @@
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ...ggettext import gettext as _
|
||||
from ...const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -26,7 +26,8 @@
|
||||
# GRAMPS modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from gramps.gen.ggettext import gettext as _
|
||||
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
from . import Rule
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
|
@@ -25,7 +25,8 @@
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ...ggettext import gettext as _
|
||||
from ...const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -25,7 +25,6 @@
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ...ggettext import gettext as _
|
||||
import logging
|
||||
LOG = logging.getLogger(".filter")
|
||||
|
||||
@@ -36,6 +35,8 @@ LOG = logging.getLogger(".filter")
|
||||
#-------------------------------------------------------------------------
|
||||
# we need global variableCustomFilters, so we need to query gramps.gen.filters
|
||||
# when we need this variable, not import it at the start!
|
||||
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
import gramps.gen.filters
|
||||
from . import Rule
|
||||
|
||||
|
@@ -29,7 +29,8 @@
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ...ggettext import gettext as _
|
||||
from ...const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -26,7 +26,8 @@
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ...ggettext import gettext as _
|
||||
from ...const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -26,7 +26,8 @@
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
import re
|
||||
from ...ggettext import gettext as _
|
||||
from ...const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -30,7 +30,8 @@ Base class for filter rules.
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ...ggettext import gettext as _
|
||||
from ...const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
import re
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
|
@@ -26,7 +26,8 @@
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ....ggettext import gettext as _
|
||||
from ....const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -26,7 +26,8 @@
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ....ggettext import gettext as _
|
||||
from ....const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -26,7 +26,8 @@
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ....ggettext import gettext as _
|
||||
from ....const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -28,7 +28,8 @@ Filter rule to match citation data.
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ....ggettext import gettext as _
|
||||
from ....const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -28,7 +28,8 @@
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ....ggettext import gettext as _
|
||||
from ....const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -26,7 +26,8 @@
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ....ggettext import gettext as _
|
||||
from ....const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -29,7 +29,8 @@
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ....ggettext import gettext as _
|
||||
from ....const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -26,7 +26,8 @@
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ....ggettext import gettext as _
|
||||
from ....const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -26,7 +26,8 @@
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ....ggettext import gettext as _
|
||||
from ....const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -26,7 +26,8 @@
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ....ggettext import gettext as _
|
||||
from ....const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -29,7 +29,8 @@ Filter rule to match citation with a particular source.
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ....ggettext import gettext as _
|
||||
from ....const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -26,7 +26,8 @@
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ....ggettext import gettext as _
|
||||
from ....const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -25,7 +25,8 @@
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ....ggettext import gettext as _
|
||||
from ....const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -28,7 +28,8 @@
|
||||
#-------------------------------------------------------------------------
|
||||
import logging
|
||||
LOG = logging.getLogger(".citation")
|
||||
from ....ggettext import gettext as _
|
||||
from ....const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -27,7 +27,8 @@
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ....ggettext import gettext as _
|
||||
from ....const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -26,7 +26,8 @@
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ....ggettext import gettext as _
|
||||
from ....const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -25,7 +25,8 @@
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ....ggettext import gettext as _
|
||||
from ....const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -26,7 +26,8 @@
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ....ggettext import gettext as _
|
||||
from ....const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -25,7 +25,8 @@
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ....ggettext import gettext as _
|
||||
from ....const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -25,7 +25,8 @@
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ....ggettext import gettext as _
|
||||
from ....const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -29,7 +29,8 @@ Filter rule to match event with a particular citation.
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ....ggettext import gettext as _
|
||||
from ....const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -25,7 +25,8 @@
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ....ggettext import gettext as _
|
||||
from ....const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -28,7 +28,8 @@
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ....ggettext import gettext as _
|
||||
from ....const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -25,7 +25,8 @@
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ....ggettext import gettext as _
|
||||
from ....const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -28,7 +28,8 @@
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ....ggettext import gettext as _
|
||||
from ....const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -25,7 +25,8 @@
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ....ggettext import gettext as _
|
||||
from ....const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -25,7 +25,8 @@
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ....ggettext import gettext as _
|
||||
from ....const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -25,7 +25,8 @@
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ....ggettext import gettext as _
|
||||
from ....const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -27,7 +27,8 @@
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ....ggettext import gettext as _
|
||||
from ....const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -25,7 +25,8 @@
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ....ggettext import gettext as _
|
||||
from ....const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -25,7 +25,8 @@
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ....ggettext import gettext as _
|
||||
from ....const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -25,7 +25,8 @@
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ....ggettext import gettext as _
|
||||
from ....const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -26,7 +26,8 @@
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ....ggettext import sgettext as _
|
||||
from ....const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().sgettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -27,7 +27,8 @@
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ....ggettext import gettext as _
|
||||
from ....const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -25,7 +25,8 @@
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ....ggettext import gettext as _
|
||||
from ....const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -25,7 +25,8 @@
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ....ggettext import gettext as _
|
||||
from ....const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -26,7 +26,8 @@
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ....ggettext import gettext as _
|
||||
from ....const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -25,7 +25,8 @@
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ....ggettext import gettext as _
|
||||
from ....const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -25,7 +25,8 @@
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ....ggettext import gettext as _
|
||||
from ....const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -25,7 +25,8 @@
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ....ggettext import gettext as _
|
||||
from ....const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -25,7 +25,8 @@
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ....ggettext import gettext as _
|
||||
from ....const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -25,7 +25,8 @@
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ....ggettext import gettext as _
|
||||
from ....const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -25,7 +25,8 @@
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ....ggettext import gettext as _
|
||||
from ....const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -29,7 +29,8 @@ Filter rule to match family with a particular citation.
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ....ggettext import gettext as _
|
||||
from ....const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -28,7 +28,8 @@ Filter rule to match families with a particular event.
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ....ggettext import gettext as _
|
||||
from ....const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -28,7 +28,8 @@
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ....ggettext import gettext as _
|
||||
from ....const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -25,7 +25,8 @@
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ....ggettext import gettext as _
|
||||
from ....const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -28,7 +28,8 @@
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ....ggettext import gettext as _
|
||||
from ....const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -28,7 +28,8 @@
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ....ggettext import gettext as _
|
||||
from ....const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -25,7 +25,8 @@
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ....ggettext import gettext as _
|
||||
from ....const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -25,7 +25,8 @@
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ....ggettext import gettext as _
|
||||
from ....const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@@ -25,7 +25,8 @@
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ....ggettext import gettext as _
|
||||
from ....const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.get_translation().gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user