diff --git a/gramps/plugins/webstuff/css/GeoView.css b/data/css/GeoView.css
similarity index 100%
rename from gramps/plugins/webstuff/css/GeoView.css
rename to data/css/GeoView.css
diff --git a/gramps/plugins/webstuff/css/Web_Basic-Ash.css b/data/css/Web_Basic-Ash.css
similarity index 100%
rename from gramps/plugins/webstuff/css/Web_Basic-Ash.css
rename to data/css/Web_Basic-Ash.css
diff --git a/gramps/plugins/webstuff/css/Web_Basic-Blue.css b/data/css/Web_Basic-Blue.css
similarity index 100%
rename from gramps/plugins/webstuff/css/Web_Basic-Blue.css
rename to data/css/Web_Basic-Blue.css
diff --git a/gramps/plugins/webstuff/css/Web_Basic-Cypress.css b/data/css/Web_Basic-Cypress.css
similarity index 100%
rename from gramps/plugins/webstuff/css/Web_Basic-Cypress.css
rename to data/css/Web_Basic-Cypress.css
diff --git a/gramps/plugins/webstuff/css/Web_Basic-Lilac.css b/data/css/Web_Basic-Lilac.css
similarity index 100%
rename from gramps/plugins/webstuff/css/Web_Basic-Lilac.css
rename to data/css/Web_Basic-Lilac.css
diff --git a/gramps/plugins/webstuff/css/Web_Basic-Peach.css b/data/css/Web_Basic-Peach.css
similarity index 100%
rename from gramps/plugins/webstuff/css/Web_Basic-Peach.css
rename to data/css/Web_Basic-Peach.css
diff --git a/gramps/plugins/webstuff/css/Web_Basic-Spruce.css b/data/css/Web_Basic-Spruce.css
similarity index 100%
rename from gramps/plugins/webstuff/css/Web_Basic-Spruce.css
rename to data/css/Web_Basic-Spruce.css
diff --git a/gramps/plugins/webstuff/css/Web_Citations-Animated.css b/data/css/Web_Citations-Animated.css
similarity index 100%
rename from gramps/plugins/webstuff/css/Web_Citations-Animated.css
rename to data/css/Web_Citations-Animated.css
diff --git a/gramps/plugins/webstuff/css/Web_Citations-Outline.css b/data/css/Web_Citations-Outline.css
similarity index 100%
rename from gramps/plugins/webstuff/css/Web_Citations-Outline.css
rename to data/css/Web_Citations-Outline.css
diff --git a/gramps/plugins/webstuff/css/Web_DropDown-Menus.css b/data/css/Web_DropDown-Menus.css
similarity index 100%
rename from gramps/plugins/webstuff/css/Web_DropDown-Menus.css
rename to data/css/Web_DropDown-Menus.css
diff --git a/gramps/plugins/webstuff/css/Web_Fade-Menus.css b/data/css/Web_Fade-Menus.css
similarity index 100%
rename from gramps/plugins/webstuff/css/Web_Fade-Menus.css
rename to data/css/Web_Fade-Menus.css
diff --git a/gramps/plugins/webstuff/css/Web_Horizontal-Menus.css b/data/css/Web_Horizontal-Menus.css
similarity index 100%
rename from gramps/plugins/webstuff/css/Web_Horizontal-Menus.css
rename to data/css/Web_Horizontal-Menus.css
diff --git a/gramps/plugins/webstuff/css/Web_Mainz.css b/data/css/Web_Mainz.css
similarity index 100%
rename from gramps/plugins/webstuff/css/Web_Mainz.css
rename to data/css/Web_Mainz.css
diff --git a/gramps/plugins/webstuff/css/Web_Nebraska.css b/data/css/Web_Nebraska.css
similarity index 100%
rename from gramps/plugins/webstuff/css/Web_Nebraska.css
rename to data/css/Web_Nebraska.css
diff --git a/gramps/plugins/webstuff/css/Web_Print-Default.css b/data/css/Web_Print-Default.css
similarity index 100%
rename from gramps/plugins/webstuff/css/Web_Print-Default.css
rename to data/css/Web_Print-Default.css
diff --git a/gramps/plugins/webstuff/css/Web_Vertical-Menus.css b/data/css/Web_Vertical-Menus.css
similarity index 100%
rename from gramps/plugins/webstuff/css/Web_Vertical-Menus.css
rename to data/css/Web_Vertical-Menus.css
diff --git a/gramps/plugins/webstuff/css/Web_Visually.css b/data/css/Web_Visually.css
similarity index 100%
rename from gramps/plugins/webstuff/css/Web_Visually.css
rename to data/css/Web_Visually.css
diff --git a/gramps/plugins/webstuff/css/ancestortree.css b/data/css/ancestortree.css
similarity index 100%
rename from gramps/plugins/webstuff/css/ancestortree.css
rename to data/css/ancestortree.css
diff --git a/gramps/plugins/webstuff/css/behaviour.css b/data/css/behaviour.css
similarity index 100%
rename from gramps/plugins/webstuff/css/behaviour.css
rename to data/css/behaviour.css
diff --git a/gramps/plugins/webstuff/css/jquery.flexbox.css b/data/css/jquery.flexbox.css
similarity index 100%
rename from gramps/plugins/webstuff/css/jquery.flexbox.css
rename to data/css/jquery.flexbox.css
diff --git a/gramps/plugins/webstuff/css/narrative-maps.css b/data/css/narrative-maps.css
similarity index 100%
rename from gramps/plugins/webstuff/css/narrative-maps.css
rename to data/css/narrative-maps.css
diff --git a/gramps/plugins/webstuff/css/swanky-purse/images/ui-bg_diamond_10_4f4221_10x8.png b/data/css/swanky-purse/images/ui-bg_diamond_10_4f4221_10x8.png
similarity index 100%
rename from gramps/plugins/webstuff/css/swanky-purse/images/ui-bg_diamond_10_4f4221_10x8.png
rename to data/css/swanky-purse/images/ui-bg_diamond_10_4f4221_10x8.png
diff --git a/gramps/plugins/webstuff/css/swanky-purse/images/ui-bg_diamond_20_372806_10x8.png b/data/css/swanky-purse/images/ui-bg_diamond_20_372806_10x8.png
similarity index 100%
rename from gramps/plugins/webstuff/css/swanky-purse/images/ui-bg_diamond_20_372806_10x8.png
rename to data/css/swanky-purse/images/ui-bg_diamond_20_372806_10x8.png
diff --git a/gramps/plugins/webstuff/css/swanky-purse/images/ui-bg_diamond_25_675423_10x8.png b/data/css/swanky-purse/images/ui-bg_diamond_25_675423_10x8.png
similarity index 100%
rename from gramps/plugins/webstuff/css/swanky-purse/images/ui-bg_diamond_25_675423_10x8.png
rename to data/css/swanky-purse/images/ui-bg_diamond_25_675423_10x8.png
diff --git a/gramps/plugins/webstuff/css/swanky-purse/images/ui-bg_diamond_25_d5ac5d_10x8.png b/data/css/swanky-purse/images/ui-bg_diamond_25_d5ac5d_10x8.png
similarity index 100%
rename from gramps/plugins/webstuff/css/swanky-purse/images/ui-bg_diamond_25_d5ac5d_10x8.png
rename to data/css/swanky-purse/images/ui-bg_diamond_25_d5ac5d_10x8.png
diff --git a/gramps/plugins/webstuff/css/swanky-purse/images/ui-bg_diamond_8_261803_10x8.png b/data/css/swanky-purse/images/ui-bg_diamond_8_261803_10x8.png
similarity index 100%
rename from gramps/plugins/webstuff/css/swanky-purse/images/ui-bg_diamond_8_261803_10x8.png
rename to data/css/swanky-purse/images/ui-bg_diamond_8_261803_10x8.png
diff --git a/gramps/plugins/webstuff/css/swanky-purse/images/ui-bg_diamond_8_443113_10x8.png b/data/css/swanky-purse/images/ui-bg_diamond_8_443113_10x8.png
similarity index 100%
rename from gramps/plugins/webstuff/css/swanky-purse/images/ui-bg_diamond_8_443113_10x8.png
rename to data/css/swanky-purse/images/ui-bg_diamond_8_443113_10x8.png
diff --git a/gramps/plugins/webstuff/css/swanky-purse/images/ui-bg_flat_75_ddd4b0_40x100.png b/data/css/swanky-purse/images/ui-bg_flat_75_ddd4b0_40x100.png
similarity index 100%
rename from gramps/plugins/webstuff/css/swanky-purse/images/ui-bg_flat_75_ddd4b0_40x100.png
rename to data/css/swanky-purse/images/ui-bg_flat_75_ddd4b0_40x100.png
diff --git a/gramps/plugins/webstuff/css/swanky-purse/images/ui-bg_highlight-hard_65_fee4bd_1x100.png b/data/css/swanky-purse/images/ui-bg_highlight-hard_65_fee4bd_1x100.png
similarity index 100%
rename from gramps/plugins/webstuff/css/swanky-purse/images/ui-bg_highlight-hard_65_fee4bd_1x100.png
rename to data/css/swanky-purse/images/ui-bg_highlight-hard_65_fee4bd_1x100.png
diff --git a/gramps/plugins/webstuff/css/swanky-purse/images/ui-icons_070603_256x240.png b/data/css/swanky-purse/images/ui-icons_070603_256x240.png
similarity index 100%
rename from gramps/plugins/webstuff/css/swanky-purse/images/ui-icons_070603_256x240.png
rename to data/css/swanky-purse/images/ui-icons_070603_256x240.png
diff --git a/gramps/plugins/webstuff/css/swanky-purse/images/ui-icons_e8e2b5_256x240.png b/data/css/swanky-purse/images/ui-icons_e8e2b5_256x240.png
similarity index 100%
rename from gramps/plugins/webstuff/css/swanky-purse/images/ui-icons_e8e2b5_256x240.png
rename to data/css/swanky-purse/images/ui-icons_e8e2b5_256x240.png
diff --git a/gramps/plugins/webstuff/css/swanky-purse/images/ui-icons_e9cd86_256x240.png b/data/css/swanky-purse/images/ui-icons_e9cd86_256x240.png
similarity index 100%
rename from gramps/plugins/webstuff/css/swanky-purse/images/ui-icons_e9cd86_256x240.png
rename to data/css/swanky-purse/images/ui-icons_e9cd86_256x240.png
diff --git a/gramps/plugins/webstuff/css/swanky-purse/images/ui-icons_efec9f_256x240.png b/data/css/swanky-purse/images/ui-icons_efec9f_256x240.png
similarity index 100%
rename from gramps/plugins/webstuff/css/swanky-purse/images/ui-icons_efec9f_256x240.png
rename to data/css/swanky-purse/images/ui-icons_efec9f_256x240.png
diff --git a/gramps/plugins/webstuff/css/swanky-purse/images/ui-icons_f2ec64_256x240.png b/data/css/swanky-purse/images/ui-icons_f2ec64_256x240.png
similarity index 100%
rename from gramps/plugins/webstuff/css/swanky-purse/images/ui-icons_f2ec64_256x240.png
rename to data/css/swanky-purse/images/ui-icons_f2ec64_256x240.png
diff --git a/gramps/plugins/webstuff/css/swanky-purse/images/ui-icons_f9f2bd_256x240.png b/data/css/swanky-purse/images/ui-icons_f9f2bd_256x240.png
similarity index 100%
rename from gramps/plugins/webstuff/css/swanky-purse/images/ui-icons_f9f2bd_256x240.png
rename to data/css/swanky-purse/images/ui-icons_f9f2bd_256x240.png
diff --git a/gramps/plugins/webstuff/css/swanky-purse/images/ui-icons_ff7519_256x240.png b/data/css/swanky-purse/images/ui-icons_ff7519_256x240.png
similarity index 100%
rename from gramps/plugins/webstuff/css/swanky-purse/images/ui-icons_ff7519_256x240.png
rename to data/css/swanky-purse/images/ui-icons_ff7519_256x240.png
diff --git a/gramps/plugins/webstuff/css/swanky-purse/jquery-ui-1.7.2.custom.css b/data/css/swanky-purse/jquery-ui-1.7.2.custom.css
similarity index 100%
rename from gramps/plugins/webstuff/css/swanky-purse/jquery-ui-1.7.2.custom.css
rename to data/css/swanky-purse/jquery-ui-1.7.2.custom.css
diff --git a/gramps/plugins/webstuff/css/swanky-purse/jquery-ui-1.7.3.custom.css b/data/css/swanky-purse/jquery-ui-1.7.3.custom.css
similarity index 100%
rename from gramps/plugins/webstuff/css/swanky-purse/jquery-ui-1.7.3.custom.css
rename to data/css/swanky-purse/jquery-ui-1.7.3.custom.css
diff --git a/gramps/plugins/webstuff/javascript/jquery-1.3.2.min.js b/data/javascript/jquery-1.3.2.min.js
similarity index 100%
rename from gramps/plugins/webstuff/javascript/jquery-1.3.2.min.js
rename to data/javascript/jquery-1.3.2.min.js
diff --git a/gramps/plugins/webstuff/javascript/jquery-1.7.1.js b/data/javascript/jquery-1.7.1.js
similarity index 100%
rename from gramps/plugins/webstuff/javascript/jquery-1.7.1.js
rename to data/javascript/jquery-1.7.1.js
diff --git a/gramps/plugins/webstuff/javascript/jquery-1.7.1.min.js b/data/javascript/jquery-1.7.1.min.js
similarity index 100%
rename from gramps/plugins/webstuff/javascript/jquery-1.7.1.min.js
rename to data/javascript/jquery-1.7.1.min.js
diff --git a/gramps/plugins/webstuff/javascript/jquery-ui-1.7.2.custom.min.js b/data/javascript/jquery-ui-1.7.2.custom.min.js
similarity index 100%
rename from gramps/plugins/webstuff/javascript/jquery-ui-1.7.2.custom.min.js
rename to data/javascript/jquery-ui-1.7.2.custom.min.js
diff --git a/gramps/plugins/webstuff/javascript/jquery.flexbox.js b/data/javascript/jquery.flexbox.js
similarity index 100%
rename from gramps/plugins/webstuff/javascript/jquery.flexbox.js
rename to data/javascript/jquery.flexbox.js
diff --git a/gramps/plugins/webstuff/javascript/jquery.flexbox.min.js b/data/javascript/jquery.flexbox.min.js
similarity index 100%
rename from gramps/plugins/webstuff/javascript/jquery.flexbox.min.js
rename to data/javascript/jquery.flexbox.min.js
diff --git a/gramps/cli/arghandler.py b/gramps/cli/arghandler.py
index 0ceb74e77..eac93953a 100644
--- a/gramps/cli/arghandler.py
+++ b/gramps/cli/arghandler.py
@@ -8,7 +8,7 @@
# Copyright (C) 2008 Brian G. Matherly
# Copyright (C) 2010 Jakim Friant
# Copyright (C) 2012 Doug Blank
-# Copyright (C) 2012 Paul Franklin
+# Copyright (C) 2012-2013 Paul Franklin
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -286,23 +286,20 @@ class ArgHandler(object):
self.__error(_("WARNING: Output file already exists!\n"
"WARNING: It will be overwritten:\n %s") %
fullpath)
- answer = None
- while not answer:
- try:
- if sys.version_info[0] < 3:
- ask = raw_input
- else:
- ask = input
- ans = ask(_('OK to overwrite? (yes/no) '))
- except EOFError:
- print()
- sys.exit(0)
- if ans.upper() in ('Y', 'YES', _('YES').upper()):
- self.__error(_("Will overwrite the existing file: %s")
- % fullpath)
- answer = "ok"
+ try:
+ if sys.version_info[0] < 3:
+ ask = raw_input
else:
- sys.exit(0)
+ ask = input
+ answer = ask(_('OK to overwrite? (yes/no) '))
+ except EOFError:
+ print()
+ sys.exit(0)
+ if answer.upper() in ('Y', 'YES', _('YES').upper()):
+ self.__error(_("Will overwrite the existing file: %s")
+ % fullpath)
+ else:
+ sys.exit(0)
if family_tree_format is None:
# Guess the file format based on the file extension.
diff --git a/gramps/cli/plug/__init__.py b/gramps/cli/plug/__init__.py
index 979eaa675..c9aef488b 100644
--- a/gramps/cli/plug/__init__.py
+++ b/gramps/cli/plug/__init__.py
@@ -422,7 +422,7 @@ class CommandLineReport(object):
self.options_help[name].append(option.get_help())
else:
print(_("Unknown option: %s") % option, file=sys.stderr)
- print(_(" Valid options are:"),
+ print(_(" Valid options are:") +
", ".join(list(self.options_dict.keys())),
file=sys.stderr)
print(_(" Use '%(donottranslate)s' to see description "
diff --git a/gramps/gen/const.py b/gramps/gen/const.py
index 5b67fba57..485be18b2 100644
--- a/gramps/gen/const.py
+++ b/gramps/gen/const.py
@@ -160,8 +160,6 @@ RULE_GLADE = os.path.join(GLADE_DIR, "rule.glade")
PLUGINS_DIR = os.path.join(ROOT_DIR, "plugins")
WEB_DIR = os.path.join(ROOT_DIR, 'webapp')
-WEBSTUFF_DIR = os.path.join(PLUGINS_DIR, "webstuff")
-WEBSTUFF_IMAGE_DIR = os.path.join(WEBSTUFF_DIR, "images")
USE_TIPS = False
diff --git a/gramps/gen/datehandler/__init__.py b/gramps/gen/datehandler/__init__.py
index 74338a496..9ef1cd442 100644
--- a/gramps/gen/datehandler/__init__.py
+++ b/gramps/gen/datehandler/__init__.py
@@ -58,6 +58,7 @@ from . import _date_sk
from . import _date_sl
from . import _date_sr
from . import _date_sv
+from . import _date_uk
# Initialize global parser
try:
diff --git a/gramps/gen/relationship.py b/gramps/gen/relationship.py
index f24477e64..ffd938e5a 100644
--- a/gramps/gen/relationship.py
+++ b/gramps/gen/relationship.py
@@ -900,9 +900,9 @@ class RelationshipCalculator(object):
if depth > self.__max_depth:
self.__maxDepthReached = True
- #print 'Maximum ancestor generations ('+str(depth)+') reached', \
+ #print('Maximum ancestor generations ('+str(depth)+') reached', \
# '(' + rel_str + ').',\
- # 'Stopping relation algorithm.'
+ # 'Stopping relation algorithm.')
return
depth += 1
@@ -1840,7 +1840,7 @@ def get_relationship_calculator(reinit=False, clocale=glocale):
#
#-------------------------------------------------------------------------
-def _test(rc, onlybirth, inlawa, inlawb, printrelstr):
+def _test(rc, onlybirth, inlawa, inlawb, printrelstr, testNum = None):
""" this is a generic test suite for the singular relationship
TRANSLATORS: do NOT translate, use __main__ !
"""
@@ -1852,7 +1852,7 @@ def _test(rc, onlybirth, inlawa, inlawb, printrelstr):
return 'f'
else:
return 'm'
-
+
def _rand_relstr(len, endstr):
if len == 0:
return ''
@@ -1861,295 +1861,337 @@ def _test(rc, onlybirth, inlawa, inlawb, printrelstr):
for i in range(len-1):
relstr += _rand_f_m()
return relstr + endstr
-
+
FMT = '%+50s'
MAX = 30
-
- #rc = RelationshipCalculator()
-
- print('\ntesting sons (Enter to start)\n')
- sys.stdin.readline()
- for i in range(MAX) :
- relstr = _rand_relstr(i,'f')
- rel = FMT % rc.get_single_relationship_string(0, i,
- MALE,
- MALE,
- '', relstr,
- only_birth=onlybirth,
- in_law_a=inlawa,
- in_law_b=inlawb)
- if printrelstr :
- print(rel + ' |info:', relstr)
- else:
- print(rel)
- print('\n\ntesting daughters\n')
- sys.stdin.readline()
- for i in range(MAX) :
- relstr = _rand_relstr(i,'m')
- rel = FMT % rc.get_single_relationship_string(0, i,
- MALE,
- FEMALE,
- '', relstr,
- only_birth=onlybirth,
- in_law_a=inlawa, in_law_b=inlawb)
- if printrelstr :
- print(rel + ' |info:', relstr)
- else:
- print(rel)
- print('\n\ntesting unknown children\n')
- sys.stdin.readline()
- for i in range(MAX) :
- relstr = _rand_relstr(i,'f')
- rel = FMT % rc.get_single_relationship_string(0, i,
- MALE,
- UNKNOWN,
- '', relstr,
- only_birth=onlybirth,
- in_law_a=inlawa, in_law_b=inlawb)
- if printrelstr :
- print(rel + ' |info:', relstr)
- else:
- print(rel)
- print('\n\ntesting grandfathers\n')
- sys.stdin.readline()
- for i in range(MAX) :
- relstr = _rand_relstr(i,'f')
- rel = FMT % rc.get_single_relationship_string(i, 0,
- FEMALE,
- MALE,
- relstr, '',
- only_birth=onlybirth,
- in_law_a=inlawa, in_law_b=inlawb)
- if printrelstr :
+
+ if testNum == None:
+ print("""
+Select a test:
+ 0 - all tests
+ 1 - testing sons
+ 2 - testing daughters
+ 3 - testing unknown children
+ 4 - testing grandfathers
+ 5 - testing grandmothers
+ 6 - testing unknown parents
+ 7 - testing nieces
+ 8 - testing nephews
+ 9 - testing unknown nephews/nieces
+ 10 - testing uncles
+ 11 - testing aunts
+ 12 - testing unknown uncles/aunts
+ 13 - testing male cousins same generation
+ 14 - testing female cousins same generation
+ 15 - testing unknown cousins same generation
+ 16 - testing some cousins up
+ 17 - testing some cousins down
+
+Please enter a test number and press Enter for continue:
+ """)
+ testNum = sys.stdin.readline().strip()
+ testNum = int(testNum)
+
+ if testNum == 0 or testNum == 1:
+ print('\ntesting sons')
+ #sys.stdin.readline()
+ for i in range(MAX) :
+ relstr = _rand_relstr(i,'f')
+ rel = FMT % rc.get_single_relationship_string(0, i,
+ MALE,
+ MALE,
+ '', relstr,
+ only_birth=onlybirth,
+ in_law_a=inlawa,
+ in_law_b=inlawb)
+ if printrelstr :
print(rel + ' |info:', relstr)
- else:
- print(rel)
- print('\n\ntesting grandmothers\n')
- sys.stdin.readline()
- for i in range(MAX) :
- relstr = _rand_relstr(i,'m')
- rel = FMT % rc.get_single_relationship_string(i, 0,
- FEMALE,
- FEMALE,
- relstr, '',
- only_birth=onlybirth,
- in_law_a=inlawa, in_law_b=inlawb)
- if printrelstr :
+ else:
+ print(rel)
+ if testNum == 0 or testNum == 2:
+ print('\ntesting daughters\n')
+ #sys.stdin.readline()
+ for i in range(MAX) :
+ relstr = _rand_relstr(i,'m')
+ rel = FMT % rc.get_single_relationship_string(0, i,
+ MALE,
+ FEMALE,
+ '', relstr,
+ only_birth=onlybirth,
+ in_law_a=inlawa, in_law_b=inlawb)
+ if printrelstr :
print(rel + ' |info:', relstr)
- else:
- print(rel)
- print('\n\ntesting unknown parents\n')
- sys.stdin.readline()
- for i in range(MAX) :
- relstr = _rand_relstr(i,'f')
- rel = FMT % rc.get_single_relationship_string(i, 0,
- FEMALE,
- UNKNOWN,
- relstr, '',
- only_birth=onlybirth,
- in_law_a=inlawa, in_law_b=inlawb)
- if printrelstr :
+ else:
+ print(rel)
+ if testNum == 0 or testNum == 3:
+ print('\ntesting unknown children\n')
+ #sys.stdin.readline()
+ for i in range(MAX) :
+ relstr = _rand_relstr(i,'f')
+ rel = FMT % rc.get_single_relationship_string(0, i,
+ MALE,
+ UNKNOWN,
+ '', relstr,
+ only_birth=onlybirth,
+ in_law_a=inlawa, in_law_b=inlawb)
+ if printrelstr :
print(rel + ' |info:', relstr)
- else:
- print(rel)
- print('\n\ntesting nieces\n')
- sys.stdin.readline()
- for i in range(1, MAX) :
- relstr = _rand_relstr(i,'m')
- rel = FMT % rc.get_single_relationship_string(1, i,
- FEMALE,
- FEMALE,
- 'm', relstr,
- only_birth=onlybirth,
- in_law_a=inlawa, in_law_b=inlawb)
- if printrelstr :
- print(rel + ' |info:', relstr)
- else:
- print(rel)
- print('\n\ntesting nephews\n')
- sys.stdin.readline()
- for i in range(1, MAX) :
- relstr = _rand_relstr(i,'f')
- rel = FMT % rc.get_single_relationship_string(1, i,
- FEMALE,
- MALE,
- 'f', relstr,
- only_birth=onlybirth,
- in_law_a=inlawa, in_law_b=inlawb)
- if printrelstr :
- print(rel + ' |info:', relstr)
- else:
- print(rel)
- print('\n\ntesting unknown nephews/nieces\n')
- sys.stdin.readline()
- for i in range(1, MAX) :
- relstr = _rand_relstr(i,'f')
- rel = FMT % rc.get_single_relationship_string(1, i,
- FEMALE,
- UNKNOWN,
- 'f', relstr,
- only_birth=onlybirth,
- in_law_a=inlawa, in_law_b=inlawb)
- if printrelstr :
- print(rel + ' |info:', relstr)
- else:
- print(rel)
- print('\n\ntesting uncles\n')
- sys.stdin.readline()
- for i in range(1, MAX) :
- relstr = _rand_relstr(i,'f')
- rel = FMT % rc.get_single_relationship_string(i, 1,
- FEMALE,
- MALE,
- relstr, 'f',
- only_birth=onlybirth,
- in_law_a=inlawa, in_law_b=inlawb)
- if printrelstr :
- print(rel + ' |info:', relstr)
- else:
- print(rel)
- print('\n\ntesting aunts\n')
- sys.stdin.readline()
- for i in range(1, MAX) :
- relstr = _rand_relstr(i,'f')
- rel = FMT % rc.get_single_relationship_string(i, 1,
- MALE,
- FEMALE,
- relstr, 'f',
- only_birth=onlybirth,
- in_law_a=inlawa, in_law_b=inlawb)
- if printrelstr :
- print(rel + ' |info:', relstr)
- else:
- print(rel)
- print('\n\ntesting unknown uncles/aunts\n')
- sys.stdin.readline()
- for i in range(1, MAX) :
- relstr = _rand_relstr(i,'m')
- rel = FMT % rc.get_single_relationship_string(i, 1,
- MALE,
- UNKNOWN,
- relstr, 'm',
- only_birth=onlybirth,
- in_law_a=inlawa, in_law_b=inlawb)
- if printrelstr :
- print(rel + ' |info:', relstr)
- else:
- print(rel)
- print('\n\ntesting male cousins same generation\n')
- sys.stdin.readline()
- for i in range(1, MAX) :
- relstra = _rand_relstr(i,'f')
- relstrb = _rand_relstr(i,'f')
- rel = FMT % rc.get_single_relationship_string(i, i,
- MALE,
- MALE,
- relstra,
- relstrb,
- only_birth=onlybirth,
- in_law_a=inlawa, in_law_b=inlawb)
- if printrelstr :
- print(rel + ' |info:', relstra, relstrb)
- else:
- print(rel)
- print('\n\ntesting female cousins same generation\n')
- sys.stdin.readline()
- for i in range(1, MAX) :
- relstra = _rand_relstr(i,'m')
- relstrb = _rand_relstr(i,'m')
- rel = FMT % rc.get_single_relationship_string(i, i,
- MALE,
- FEMALE,
- relstra,
- relstrb,
- only_birth=onlybirth,
- in_law_a=inlawa, in_law_b=inlawb)
- if printrelstr :
- print(rel + ' |info:', relstra, relstrb)
- else:
- print(rel)
- print('\n\ntesting unknown cousins same generation\n')
- sys.stdin.readline()
- for i in range(1, MAX) :
- relstra = _rand_relstr(i,'m')
- relstrb = _rand_relstr(i,'m')
- rel = FMT % rc.get_single_relationship_string(i, i,
- MALE,
- UNKNOWN,
- relstra,
- relstrb,
- only_birth=onlybirth,
- in_law_a=inlawa, in_law_b=inlawb)
- if printrelstr :
- print(rel + ' |info:', relstra, relstrb)
- else:
- print(rel)
- print('\n\ntesting some cousins up\n')
- sys.stdin.readline()
- import random
- random.seed()
- for i in range(1, MAX) :
- for j in range (i, MAX) :
- rnd = random.randint(0, 100)
- if rnd < 10 :
- relstra = _rand_relstr(j,'f')
- relstrb = _rand_relstr(i,'f')
- if rnd < 5 :
- rel = (FMT + ' |info: female, Ga=%2d, Gb=%2d') % (
- rc.get_single_relationship_string(j, i,
- MALE,
- FEMALE,
- relstra, relstrb,
- only_birth=onlybirth,
- in_law_a=inlawa, in_law_b=inlawb), j, i )
- if printrelstr :
- print(rel + ' |info:', relstra, relstrb)
+ else:
+ print(rel)
+ if testNum == 0 or testNum == 4:
+ print('\ntesting grandfathers\n')
+ #sys.stdin.readline()
+ for i in range(MAX) :
+ relstr = _rand_relstr(i,'f')
+ rel = FMT % rc.get_single_relationship_string(i, 0,
+ FEMALE,
+ MALE,
+ relstr, '',
+ only_birth=onlybirth,
+ in_law_a=inlawa, in_law_b=inlawb)
+ if printrelstr :
+ print(rel + ' |info:', relstr)
+ else:
+ print(rel)
+ if testNum == 0 or testNum == 5:
+ print('\ntesting grandmothers\n')
+ #sys.stdin.readline()
+ for i in range(MAX) :
+ relstr = _rand_relstr(i,'m')
+ rel = FMT % rc.get_single_relationship_string(i, 0,
+ FEMALE,
+ FEMALE,
+ relstr, '',
+ only_birth=onlybirth,
+ in_law_a=inlawa, in_law_b=inlawb)
+ if printrelstr :
+ print(rel + ' |info:', relstr)
+ else:
+ print(rel)
+ if testNum == 0 or testNum == 6:
+ print('\ntesting unknown parents\n')
+ #sys.stdin.readline()
+ for i in range(MAX) :
+ relstr = _rand_relstr(i,'f')
+ rel = FMT % rc.get_single_relationship_string(i, 0,
+ FEMALE,
+ UNKNOWN,
+ relstr, '',
+ only_birth=onlybirth,
+ in_law_a=inlawa, in_law_b=inlawb)
+ if printrelstr :
+ print(rel + ' |info:', relstr)
+ else:
+ print(rel)
+ if testNum == 0 or testNum == 7:
+ print('\ntesting nieces\n')
+ #sys.stdin.readline()
+ for i in range(1, MAX) :
+ relstr = _rand_relstr(i,'m')
+ rel = FMT % rc.get_single_relationship_string(1, i,
+ FEMALE,
+ FEMALE,
+ 'm', relstr,
+ only_birth=onlybirth,
+ in_law_a=inlawa, in_law_b=inlawb)
+ if printrelstr :
+ print(rel + ' |info:', relstr)
+ else:
+ print(rel)
+ if testNum == 0 or testNum == 8:
+ print('\ntesting nephews\n')
+ #sys.stdin.readline()
+ for i in range(1, MAX) :
+ relstr = _rand_relstr(i,'f')
+ rel = FMT % rc.get_single_relationship_string(1, i,
+ FEMALE,
+ MALE,
+ 'f', relstr,
+ only_birth=onlybirth,
+ in_law_a=inlawa, in_law_b=inlawb)
+ if printrelstr :
+ print(rel + ' |info:', relstr)
+ else:
+ print(rel)
+ if testNum == 0 or testNum == 9:
+ print('\ntesting unknown nephews/nieces\n')
+ #sys.stdin.readline()
+ for i in range(1, MAX) :
+ relstr = _rand_relstr(i,'f')
+ rel = FMT % rc.get_single_relationship_string(1, i,
+ FEMALE,
+ UNKNOWN,
+ 'f', relstr,
+ only_birth=onlybirth,
+ in_law_a=inlawa, in_law_b=inlawb)
+ if printrelstr :
+ print(rel + ' |info:', relstr)
+ else:
+ print(rel)
+ if testNum == 0 or testNum == 10:
+ print('\ntesting uncles\n')
+ #sys.stdin.readline()
+ for i in range(1, MAX) :
+ relstr = _rand_relstr(i,'f')
+ rel = FMT % rc.get_single_relationship_string(i, 1,
+ FEMALE,
+ MALE,
+ relstr, 'f',
+ only_birth=onlybirth,
+ in_law_a=inlawa, in_law_b=inlawb)
+ if printrelstr :
+ print(rel + ' |info:', relstr)
+ else:
+ print(rel)
+ if testNum == 0 or testNum == 11:
+ print('\ntesting aunts\n')
+ #sys.stdin.readline()
+ for i in range(1, MAX) :
+ relstr = _rand_relstr(i,'f')
+ rel = FMT % rc.get_single_relationship_string(i, 1,
+ MALE,
+ FEMALE,
+ relstr, 'f',
+ only_birth=onlybirth,
+ in_law_a=inlawa, in_law_b=inlawb)
+ if printrelstr :
+ print(rel + ' |info:', relstr)
+ else:
+ print(rel)
+ if testNum == 0 or testNum == 12:
+ print('\ntesting unknown uncles/aunts\n')
+ #sys.stdin.readline()
+ for i in range(1, MAX) :
+ relstr = _rand_relstr(i,'m')
+ rel = FMT % rc.get_single_relationship_string(i, 1,
+ MALE,
+ UNKNOWN,
+ relstr, 'm',
+ only_birth=onlybirth,
+ in_law_a=inlawa, in_law_b=inlawb)
+ if printrelstr :
+ print(rel + ' |info:', relstr)
+ else:
+ print(rel)
+ if testNum == 0 or testNum == 13:
+ print('\ntesting male cousins same generation\n')
+ #sys.stdin.readline()
+ for i in range(1, MAX) :
+ relstra = _rand_relstr(i,'f')
+ relstrb = _rand_relstr(i,'f')
+ rel = FMT % rc.get_single_relationship_string(i, i,
+ MALE,
+ MALE,
+ relstra,
+ relstrb,
+ only_birth=onlybirth,
+ in_law_a=inlawa, in_law_b=inlawb)
+ if printrelstr :
+ print(rel + ' |info:', relstra, relstrb)
+ else:
+ print(rel)
+ if testNum == 0 or testNum == 14:
+ print('\ntesting female cousins same generation\n')
+ #sys.stdin.readline()
+ for i in range(1, MAX) :
+ relstra = _rand_relstr(i,'m')
+ relstrb = _rand_relstr(i,'m')
+ rel = FMT % rc.get_single_relationship_string(i, i,
+ MALE,
+ FEMALE,
+ relstra,
+ relstrb,
+ only_birth=onlybirth,
+ in_law_a=inlawa, in_law_b=inlawb)
+ if printrelstr :
+ print(rel + ' |info:', relstra, relstrb)
+ else:
+ print(rel)
+ if testNum == 0 or testNum == 15:
+ print('\ntesting unknown cousins same generation\n')
+ #sys.stdin.readline()
+ for i in range(1, MAX) :
+ relstra = _rand_relstr(i,'m')
+ relstrb = _rand_relstr(i,'m')
+ rel = FMT % rc.get_single_relationship_string(i, i,
+ MALE,
+ UNKNOWN,
+ relstra,
+ relstrb,
+ only_birth=onlybirth,
+ in_law_a=inlawa, in_law_b=inlawb)
+ if printrelstr :
+ print(rel + ' |info:', relstra, relstrb)
+ else:
+ print(rel)
+ if testNum == 0 or testNum == 16:
+ print('\ntesting some cousins up\n')
+ #sys.stdin.readline()
+ import random
+ random.seed()
+ for i in range(1, MAX) :
+ for j in range (i, MAX) :
+ rnd = random.randint(0, 100)
+ if rnd < 10 :
+ relstra = _rand_relstr(j,'f')
+ relstrb = _rand_relstr(i,'f')
+ if rnd < 5 :
+ rel = (FMT + ' |info: female, Ga=%2d, Gb=%2d') % (
+ rc.get_single_relationship_string(j, i,
+ MALE,
+ FEMALE,
+ relstra, relstrb,
+ only_birth=onlybirth,
+ in_law_a=inlawa, in_law_b=inlawb), j, i )
+ if printrelstr :
+ print(rel + ' |info:', relstra, relstrb)
+ else:
+ print(rel)
else:
- print(rel)
- else:
- rel = (FMT + ' |info: male, Ga=%2d, Gb=%2d') % (
- rc.get_single_relationship_string(j, i,
- MALE,
- MALE,
- relstra, relstrb,
- only_birth=onlybirth,
- in_law_a=inlawa, in_law_b=inlawb), j, i )
- if printrelstr :
- print(rel + ' |info:', relstra, relstrb)
+ rel = (FMT + ' |info: male, Ga=%2d, Gb=%2d') % (
+ rc.get_single_relationship_string(j, i,
+ MALE,
+ MALE,
+ relstra, relstrb,
+ only_birth=onlybirth,
+ in_law_a=inlawa, in_law_b=inlawb), j, i )
+ if printrelstr :
+ print(rel + ' |info:', relstra, relstrb)
+ else:
+ print(rel)
+ if testNum == 0 or testNum == 17:
+ print('\ntesting some cousins down\n')
+ #sys.stdin.readline()
+ for i in range(1, MAX) :
+ for j in range (i, MAX) :
+ rnd = random.randint(0, 100)
+ if rnd < 10 :
+ relstra = _rand_relstr(i,'f')
+ relstrb = _rand_relstr(j,'f')
+ if rnd < 5 :
+ rel = (FMT + ' |info: female, Ga=%2d, Gb=%2d') % (
+ rc.get_single_relationship_string(i, j,
+ MALE,
+ FEMALE,
+ relstra, relstrb,
+ only_birth=onlybirth,
+ in_law_a=inlawa, in_law_b=inlawb), i, j)
+ if printrelstr :
+ print(rel + ' |info:', relstra, relstrb)
+ else:
+ print(rel)
else:
- print(rel)
- print('\n\ntesting some cousins down\n')
- sys.stdin.readline()
- for i in range(1, MAX) :
- for j in range (i, MAX) :
- rnd = random.randint(0, 100)
- if rnd < 10 :
- relstra = _rand_relstr(i,'f')
- relstrb = _rand_relstr(j,'f')
- if rnd < 5 :
- rel = (FMT + ' |info: female, Ga=%2d, Gb=%2d') % (
- rc.get_single_relationship_string(i, j,
- MALE,
- FEMALE,
- relstra, relstrb,
- only_birth=onlybirth,
- in_law_a=inlawa, in_law_b=inlawb), i, j)
- if printrelstr :
- print(rel + ' |info:', relstra, relstrb)
- else:
- print(rel)
- else:
- rel = (FMT + ' |info: male, Ga=%2d, Gb=%2d') % (
- rc.get_single_relationship_string(i, j,
- MALE,
- MALE,
- relstra, relstrb,
- only_birth=onlybirth,
- in_law_a=inlawa, in_law_b=inlawb), i, j)
- if printrelstr :
- print(rel + ' |info:', relstr)
- else:
- print(rel)
+ rel = (FMT + ' |info: male, Ga=%2d, Gb=%2d') % (
+ rc.get_single_relationship_string(i, j,
+ MALE,
+ MALE,
+ relstra, relstrb,
+ only_birth=onlybirth,
+ in_law_a=inlawa, in_law_b=inlawb), i, j)
+ if printrelstr :
+ print(rel + ' |info:', relstra, relstrb)
+ else:
+ print(rel)
def _testsibling(rc):
vals = [(rc.NORM_SIB, 'sibling'),
@@ -2186,35 +2228,57 @@ def _test_spouse(rc):
def test(rc, printrelstr):
""" this is a generic test suite for the singular relationship
- TRANSLATORS: do NOT translate, call this from
+ TRANSLATORS: do NOT translate, call this from
__main__ in the rel_xx.py module.
"""
import sys
-
- print('\nType y to do a test\n\n')
- print('Test normal relations?')
- data = sys.stdin.readline()
- if data == 'y\n':
- _test(rc, True, False, False, printrelstr)
- print('\n\nTest step relations?')
- data = sys.stdin.readline()
- if data == 'y\n':
- _test(rc, False, False, False, printrelstr)
- print('\n\nTest in-law relations (first pers)?')
- data = sys.stdin.readline()
- if data == 'y\n':
- _test(rc, True, True, False, printrelstr)
- print('\n\nTest step and in-law relations?')
- data = sys.stdin.readline()
- if data == 'y\n':
- _test(rc, False, True, False, printrelstr)
- print('\n\nTest sibling types?')
- data = sys.stdin.readline()
- if data == 'y\n':
+ import argparse
+
+ parser = argparse.ArgumentParser(description='Test the Relationship Calculator')
+ parser.add_argument('-r', type=int, help = 'type of the relations test')
+ parser.add_argument('-s', type=int, help = 'type of the singular relationship test')
+
+ args = parser.parse_args()
+ testNum = args.r
+
+ if testNum == None:
+ print("""
+Select a test:
+ 0 - all tests
+ 1 - Test normal relations
+ 2 - Test step relations
+ 3 - Test in-law relations (first pers)
+ 4 - Test step and in-law relations
+ 5 - Test sibling types
+ 6 - Test partner types
+
+Please enter a test number and press Enter for continue:
+ """)
+ testNum = sys.stdin.readline().strip()
+ testNum = int(testNum)
+
+ if testNum == 0 or testNum == 1:
+ print('\n\n=== Test normal relations ===')
+ _test(rc, True, False, False, printrelstr, args.s)
+
+ if testNum == 0 or testNum == 2:
+ print('\n\n=== Test step relations ===')
+ _test(rc, False, False, False, printrelstr, args.s)
+
+ if testNum == 0 or testNum == 3:
+ print('\n\n=== Test in-law relations (first pers) ===')
+ _test(rc, True, True, False, printrelstr, args.s)
+
+ if testNum == 0 or testNum == 4:
+ print('\n\n=== Test step and in-law relations ===')
+ _test(rc, False, True, False, printrelstr, args.s)
+
+ if testNum == 0 or testNum == 5:
+ print('\n\n=== Test sibling types ===')
_testsibling(rc)
- print('\n\nTest partner types?')
- data = sys.stdin.readline()
- if data == 'y\n':
+
+ if testNum == 0 or testNum == 6:
+ print('\n\n=== Test partner types ===')
_test_spouse(rc)
if __name__ == "__main__":
diff --git a/gramps/gen/utils/grampslocale.py b/gramps/gen/utils/grampslocale.py
index 5d6da0c77..afedd396d 100644
--- a/gramps/gen/utils/grampslocale.py
+++ b/gramps/gen/utils/grampslocale.py
@@ -601,6 +601,7 @@ class GrampsLocale(object):
_ = self.translation.gettext
if not self._lang_map:
self._lang_map = {
+ "ar" : _("Arabic"),
"bg" : _("Bulgarian"),
"ca" : _("Catalan"),
"cs" : _("Czech"),
diff --git a/gramps/gui/utilscairo.py b/gramps/gui/utilscairo.py
new file mode 100644
index 000000000..a2dc276c0
--- /dev/null
+++ b/gramps/gui/utilscairo.py
@@ -0,0 +1,87 @@
+#
+# Gramps - a GTK+/GNOME based genealogy program
+#
+# Copyright (C) 2001-2007 Donald N. Allingham, Martin Hawlisch
+# Copyright (C) 2009 Douglas S. Blank
+# Copyright (C) 2012 Benny Malengier
+# Copyright (C) 2013 Vassilii Khachaturov
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+
+# $Id$
+
+from __future__ import division
+
+#-------------------------------------------------------------------------
+#
+# Python modules
+#
+#-------------------------------------------------------------------------
+#from gi.repository import Pango
+#from gi.repository import GObject
+#from gi.repository import Gdk
+#from gi.repository import Gtk
+#from gi.repository import PangoCairo
+import cairo
+#import math
+#import colorsys
+#import sys
+#if sys.version_info[0] < 3:
+# import cPickle as pickle
+#else:
+# import pickle
+
+#-------------------------------------------------------------------------
+#
+# Functions
+#
+#-------------------------------------------------------------------------
+def warpPath(ctx, function):
+ """Transform a path given a 2D transformation function.
+
+ ctx -- a cairo.Context, on which the path is set
+ function -- a 2D transform (x,y) |-> (x_new,y_new)
+
+ The transformed path replaces the original one on the context.
+
+ Taken from /usr/share/doc/python-cairo/examples/warpedtext.py
+ According to /usr/share/doc/python-cairo/copyright, licensed
+ under MOZILLA PUBLIC LICENSE 1.1, see that file for more detail.
+ """
+
+ first = True
+
+ for type, points in ctx.copy_path():
+ if type == cairo.PATH_MOVE_TO:
+ if first:
+ ctx.new_path()
+ first = False
+ x, y = function(*points)
+ ctx.move_to(x, y)
+
+ elif type == cairo.PATH_LINE_TO:
+ x, y = function(*points)
+ ctx.line_to(x, y)
+
+ elif type == cairo.PATH_CURVE_TO:
+ x1, y1, x2, y2, x3, y3 = points
+ x1, y1 = function(x1, y1)
+ x2, y2 = function(x2, y2)
+ x3, y3 = function(x3, y3)
+ ctx.curve_to(x1, y1, x2, y2, x3, y3)
+
+ elif type == cairo.PATH_CLOSE_PATH:
+ ctx.close_path()
diff --git a/gramps/gui/views/bookmarks.py b/gramps/gui/views/bookmarks.py
index fad945ce7..1d9daa200 100644
--- a/gramps/gui/views/bookmarks.py
+++ b/gramps/gui/views/bookmarks.py
@@ -394,6 +394,29 @@ class CitationBookmarks(ListBookmarks) :
def make_label(self, handle):
return navigation_label(self.dbstate.db, 'Citation', handle)
+ # Override add from ListBookmarks, so that when self.bookmarks.add is called
+ # from ListView.add_bookmark, it will not add a Source bookmark to a
+ # Citation view.
+ def add(self, handle):
+ """Append the citation to the bottom of the bookmarks."""
+ if self.dbstate.db.get_citation_from_handle(handle):
+ ListBookmarks.add(self, handle)
+ else:
+ # Probably trying to bookmark a source when the navigation type is
+ # citation. This can occur when in the Citation Tree View and we
+ # bookmark a source.
+
+ # FIXME: See http://www.gramps-project.org/bugs/view.php?id=6352 a
+ # more comprehensive solution is needed in the long term. See also
+ # change_active in CitatinTreeView
+ from gramps.gui.dialog import WarningDialog
+ WarningDialog(_("Cannot bookmark this reference"),
+ "Only Citations can be bookmarked in this view. "
+ "You are probably trying to bookmark a Source in the "
+ "Citation Tree View. In this view, only Citations "
+ "can be bookmarked. To bookmark a Source, switch to "
+ "the Source View")
+
def connect_signals(self):
self.dbstate.db.connect('citation-delete', self.remove_handles)
diff --git a/gramps/gui/widgets/fanchart.py b/gramps/gui/widgets/fanchart.py
index 14e7dbf78..0a2025a86 100644
--- a/gramps/gui/widgets/fanchart.py
+++ b/gramps/gui/widgets/fanchart.py
@@ -4,6 +4,7 @@
# Copyright (C) 2001-2007 Donald N. Allingham, Martin Hawlisch
# Copyright (C) 2009 Douglas S. Blank
# Copyright (C) 2012 Benny Malengier
+# Copyright (C) 2013 Vassilii Khachaturov
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -72,6 +73,7 @@ from gramps.gen.utils.db import (find_children, find_parents, find_witnessed_peo
get_age, get_timeperiod, preset_name)
from gramps.gen.const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext
+from gramps.gui.utilscairo import warpPath
#-------------------------------------------------------------------------
#
@@ -553,6 +555,22 @@ class FanChartBaseWidget(Gtk.DrawingArea):
cr.set_source_rgba(r/255., g/255., b/255., a)
cr.fill()
+ def wrap_truncate_layout(self, layout, font, width_pixels):
+ """Uses the layout to wrap and truncate its text to given width
+
+ Returns: (w,h) as returned by layout.get_pixel_size()
+ """
+
+ layout.set_font_description(font)
+ layout.set_width(Pango.SCALE * width_pixels)
+
+ # NOTE: one may not truncate the text to just the 1st line's text,
+ # because the truncation can create invalid Unicode.
+ if layout.get_line_count() > 1:
+ layout.set_text(layout.get_text(), layout.get_line(0).length)
+
+ return layout.get_pixel_size()
+
def draw_text(self, cr, text, radius, start, stop,
height=PIXELS_PER_GENERATION, radial=False,
fontcolor=(0, 0, 0), bold=False):
@@ -566,29 +584,31 @@ class FanChartBaseWidget(Gtk.DrawingArea):
font.set_size(fontsize * Pango.SCALE)
if bold:
font.set_weight(Pango.Weight.BOLD)
- cr.set_source_rgb(fontcolor[0], fontcolor[1], fontcolor[2])
+ cr.set_source_rgb(*fontcolor)
if radial and self.radialtext:
cr.save()
layout = self.create_pango_layout(text)
layout.set_font_description(font)
- w, h = layout.get_size()
- w = w / Pango.SCALE + 5 # 5 pixel padding
- h = h / Pango.SCALE + 4 # 4 pixel padding
+ layout.set_wrap(Pango.WrapMode.CHAR)
+
+ # NOTE: for radial text, the sector radius height is the text width
+ w, h = self.wrap_truncate_layout(layout, font, height - 2*PAD_TEXT)
+
+ w = w + 5 # 5 pixel padding
+ h = h + 4 # 4 pixel padding
#first we check if height is ok
- degneedheight = h / radius * (180 / math.pi)
+ degneedheight = math.degrees(h / radius)
degavailheight = stop-start
degoffsetheight = 0
if degneedheight > degavailheight:
#reduce height
fontsize = degavailheight / degneedheight * fontsize / 2
font.set_size(fontsize * Pango.SCALE)
- layout = self.create_pango_layout(text)
- layout.set_font_description(font)
- w, h = layout.get_size()
- w = w / Pango.SCALE + 5 # 5 pixel padding
- h = h / Pango.SCALE + 4 # 4 pixel padding
+ w, h = self.wrap_truncate_layout(layout, font, height - 2*PAD_TEXT)
+ w = w + 5 # 5 pixel padding
+ h = h + 4 # 4 pixel padding
#first we check if height is ok
- degneedheight = h / radius * (180 / math.pi)
+ degneedheight = math.degrees(h / radius)
degavailheight = stop-start
if degneedheight > degavailheight:
#we could not fix it, no text
@@ -596,31 +616,13 @@ class FanChartBaseWidget(Gtk.DrawingArea):
if text:
#spread rest
degoffsetheight = (degavailheight - degneedheight) / 2
- txlen = len(text)
- if w > height - PAD_TEXT:
- txlen = int(w/height * txlen)
- cont = True
- while cont:
- layout = self.create_pango_layout(text[:txlen])
- layout.set_font_description(font)
- w, h = layout.get_size()
- w = w / Pango.SCALE + 2*PAD_TEXT # padding before/after
- h = h / Pango.SCALE + 4 # padding in height text
- if w > height:
- if txlen <= 1:
- cont = False
- txlen = 0
- else:
- txlen -= 1
- else:
- cont = False
# offset for cairo-font system is 90
rotval = self.rotate_value % 360 - 90
if (start + rotval) % 360 > 179:
pos = start + degoffsetheight + 90 - 90
else:
pos = stop - degoffsetheight + 180
- cr.rotate(pos * math.pi / 180)
+ cr.rotate(math.radians(pos))
layout.context_changed()
if (start + rotval) % 360 > 179:
cr.move_to(radius + PAD_TEXT, 0)
@@ -629,60 +631,90 @@ class FanChartBaseWidget(Gtk.DrawingArea):
PangoCairo.show_layout(cr, layout)
cr.restore()
else:
- # center text:
- # 1. determine degrees of the text we can draw
- degpadding = PAD_TEXT / radius * (180 / math.pi) # degrees for padding
- degneed = degpadding
- maxlen = len(text)
- hoffset = 0
- for i in range(len(text)):
- layout = self.create_pango_layout(text[i])
- layout.set_font_description(font)
- w, h = layout.get_size()
- w = w / Pango.SCALE + 2 # 2 pixel padding after letter
- h = h / Pango.SCALE + 2 # 2 pixel padding
- if h/2 > hoffset:
- hoffset = h/2
- degneed += w / radius * (180 / math.pi)
- if degneed > stop - start - degpadding:
- #outside of the box
- maxlen = i
- break
- # 2. determine degrees over we can distribute before and after
- if degneed > stop - start - degpadding:
- degover = 0
- else:
- degover = stop - start - degneed - degpadding
- # 3. now draw this text, letter per letter
- text = text[:maxlen]
-
- # offset for cairo-font system is 90, padding used is 5:
- pos = start + 90 + degpadding + degover / 2
- # Create a PangoLayout, set the font and text
- # Draw the layout N_WORDS times in a circle
- for i in range(len(text)):
- layout = self.create_pango_layout(text[i])
- layout.set_font_description(font)
- w, h = layout.get_size()
- w = w / Pango.SCALE + 2 # 4 pixel padding after word
- h = h / Pango.SCALE + 2 # 4 pixel padding
- degneed = w / radius * (180 / math.pi)
- if pos+degneed > stop + 90:
- #failsafe, outside of the box, redo
- break
-
- cr.save()
- cr.rotate(pos * math.pi / 180)
- pos = pos + degneed
- # Inform Pango to re-layout the text with the new transformation
- layout.context_changed()
- #width, height = layout.get_size()
- #r.move_to(- (width / Pango.SCALE) / 2.0, - radius)
- cr.move_to(0, - radius - hoffset)
- PangoCairo.show_layout(cr, layout)
- cr.restore()
+ self.draw_arc_text(cr, text, radius, start, stop, font)
cr.restore()
+ def draw_arc_text(self, cr, text, radius, start, stop, font):
+ """
+ Display text at a particular radius, between start and stop
+ degrees, setting it up along the arc, center-justified.
+
+ Text not fitting a single line will be word-wrapped away.
+ """
+
+ # 1. determine the spread of text we can draw, in radians
+ degpadding = math.degrees(PAD_TEXT / radius)
+ # offset for cairo-font system is 90, padding used is 5:
+ pos = start + 90 + degpadding/2
+ cr.save()
+ cr.rotate(math.radians(pos))
+ cr.new_path()
+ cr.move_to(0, -radius)
+ rad_spread = math.radians(stop - start - degpadding)
+
+ # 2. Use Pango.Layout to set up the text for us, and do
+ # the hard work in CTL text handling and line wrapping.
+ # Clip to the top line only so the text looks nice
+ # all around the circle at the same radius.
+ layout = self.create_pango_layout(text)
+ layout.set_wrap(Pango.WrapMode.WORD)
+ w, h = self.wrap_truncate_layout(layout, font, radius * rad_spread)
+
+ # 3. Use the layout to provide us the metrics of the text box
+ PangoCairo.layout_path(cr, layout)
+ #le = layout.get_line(0).get_pixel_extents()[0]
+ pe = cr.path_extents()
+ arc_used_ratio = w / (radius * rad_spread)
+ rad_mid = math.radians(pos) + rad_spread/2
+
+ # 4. The moment of truth: map the text box onto the sector, and render!
+ warpPath(cr, \
+ self.create_map_rect_to_sector(radius, pe, \
+ arc_used_ratio, rad_mid - rad_spread/2, rad_mid + rad_spread/2))
+ cr.fill()
+ cr.restore()
+
+ @staticmethod
+ def create_map_rect_to_sector(radius, rect, arc_used_ratio, start_rad, stop_rad):
+ """Create a 2D-transform, mapping a rectangle onto a circle sector.
+
+ radius -- average radius of the target sector
+ rect -- (x1, y1, x2, y2)
+ arc_used_ratio -- From 0.0 to 1.0. Rather than stretching onto the
+ whole sector, only the middle arc_used_ratio part will be mapped onto.
+ start_rad -- start radial angle of the sector, in radians
+ stop_rad -- stop radial angle of the sector, in radians
+
+ Returns a lambda (x,y)|->(xNew,yNew) to feed to warpPath.
+ """
+
+ x0, y0, w, h = rect[0], rect[1], rect[2]-rect[0], rect[3]-rect[1]
+
+ radiusin = radius - h/2
+ radiusout = radius + h/2
+ drho = h
+ dphi = (stop_rad - start_rad)
+
+ # There has to be a clearer way to express this transform,
+ # by stacking a set of transforms on cr around using this function
+ # and doing a mapping between unit squares of rectangular and polar
+ # coordinates.
+
+ def phi(x):
+ return (x - x0) * dphi * arc_used_ratio / w \
+ + (1 - arc_used_ratio) * dphi / 2 \
+ - math.pi/2
+ def rho(y):
+ return (y - y0) * (radiusin - radiusout)/h + radiusout
+
+ # In (user coordinates units - pixels):
+ # x from x0 to x0 + w
+ # y from y0 to y0 + h
+ # Out:
+ # (x, y) within the arc_used_ratio of a box like drawn by draw_radbox
+ return lambda x, y: \
+ (rho(y) * math.cos(phi(x)), rho(y) * math.sin(phi(x)))
+
def draw_gradient(self, cr, widget, halfdist):
gradwidth = 10
gradheight = 10
@@ -895,7 +927,7 @@ class FanChartBaseWidget(Gtk.DrawingArea):
end_angle = math.pi + (math.pi + end_angle)
# now look at change in angle:
diff_angle = (end_angle - start_angle) % (math.pi * 2.0)
- self.rotate_value -= diff_angle * 180.0/ math.pi
+ self.rotate_value -= math.degrees(diff_angle)
self.last_x, self.last_y = event.x, event.y
self.queue_draw()
return True
@@ -1227,7 +1259,7 @@ class FanChartWidget(FanChartBaseWidget):
cr.translate(self.center_x, self.center_y)
cr.save()
- cr.rotate(self.rotate_value * math.pi/180)
+ cr.rotate(math.radians(self.rotate_value))
for generation in range(self.generations - 1, 0, -1):
for p in range(len(self.data[generation])):
(text, person, parents, child, userdata) = self.data[generation][p]
@@ -1284,8 +1316,8 @@ class FanChartWidget(FanChartBaseWidget):
position in the chart
"""
cr.save()
- start_rad = start * math.pi/180
- stop_rad = stop * math.pi/180
+ start_rad = math.radians(start)
+ stop_rad = math.radians(stop)
r, g, b, a = self.background_box(person, generation, userdata)
radius = generation * PIXELS_PER_GENERATION + self.CENTER
# If max generation, and they have parents:
@@ -1339,7 +1371,7 @@ class FanChartWidget(FanChartBaseWidget):
radial = False
radstart = radius - PIXELS_PER_GENERATION/2
if self.radialtext: ## and generation >= 6:
- spacepolartext = radstart * (stop-start)*math.pi/180
+ spacepolartext = radstart * math.radians(stop-start)
if spacepolartext < PIXELS_PER_GENERATION * 1.1:
# more space to print it radial
radial = True
diff --git a/gramps/gui/widgets/grampletpane.py b/gramps/gui/widgets/grampletpane.py
index 6e2f1567a..d80c10797 100644
--- a/gramps/gui/widgets/grampletpane.py
+++ b/gramps/gui/widgets/grampletpane.py
@@ -1272,6 +1272,9 @@ class GrampletPane(Gtk.ScrolledWindow):
mainframe = mframe.get_parent() # actually a vbox
rect = source.get_allocation()
sx, sy = rect.width, rect.height
+ # Convert to LTR co-ordinates when using RTL locale
+ if source.get_direction() == Gtk.TextDirection.RTL:
+ x = sx - x
# first, find column:
col = 0
for i in range(len(self.columns)):
diff --git a/gramps/plugins/docgen/htmldoc.py b/gramps/plugins/docgen/htmldoc.py
index 2c0a9d24a..a2a460ef2 100644
--- a/gramps/plugins/docgen/htmldoc.py
+++ b/gramps/plugins/docgen/htmldoc.py
@@ -48,7 +48,7 @@ import time
from gramps.gen.const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext
from gramps.gen.utils.image import resize_to_jpeg
-from gramps.gen.const import DATA_DIR, WEBSTUFF_IMAGE_DIR, PROGRAM_NAME, URL_HOMEPAGE
+from gramps.gen.const import DATA_DIR, IMAGE_DIR, PROGRAM_NAME, URL_HOMEPAGE
from gramps.version import VERSION
from gramps.gen.plug.docgen import BaseDoc, TextDoc, FONT_SANS_SERIF, URL_PATTERN
from gramps.plugins.lib.libhtmlbackend import HtmlBackend, process_spaces
@@ -298,7 +298,7 @@ class HtmlDoc(BaseDoc, TextDoc):
if os.path.exists(fullpath):
self.copy_file(fullpath, _HTMLSCREEN)
#favicon
- self.copy_file(os.path.join(WEBSTUFF_IMAGE_DIR, 'favicon.ico'),
+ self.copy_file(os.path.join(IMAGE_DIR, 'webstuff', 'favicon.ico'),
'favicon.ico')
def __reduce_list(self):
diff --git a/gramps/plugins/lib/holidays.xml.in b/gramps/plugins/lib/holidays.xml.in
index 30d57d46c..619e0291f 100644
--- a/gramps/plugins/lib/holidays.xml.in
+++ b/gramps/plugins/lib/holidays.xml.in
@@ -499,4 +499,41 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/gramps/plugins/rel/rel_uk.py b/gramps/plugins/rel/rel_uk.py
new file mode 100644
index 000000000..dd6c16a05
--- /dev/null
+++ b/gramps/plugins/rel/rel_uk.py
@@ -0,0 +1,911 @@
+# -*- coding: utf-8 -*-
+#
+# Gramps - a GTK+/GNOME based genealogy program
+#
+# Copyright (C) 2003-2005 Donald N. Allingham
+# Copyright (C) 2008 Brian G. Matherly
+# Copyright (C) 2013 Oleh Petriv
+# Copyright (C) 2013 Fedir Zinchuk
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# gramps/plugins/rel/rel_uk.py
+# $Id$
+#
+# UA: Пояснення щодо родинних відносин див. relationship.py
+# EN: Ukrainian relationship calculator. For more information see relationship.py
+
+"""
+Ukrainian-specific definitions of relationships
+"""
+from __future__ import unicode_literals
+#-------------------------------------------------------------------------
+#
+# GRAMPS modules
+#
+#-------------------------------------------------------------------------
+
+from gramps.gen.lib import Person
+import gramps.gen.relationship
+
+#-------------------------------------------------------------------------
+
+
+# Relationship levels
+
+_level_name = [
+ "",
+ "рідний(-на)", "двоюрідний(-на)", "троюрідний(-на)",
+ "чотириюрідний(-на)", "п'ятиюрідний(-на)", "шестиюрідний(-на)",
+ "семиюрідний(-на)", "восьмиюрідний(-на)", "дев'ятиюрідний(-на)",
+ "десятиюрідний(-на)", "одинадцятиюрідний(-на)",
+ "дванадцятиюрідний(-на)", "тринадцятиюрідний(-на)",
+ "чотирнадцятиюрідний(-на)", "п'ятнадцятиюрідний(-на)",
+ "шістнадцятиюрідний(-на)", "сімнадцятиюрідний(-на)",
+ "вісімнадцятиюрідний(-на)", "дев'ятнадцятиюрідний(-на)",
+ "двадцятиюрідний(-на)"
+]
+_level_name_male = [
+ "",
+ "рідний", "двоюрідний", "троюрідний",
+ "чотириюрідний", "п'ятиюрідний", "шестиюрідний",
+ "семиюрідний", "восьмиюрідний", "дев'ятиюрідний",
+ "десятиюрідний", "одинадцятиюрідний", "дванадцятиюрідний",
+ "тринадцятиюрідний", "чотирнадцятиюрідний", "п'ятнадцятиюрідний",
+ "шістнадцятиюрідний", "сімнадцятиюрідний", "вісімнадцятиюрідний",
+ "дев'ятнадцятиюрідний", "двадцятиюрідний"
+]
+_level_name_female = [
+ "",
+ "рідна", "двоюрідна", "троюрідна",
+ "чотириюріднa", "п'ятиюрідна", "шестиюрідна",
+ "семиюрідна", "восьмиюрідна", "дев'ятиюрідна",
+ "десятиюрідна", "одинадцятиюрідна", "дванадцятиюрідна",
+ "тринадцятиюрідна", "чотирнадцятиюрідна", "п'ятнадцятиюрідна",
+ "шістнадцятиюрідна", "сімнадцятиюрідна", "вісімнадцятиюрідна",
+ "дев'ятнадцятиюрідна", "двадцятиюрідна"
+]
+
+_son_level = [
+ "",
+ "син",
+ "внук",
+ "правнук",
+ "праправнук",
+]
+
+_daughter_level = [
+ "",
+ "дочка",
+ "онука",
+ "правнучка",
+ "праправнучка",
+]
+
+_father_level = [
+ "",
+ "батько",
+ "дід",
+ "прадід",
+ "прапрадід",
+]
+
+_mother_level = [
+ "",
+ "мати",
+ "баба",
+ "прабаба",
+ "прапрабаба",
+]
+
+_uncle_level = [
+ "",
+ "брат", # not used, just for keep count
+ "дядько",
+ "дід",
+ "прадід",
+ "прапрадід",
+]
+
+_aunt_level = [
+ "",
+ "сестра", # not used, just for keep count
+ "тітка",
+ "баба",
+ "прабаба",
+ "прапрабаба",
+]
+
+
+#-------------------------------------------------------------------------
+#
+#
+#
+#-------------------------------------------------------------------------
+
+class RelationshipCalculator(gramps.gen.relationship.RelationshipCalculator):
+ """
+ RelationshipCalculator Class
+ """
+
+ def __init__(self):
+ gramps.gen.relationship.RelationshipCalculator.__init__(self)
+
+ def get_sword_distaff(self, level, reltocommon, gender = Person.UNKNOWN):
+ """
+ Generate relationships 'by male line' or 'by female line',
+ specific for Ukraine
+ """
+ if level <= 1:
+ return ""
+
+ # test the relation line
+ by_line = ''
+ for g in reltocommon:
+ if(by_line and by_line != g):
+ by_line = ''
+ break
+ by_line = g
+
+ if by_line == self.REL_FATHER and gender == Person.MALE:
+ # by male line
+ return " по чоловічій лінії"
+ elif by_line == self.REL_MOTHER and gender == Person.FEMALE:
+ # by male line
+ return " по жіночій лінії"
+ elif reltocommon[0] == self.REL_FATHER:
+ # From father's side
+ return " по батькові"
+ elif reltocommon[0] == self.REL_MOTHER:
+ # From mother's side
+ return " по матері"
+ else:
+ return ""
+
+
+ def get_son(self, level, inlaw=''):
+ """
+ Provides information how much male descendant is related to this person
+ """
+ # Define if the person is natural relative or in law
+ if inlaw == '':
+ t_inlaw = ""
+ else:
+ t_inlaw = "названий "
+
+ if level >= 0 and level < len(_son_level):
+ return t_inlaw +_son_level[level]
+ else:
+ return t_inlaw + "пра(пра)внук у %d поколінні" % (level + 1)
+
+
+
+ def get_daughter(self, level, inlaw=''):
+ """
+ Provides information how much female descendant is related to this person
+ """
+ # Define if the person is natural relative or in law
+ if inlaw == '':
+ t_inlaw = ""
+ else:
+ t_inlaw = "названа "
+
+ if level >= 0 and level < len(_daughter_level):
+ return t_inlaw + _daughter_level[level]
+ else:
+ return t_inlaw + "пра(пра)внучка у %d поколінні" % (level + 1)
+
+
+ def get_child_unknown(self, level, inlaw=''):
+ """
+ Provides information how much descendant of unknown gender is related to this person
+ """
+ # Define if the person is natural relative or in law
+ if inlaw == '':
+ t_inlaw = ""
+ else:
+ t_inlaw = "названий(на) "
+
+ if level == 1:
+ return t_inlaw + "внук(а)"
+ else:
+ return t_inlaw + "пра(пра)внук(а) у %d поколінні" % (level + 1)
+
+
+ def get_father(self, level, reltocommon, inlaw=''):
+ """
+ Provides information how much male ancestor (for example father)
+ is related to the given person
+ """
+ if inlaw == '':
+ t_inlaw = ""
+ else:
+ t_inlaw = "названий "
+
+ if level >= 0 and level < len(_father_level):
+ # If you know exact name of relationship - use it
+ if level == 1:
+ # Father
+ return t_inlaw + _father_level[level]
+ else:
+ # Grandfather, Greatgrandfather, Greatgreatgrandfather
+ return t_inlaw + _father_level[level] \
+ + self.get_sword_distaff(level, reltocommon, Person.MALE)
+ else:
+ # For deep generations
+ return t_inlaw + "пра(пра)дід у %d поколінні" % (level + 1) \
+ + self.get_sword_distaff(level, reltocommon, Person.MALE)
+
+
+ def get_mother(self, level, reltocommon, inlaw=''):
+ """
+ Provides information how much female ancestor (for example mother)
+ is related to the given person
+ """
+ if inlaw == '':
+ t_inlaw = ""
+ else:
+ t_inlaw = "названа "
+
+ if level >= 0 and level < len(_mother_level):
+ # If you know exact name of relationship - use it
+ if level == 1:
+ # Mother
+ return t_inlaw + _mother_level[level]
+
+ else:
+ # Grandmother, Greatgrandmother, Greatgreatgrandmother
+ return t_inlaw + _mother_level[level] \
+ + self.get_sword_distaff(level, reltocommon, Person.FEMALE)
+ else:
+ # For deep generations
+ return t_inlaw + "пра(пра)баба у %d поколінні" % (level + 1) \
+ + self.get_sword_distaff(level, reltocommon, Person.FEMALE)
+
+
+
+ def get_parent_unknown(self, level, reltocommon, inlaw=''):
+ """
+ Provides information how much an ancestor of unknown gender
+ is related to the given person (unknown sex)
+ """
+ if inlaw == '':
+ t_inlaw = ""
+ else:
+ t_inlaw = "названий "
+
+ if level == 1:
+ return t_inlaw + "батько/мати"
+ else:
+ return t_inlaw + "пра(пра)- дід/баба у %d поколінні" % (level + 1) \
+ + self.get_sword_distaff(level, reltocommon)
+
+
+ def get_uncle(self, level, reltocommon, inlaw = ''):
+ """
+ Return ancle generation name
+ """
+
+ if reltocommon[0] == self.REL_FATHER:
+ # from Father
+ if level < len(_uncle_level):
+ if level == 2:
+ return _uncle_level[level] + " (стрийко)"
+ else:
+ return "двоюрідний " + _uncle_level[level] \
+ + " по батькові"
+ else:
+ return "двоюрідний пра(пра)дід в %d поколінні по батькові" % (level)
+ elif reltocommon[0] == self.REL_MOTHER:
+ # from Mother
+ if level < len(_uncle_level):
+ if level == 2:
+ return _uncle_level[level] + " (вуйко)"
+ else:
+ return "двоюрідний " + _uncle_level[level] \
+ + " по матері"
+ else:
+ return "двоюрідний пра(пра)дід в %d поколінні по матері" % (level)
+ else:
+ if level == 2:
+ return "дядько (стрийко/вуйко)"
+ else:
+ return "двоюрідний пра(пра)дід в %d поколінні" % (level)
+
+
+ def get_aunt(self, level, reltocommon, inlaw = ''):
+ """
+ Return aunt generation name
+ """
+
+ if reltocommon[0] == self.REL_FATHER:
+ # from Father
+ if level < len(_aunt_level):
+ if level == 2:
+ return _aunt_level[level] + " (стрийна)"
+ else:
+ return "двоюрідна " + _aunt_level[level] \
+ + " по батькові"
+ else:
+ return "двоюрідна пра(пра)баба в %d поколінні по батькові" \
+ % (level)
+ elif reltocommon[0] == self.REL_MOTHER:
+ # from Mother
+ if level < len(_aunt_level):
+ if level == 2:
+ return _aunt_level[level] + " (вуйна)"
+ else:
+ return "двоюрідна " + _aunt_level[level] \
+ + " по матері"
+ else:
+ return "двоюрідна пра(пра)баба в %d поколінні по матері" \
+ % (level)
+ else:
+ if level == 2:
+ return "тітка (стрийна/вуйна)"
+ else:
+ return "двоюрідна пра(пра)баба в %d поколінні" % (level)
+
+
+ def get_uncle_aunt_unknown(self, level, reltocommon, inlaw = ''):
+ """
+ Return uncle/aunt generation name when gender unknown
+ """
+
+ if reltocommon[0] == self.REL_FATHER:
+ # from Father
+ if level == 2:
+ return "дядько/тітка (стрийко)"
+ else:
+ return "двоюрідний дід/баба в %d поколінні по батькові" \
+ % (level)
+ elif reltocommon[0] == self.REL_MOTHER:
+ # from Mother
+ if level == 2:
+ return "дядько/тітка (вуйко)"
+ else:
+ return "двоюрідний дід/баба в %d поколінні по матері" \
+ % (level)
+ else:
+ if level == 2:
+ return "дядько/тітка"
+ else:
+ return "двоюрідний дід/баба в %d поколінні" % (level)
+
+
+ def get_nephew(self, level, reltocommon, inlaw = ''):
+ """
+ Return nephew generation name
+ """
+ if inlaw == '':
+ t_inlaw = ""
+ else:
+ t_inlaw = "названий "
+
+ if level == 2:
+ if reltocommon[0] == self.REL_FATHER :
+ # Brother's son
+ return t_inlaw + "небіж (братанець)"
+ elif reltocommon[0] == self.REL_MOTHER :
+ # Sister's son
+ return t_inlaw + "небіж (сестринець)"
+ else:
+ return t_inlaw + "небіж (братанець/сестринець)"
+ elif level >= 2 and level <=6:
+ if reltocommon[level-2] == self.REL_FATHER :
+ # Brother's son generation
+ if reltocommon[level-3] == self.REL_FATHER :
+ # Son of brother son
+ return self.get_son((level - 2), inlaw) \
+ + " небожа по брату"
+ elif reltocommon[level-3] == self.REL_MOTHER :
+ # Son of brother daughter
+ return self.get_son((level - 2), inlaw) \
+ + " небоги по брату"
+ else:
+ return self.get_son((level - 2), inlaw) \
+ + " небожа/небоги по брату"
+ elif reltocommon[level-2] == self.REL_MOTHER :
+ # Sister's son generation
+ if reltocommon[level-3] == self.REL_FATHER :
+ # Son of sister son
+ return self.get_son((level - 2), inlaw) \
+ + " небожа по сестрі"
+ elif reltocommon[level-3] == self.REL_MOTHER :
+ # Son of sister daughter
+ return self.get_son((level - 2), inlaw) \
+ + " небоги по сестрі"
+ else:
+ return self.get_son((level - 2), inlaw) \
+ + " небожа/небоги по сестрі"
+ else:
+ return self.get_son((level - 2), inlaw) + " небожа/небоги"
+ else:
+ if reltocommon[level-2] == self.REL_FATHER :
+ # Brother's son generation
+ return t_inlaw + "чоловічий нащадок у %d поколінні брата" \
+ % (level)
+ elif reltocommon[level-2] == self.REL_MOTHER :
+ # Sister's son generation
+ return t_inlaw + "чоловічий нащадок у %d поколінні сестри" \
+ % (level)
+ else:
+ return t_inlaw + "чоловічий нащадок у %d поколінні брата/сестри" \
+ % (level)
+
+
+
+ def get_niece(self, level, reltocommon, inlaw = ''):
+ """
+ Return niece generation name
+ """
+ if inlaw == '':
+ t_inlaw = ""
+ else:
+ t_inlaw = "названий "
+
+ if level == 2:
+ if reltocommon[0] == self.REL_FATHER :
+ # Brother's daughter
+ return t_inlaw + "небога (братанка)"
+ elif reltocommon[0] == self.REL_MOTHER :
+ # Sister's daughter
+ return t_inlaw + "небога (сестрениця)"
+ else:
+ return t_inlaw + "небога (братанка/сестрениця)"
+ elif level >= 2 and level <=6:
+ if reltocommon[level-2] == self.REL_FATHER :
+ # Brother's daughter generation
+ if reltocommon[level-3] == self.REL_FATHER :
+ # daughter of brother son
+ return self.get_daughter((level - 2), inlaw) \
+ + " небожа по брату"
+ elif reltocommon[level-3] == self.REL_MOTHER :
+ # daughter of brother daughter
+ return self.get_daughter((level - 2), inlaw) \
+ + " небоги по брату"
+ else:
+ return self.get_daughter((level - 2), inlaw) \
+ + " небожа/небоги по брату"
+ elif reltocommon[level-2] == self.REL_MOTHER :
+ # Sister's daughter generation
+ if reltocommon[level-3] == self.REL_FATHER :
+ # daughter of sister son
+ return self.get_daughter((level - 2), inlaw) \
+ + " небожа по сестрі"
+ elif reltocommon[level-3] == self.REL_MOTHER :
+ # daughter of sister daughter
+ return self.get_daughter((level - 2), inlaw) \
+ + " небоги по сестрі"
+ else:
+ return self.get_daughter((level - 2), inlaw) \
+ + " небожа/небоги по сестрі"
+ else:
+ return self.get_daughter(level, inlaw) + " небожа/небоги"
+ else:
+ if reltocommon[level-2] == self.REL_FATHER :
+ # Brother's daughter generation
+ return t_inlaw + "жіночий нащадок у %d поколінні брата" \
+ % (level)
+ elif reltocommon[level-2] == self.REL_MOTHER :
+ # Sister's daughter generation
+ return t_inlaw + "жіночий нащадок у %d поколінні сестри" \
+ % (level)
+ else:
+ return t_inlaw + "жіночий нащадок у %d поколінні брата/сестри" \
+ % (level)
+
+
+ def get_nephew_niece_unknown (self, level, reltocommon, inlaw = ''):
+ """
+ Return nephew/niece generation name when gender unknown
+ """
+ if inlaw == '':
+ t_inlaw = ""
+ else:
+ t_inlaw = "названий "
+
+ if reltocommon[level-2] == self.REL_FATHER:
+ # Brother's descendant
+ return t_inlaw + "нащадок в %d поколінні брата" % (level)
+ elif (reltocommon[level-2] == self.REL_MOTHER):
+ # Sister's descendant
+ return t_inlaw + "нащадок в %d поколінні сестри" % (level)
+ else :
+ return t_inlaw + "нащадок в %d поколінні брата aбо сестри" \
+ % (level)
+
+
+ def get_level(self, level, gender):
+ """
+ Return level name depend of gender
+ """
+ if (gender == Person.MALE):
+ if level < len(_level_name_male):
+ return _level_name_male[level]
+ else:
+ return "%d-юрідний" % level
+ elif (gender == Person.FEMALE):
+ if level < len(_level_name_female):
+ return _level_name_female[level]
+ else:
+ return "%d-юрідна" % level
+ else:
+ if level < len(_level_name):
+ return _level_name[level]
+ else:
+ return "%d-юрідний(на)" % level
+
+
+
+
+ def get_single_relationship_string(self, Ga, Gb, gender_a, gender_b,
+ reltocommon_a, reltocommon_b,
+ only_birth=True,
+ in_law_a=False, in_law_b=False):
+ """
+ Provide a string that describes the relationsip between a person, and
+ another person. E.g. "grandparent" or "child".
+
+ Ga: The number of generations between the main person and the
+ common ancestor. (кількість поколінь між прямими родичами особи:
+ сини, батьки, бабусі...)
+
+ Gb: The number of generations between the other person and the
+ common ancestor. (кількість поколінь між іншою особою
+ і спільним предком)
+
+ gender_a : gender of person a
+
+ gender_b : gender of person b
+
+ reltocommon_a : relation path to common ancestor or common
+ Family for person a.
+ Note that length = Ga
+ reltocommon_b : relation path to common ancestor or common
+ Family for person b.
+ Note that length = Gb
+
+ in_law_a : True if path to common ancestors is via the partner
+ of person a
+
+ in_law_b : True if path to common ancestors is via the partner
+ of person b
+
+ only_birth : True if relation between a and b is by birth only
+ False otherwise
+
+ more see in relationship.py get_single_relationship_string()
+ """
+
+ if only_birth:
+ step = ''
+ else:
+ step = self.STEP
+
+ if in_law_a or in_law_b :
+ inlaw = self.INLAW
+ else:
+ inlaw = ''
+
+ t_inlaw = ""
+
+ # b is the same person as a
+ if Ga == Gb == 0:
+ rel_str = 'та сама особа'
+
+ elif Ga == 0:
+ # b is son/descendant of a
+
+ if gender_b == Person.MALE:
+ if inlaw and Gb == 1 and not step:
+ rel_str = "зять"
+ else:
+ rel_str = self.get_son(Gb, inlaw)
+
+ elif gender_b == Person.FEMALE:
+ if inlaw and Gb == 1 and not step:
+ rel_str = "невістка"
+ else:
+ rel_str = self.get_daughter(Gb, inlaw)
+
+ else:
+ rel_str = self.get_child_unknown(Gb, inlaw)
+
+
+ elif Gb == 0:
+ # b is parent/grand parent of a
+
+ if gender_b == Person.MALE:
+ if inlaw and Gb == 1 and not step:
+ rel_str = "тесть"
+ else:
+ rel_str = self.get_father(Ga, reltocommon_a, inlaw)
+
+ elif gender_b == Person.FEMALE:
+ if inlaw and Gb == 1 and not step:
+ rel_str = "теща"
+ else:
+ rel_str = self.get_mother(Ga, reltocommon_a, inlaw)
+
+ else:
+ rel_str = self.get_parent_unknown(Ga, reltocommon_a, inlaw)
+
+
+ elif Ga == Gb == 1:
+ # Family, brother/sister
+ # not used, leave it just in case
+ # because should be handled
+ # by get_sibling_relationship_string
+ # that called in parent RelationshipCalculator
+ # see Relationship.py
+
+ if gender_b == Person.MALE:
+ if inlaw and not step:
+ rel_str = "рідний брат"
+ else:
+ rel_str = "напів рідний брат"
+
+ elif gender_b == Person.FEMALE:
+ if inlaw and not step:
+ rel_str = "рідна сестра"
+ else:
+ rel_str = "напів рідна сестра"
+ else:
+ rel_str = "брат/сестра"
+
+ elif Gb == 1 and Ga > 1:
+ # b is aunt/uncle of a
+
+ if (gender_b == Person.MALE):
+ rel_str = self.get_uncle(Ga, reltocommon_a, inlaw)
+ elif (gender_b == Person.FEMALE):
+ rel_str = self.get_aunt(Ga, reltocommon_a, inlaw)
+ else:
+ rel_str = self.get_uncle_aunt_unknown(Ga, reltocommon_a, inlaw)
+
+ elif Ga == 1 and Gb > 1:
+ # b is niece/nephew of a
+
+ if (gender_b == Person.MALE):
+ rel_str = self.get_nephew(Gb, reltocommon_b, inlaw)
+ elif (gender_b == Person.FEMALE):
+ rel_str = self.get_niece(Gb, reltocommon_b, inlaw)
+ else:
+ rel_str = self.get_nephew_niece_unknown(Gb, reltocommon_b, inlaw)
+
+
+ elif Ga > 1 and Gb > 1:
+ # b is (cousin/far aunt/far uncle/far niece/far nephew) of a
+
+ if Ga > Gb:
+ # b is far aunt/far uncle of a
+ level = Ga - Gb + 1
+ if level >= 3:#it is right or???
+ level_name = self.get_level(Gb + 1, gender_b)
+ else:
+ level_name = self.get_level(Gb, gender_b)
+
+
+ if (gender_b == Person.MALE):
+ # b is far uncle
+ if inlaw != '':
+ t_inlaw = "названий "
+ if level < len(_uncle_level):
+ rel_str = t_inlaw + "%s %s" \
+ % (level_name, _uncle_level[level])
+ else:
+ rel_str = t_inlaw + "%s пра(пра)дід в %d поколінні" \
+ % (level_name, (level))
+ elif (gender_b == Person.FEMALE):
+ # b is far aunt
+ if inlaw != '':
+ t_inlaw = "названа "
+ if level < len(_aunt_level):
+ rel_str = t_inlaw + "%s %s" \
+ % (level_name, _aunt_level[level])
+ else:
+ rel_str = t_inlaw + "%s пра(пра)баба в %d поколінні" \
+ % (level_name, (level))
+ else:
+ if inlaw != '':
+ t_inlaw = "названий(на) "
+ if level == 2:
+ rel_str = t_inlaw + "%s дядько/тітка" % level_name
+ else:
+ rel_str = t_inlaw + "%s пра(пра)- дід/баба в %d поколінні" \
+ % (level_name, (level))
+
+ elif Ga < Gb:
+ # b is far niece/far nephew of a
+ level_name = self.get_level(Ga, gender_b)
+ level = Gb - Ga + 1
+
+ if (gender_b == Person.MALE):
+ # b is far nephew
+ if level == 2:
+ rel_str = "%s небіж" % level_name
+ else:
+ rel_str = "%s пра(пра)внук у %d поколінні" \
+ % (level_name, level)
+ #rel_str = "%s %s" % (level_name, self.get_nephew(level, reltocommon_b, inlaw))
+ elif (gender_b == Person.FEMALE):
+ # b is far niece
+ if level == 2:
+ rel_str = "%s небога" % level_name
+ else:
+ rel_str = "%s пра(пра)внучка у %d поколінні" \
+ % (level_name, level)
+ #rel_str = "%s %s" % (level_name, self.get_niece(level, reltocommon_b, inlaw))
+ else:
+ rel_str = "%s пра(пра)внук(а) у %d поколінні" % level
+ #rel_str = "%s %s" % (level_name, self.get_nephew_niece_unknown(level, reltocommon_b, inlaw))
+
+ else: #Gb == Ga
+ # b is cousin of a
+ level_name = self.get_level(Ga, gender_b)
+
+ if (gender_b == Person.MALE):
+ if inlaw != '':
+ t_inlaw = "названий "
+ rel_str = t_inlaw + "%s брат" % level_name
+ elif (gender_b == Person.FEMALE):
+ if inlaw != '':
+ t_inlaw = "названа "
+ rel_str = t_inlaw + "%s сестра" % level_name
+ else:
+ if inlaw != '':
+ t_inlaw = "названий(на) "
+ rel_str = t_inlaw + "%s брат/сестра" % level_name
+
+ else:
+ # A program should never goes there, but...
+ rel_str = "невизначений ступінь спорідненості"
+
+ return rel_str
+
+ def get_plural_relationship_string(self, Ga, Gb,
+ reltocommon_a='', reltocommon_b='',
+ only_birth=True,
+ in_law_a=False, in_law_b=False):
+ """
+ Generate a text with information, how far away is a group of persons
+ from a main person
+ """
+
+ if Ga == Gb == 0:
+ return 'та сама особа'
+ if 0 == Ga:
+ # These are descendants
+ if 1 == Gb:
+ return 'діти'
+ if 2 == Gb:
+ return 'внуки'
+ if 3 == Gb:
+ return 'правнуки'
+ if 4 == Gb:
+ return 'праправнуки'
+ return 'прапрапра(n)внуки'
+ if 0 == Gb:
+ # These are parents/grand parents
+ if 1 == Ga:
+ return 'батьки'
+ if 2 == Ga:
+ return 'діди/баби'
+ if 3 == Ga:
+ return 'прадіди/прабаби'
+ if 4 == Ga:
+ return 'прапращури'
+ return 'прапрапра(n)щури'
+ if 1 == Ga == Gb:
+ return 'батьки'
+ if 1 == Gb and Ga > 1:
+ return 'дядьки (вуйки, стрийки) і тітки'
+ if 1 < Gb and 1 == Ga:
+ return 'небожі по братові і сестрі'
+ if 1 < Ga and 1 < Gb:
+ return 'дальня родина'
+ return 'відносини невідомі'
+
+
+
+ def get_sibling_relationship_string(self, sib_type, gender_a, gender_b,
+ in_law_a=False, in_law_b=False):
+
+ if in_law_a or in_law_b :
+ inlaw = self.INLAW
+ else:
+ inlaw = ''
+
+ if sib_type == self.NORM_SIB:
+ if not inlaw:
+ if gender_b == Person.MALE:
+ rel_str = 'рідний брат'
+ elif gender_b == Person.FEMALE:
+ rel_str = 'рідна сестра'
+ else:
+ rel_str = 'рідний(а) брат або сестра'
+ else:
+ if gender_b == Person.MALE:
+ rel_str = "названий брат"
+ elif gender_b == Person.FEMALE:
+ rel_str = "названа сестра"
+ else:
+ rel_str = "названий(а) брат або сестра"
+ elif sib_type == self.UNKNOWN_SIB:
+ if not inlaw:
+ if gender_b == Person.MALE:
+ rel_str = 'брат'
+ elif gender_b == Person.FEMALE:
+ rel_str = 'сестра'
+ else:
+ rel_str = 'брат або сестра'
+ else:
+ if gender_b == Person.MALE:
+ rel_str = "швагро"
+ elif gender_b == Person.FEMALE:
+ rel_str = "братова"
+ else:
+ rel_str = "швагро або братова"
+ elif sib_type == self.HALF_SIB_FATHER:
+ if gender_b == Person.MALE:
+ rel_str = "єдинокровний(напіврідний) брат"
+ elif gender_b == Person.FEMALE:
+ rel_str = "єдинокровна(напіврідна) сестра"
+ else:
+ rel_str = "напіврідний(а) брат/сестра"
+ elif sib_type == self.HALF_SIB_MOTHER:
+ if gender_b == Person.MALE:
+ rel_str = "єдинокровний(напіврідний) брат"
+ elif gender_b == Person.FEMALE:
+ rel_str = "єдинокровна(напіврідна) сестра"
+ else:
+ rel_str = "напіврідний(а) брат/сестра"
+ elif sib_type == self.STEP_SIB:
+ if gender_b == Person.MALE:
+ rel_str = "зведений брат"
+ elif gender_b == Person.FEMALE:
+ rel_str = "зведена сестра"
+ else:
+ rel_str = "зведений брат або сестра"
+ else:
+ rel_str = "невизначена ступінь родинних відносин"
+ return rel_str
+
+
+if __name__ == "__main__":
+ # Test function. Call it as follows from the command line (so as to find
+ # imported modules):
+ # export PYTHONPATH=/path/to/gramps/src
+ # python src/plugins/rel/rel_pl.py
+
+
+ """
+ TRANSLATORS, copy this if statement at the bottom of your
+ rel_xx.py module, and test your work with:
+ python src/plugins/rel/rel_xx.py
+ """
+ from gramps.gen.relationship import test
+ import signal
+ import sys
+ # If someone go out
+ def goodby(signal, frame):
+ print 'No more Drink!'
+ sys.exit(0)
+ signal.signal(signal.SIGINT, goodby)
+ # Run test
+ RC = RelationshipCalculator()
+ test(RC, True)
+
diff --git a/gramps/plugins/rel/relplugins.gpr.py b/gramps/plugins/rel/relplugins.gpr.py
index 0ac99c782..c028a59ac 100644
--- a/gramps/plugins/rel/relplugins.gpr.py
+++ b/gramps/plugins/rel/relplugins.gpr.py
@@ -295,3 +295,19 @@ plg.relcalcclass = 'RelationshipCalculator'
plg.lang_list = ["sv", "SV", "sv_SE", "swedish", "Swedish", "sv_SE.UTF8",
"sv_SE@euro", "sv_SE.UTF8@euro", "svenska", "Svenska",
"sv_SE.UTF-8", "sv_SE.utf-8", "sv_SE.utf8", "Swedish_Sweden"]
+# uk
+plg = newplugin()
+plg.id = 'relcalc_uk'
+plg.name = _("Ukrainian Relationship Calculator")
+plg.description = _("Calculates relationships between people")
+plg.version = '1.0'
+plg.gramps_target_version = '4.1'
+plg.status = STABLE
+plg.fname = 'rel_uk.py'
+plg.ptype = RELCALC
+plg.relcalcclass = 'RelationshipCalculator'
+plg.lang_list = ["uk", "UA", "uk_UA", "ukrainian",
+ "Ukrainian", "uk_UA.utf8",
+ "uk_UA.UTF8", "uk_UA.utf-8", "uk_UA.UTF-8", "uk_UA.iso88595",
+ "uk_UA.iso8859-5", "uk_UA.iso-8859-5", "koi8u", "uk_koi8u",
+ "uk_UA.koi8u","uk_UA.KOI8-U",]
diff --git a/gramps/plugins/tool/relcalc.py b/gramps/plugins/tool/relcalc.py
index ca7fd0716..ae5a1e4dd 100644
--- a/gramps/plugins/tool/relcalc.py
+++ b/gramps/plugins/tool/relcalc.py
@@ -95,7 +95,7 @@ class RelCalc(tool.Tool, ManagedWindow):
self.colord.append((0, col, size))
self.dbstate = dbstate
- self.relationship = get_relationship_calculator()
+ self.relationship = get_relationship_calculator(glocale)
self.relationship.connect_db_signals(dbstate)
self.glade = Glade()
diff --git a/gramps/plugins/view/citationtreeview.py b/gramps/plugins/view/citationtreeview.py
index 162e0b857..7044c20e7 100644
--- a/gramps/plugins/view/citationtreeview.py
+++ b/gramps/plugins/view/citationtreeview.py
@@ -156,6 +156,17 @@ class CitationTreeView(ListView):
self.additional_uis.append(self.additional_ui())
+ # Override change_active from NavigationView, so that only Citations can be
+ # put in the history list for the CitationTreeView
+ def change_active(self, handle):
+ if self.dbstate.db.get_citation_from_handle(handle):
+ super(CitationTreeView, self).change_active(handle)
+ else:
+ # FIXME: See http://www.gramps-project.org/bugs/view.php?id=6352 a
+ # more comprehensive solution is needed in the long term. See also
+ # add in Bookmarks.CitationBookmarks
+ pass
+
def setup_filter(self):
"""
Override the setup of the default Search Bar in listview, so that only
diff --git a/gramps/plugins/view/pedigreeview.py b/gramps/plugins/view/pedigreeview.py
index 05c2451ec..9a4f75f7b 100644
--- a/gramps/plugins/view/pedigreeview.py
+++ b/gramps/plugins/view/pedigreeview.py
@@ -606,6 +606,11 @@ class PedigreeView(NavigationView):
self.scrolledwindow.add_with_viewport(event_box)
self.table = Gtk.Grid()
+ # force LTR layout of the tree, even though the text might be RTL!
+ # this way the horizontal scroll preferences will be correct always
+ if self.table.get_direction() == Gtk.TextDirection.RTL:
+ self.table.set_direction(Gtk.TextDirection.LTR)
+ self.table.set_halign(Gtk.Align.END)
event_box.add(self.table)
event_box.get_parent().set_shadow_type(Gtk.ShadowType.NONE)
self.table.set_row_spacing(1)
@@ -1101,6 +1106,10 @@ class PedigreeView(NavigationView):
elif self.tree_direction == 3:
child_arrow = Gtk.ArrowType.RIGHT
parent_arrow = Gtk.ArrowType.LEFT
+ # GTK will reverse the icons for RTL locales, but we force LTR layout of the table,
+ # so reverse the arrows back...
+ if self.tree_direction in [2,3] and self.scrolledwindow.get_direction() == Gtk.TextDirection.RTL:
+ child_arrow, parent_arrow = parent_arrow, child_arrow
button = Gtk.Button()
button.add(Gtk.Arrow.new(child_arrow, Gtk.ShadowType.IN))
@@ -1324,7 +1333,7 @@ class PedigreeView(NavigationView):
or call option menu.
"""
if event.button == 1 and event.type == Gdk.EventType.BUTTON_PRESS:
- widget.get_root_window().set_cursor(Gdk.Cursor.new(Gdk.CursorType.FLEUR))
+ widget.get_window().set_cursor(Gdk.Cursor.new(Gdk.CursorType.FLEUR))
self._last_x = event.x
self._last_y = event.y
self._in_move = True
@@ -1338,7 +1347,7 @@ class PedigreeView(NavigationView):
"""Exit from scroll mode when button release."""
if event.button == 1 and event.type == Gdk.EventType.BUTTON_RELEASE:
self.cb_bg_motion_notify_event(widget, event)
- widget.get_root_window().set_cursor(None)
+ widget.get_window().set_cursor(None)
self._in_move = False
return True
return False
diff --git a/gramps/plugins/webstuff/images/document.png b/gramps/plugins/webstuff/images/document.png
deleted file mode 100644
index bfe4bad56..000000000
Binary files a/gramps/plugins/webstuff/images/document.png and /dev/null differ
diff --git a/gramps/plugins/webstuff/images/gramps-geo-altmap.svg b/gramps/plugins/webstuff/images/gramps-geo-altmap.svg
deleted file mode 100644
index 1b92d4c26..000000000
--- a/gramps/plugins/webstuff/images/gramps-geo-altmap.svg
+++ /dev/null
@@ -1,177 +0,0 @@
-
-
-
-
diff --git a/gramps/plugins/webstuff/images/gramps-geo-birth.svg b/gramps/plugins/webstuff/images/gramps-geo-birth.svg
deleted file mode 100644
index e88c5000a..000000000
--- a/gramps/plugins/webstuff/images/gramps-geo-birth.svg
+++ /dev/null
@@ -1,1370 +0,0 @@
-
-
-
-
diff --git a/gramps/plugins/webstuff/images/gramps-geo-death.svg b/gramps/plugins/webstuff/images/gramps-geo-death.svg
deleted file mode 100644
index 37c9fdc71..000000000
--- a/gramps/plugins/webstuff/images/gramps-geo-death.svg
+++ /dev/null
@@ -1,1438 +0,0 @@
-
-
-
-
diff --git a/gramps/plugins/webstuff/images/gramps-geo-mainmap.svg b/gramps/plugins/webstuff/images/gramps-geo-mainmap.svg
deleted file mode 100644
index 09814069c..000000000
--- a/gramps/plugins/webstuff/images/gramps-geo-mainmap.svg
+++ /dev/null
@@ -1,162 +0,0 @@
-
-
-
-
diff --git a/gramps/plugins/webstuff/images/gramps-geo-marriage.svg b/gramps/plugins/webstuff/images/gramps-geo-marriage.svg
deleted file mode 100644
index 2087e3a62..000000000
--- a/gramps/plugins/webstuff/images/gramps-geo-marriage.svg
+++ /dev/null
@@ -1,1052 +0,0 @@
-
-
-
-
diff --git a/gramps/plugins/webstuff/webstuff.py b/gramps/plugins/webstuff/webstuff.py
index 5aebfe56a..12741be46 100644
--- a/gramps/plugins/webstuff/webstuff.py
+++ b/gramps/plugins/webstuff/webstuff.py
@@ -25,7 +25,7 @@
# python modules
#------------------------------------------------
import os
-from gramps.gen.const import VERSION_DIR
+from gramps.gen.const import VERSION_DIR, IMAGE_DIR, DATA_DIR
from gramps.gen.const import GRAMPS_LOCALE as glocale
_ = glocale.translation.sgettext
@@ -47,11 +47,10 @@ def load_on_reg(dbstate, uistate, plugin):
"""
Runs when plugin is registered.
"""
- dir, fname = os.path.split(__file__)
from functools import partial
- path_css = partial(os.path.join, dir, "css")
- path_img = partial(os.path.join, dir, "images")
- path_js = partial(os.path.join, dir, "js")
+ path_css = partial(os.path.join, DATA_DIR, "css")
+ path_img = partial(os.path.join, IMAGE_DIR, "webstuff")
+ path_js = partial(os.path.join, DATA_DIR, "javascript")
CSS_FILES = [
# id, user selectable?, translated_name, option name, fullpath,
@@ -160,7 +159,7 @@ def load_on_reg(dbstate, uistate, plugin):
# Document image
["Document", 0, "Document",
- path_img("document.png"), None, [], [] ],
+ os.path.join(IMAGE_DIR, "document.png"), None, [], [] ],
# blank
["Blank", 0, "Blank",
diff --git a/gramps/plugins/webstuff/images/Web_Gender_Female.png b/images/webstuff/Web_Gender_Female.png
similarity index 100%
rename from gramps/plugins/webstuff/images/Web_Gender_Female.png
rename to images/webstuff/Web_Gender_Female.png
diff --git a/gramps/plugins/webstuff/images/Web_Gender_Male.png b/images/webstuff/Web_Gender_Male.png
similarity index 100%
rename from gramps/plugins/webstuff/images/Web_Gender_Male.png
rename to images/webstuff/Web_Gender_Male.png
diff --git a/gramps/plugins/webstuff/images/Web_Mainz_Bkgd.png b/images/webstuff/Web_Mainz_Bkgd.png
similarity index 100%
rename from gramps/plugins/webstuff/images/Web_Mainz_Bkgd.png
rename to images/webstuff/Web_Mainz_Bkgd.png
diff --git a/gramps/plugins/webstuff/images/Web_Mainz_Header.png b/images/webstuff/Web_Mainz_Header.png
similarity index 100%
rename from gramps/plugins/webstuff/images/Web_Mainz_Header.png
rename to images/webstuff/Web_Mainz_Header.png
diff --git a/gramps/plugins/webstuff/images/Web_Mainz_Mid.png b/images/webstuff/Web_Mainz_Mid.png
similarity index 100%
rename from gramps/plugins/webstuff/images/Web_Mainz_Mid.png
rename to images/webstuff/Web_Mainz_Mid.png
diff --git a/gramps/plugins/webstuff/images/Web_Mainz_MidLight.png b/images/webstuff/Web_Mainz_MidLight.png
similarity index 100%
rename from gramps/plugins/webstuff/images/Web_Mainz_MidLight.png
rename to images/webstuff/Web_Mainz_MidLight.png
diff --git a/gramps/plugins/webstuff/images/blank.gif b/images/webstuff/blank.gif
similarity index 100%
rename from gramps/plugins/webstuff/images/blank.gif
rename to images/webstuff/blank.gif
diff --git a/gramps/plugins/webstuff/images/crosshairs.png b/images/webstuff/crosshairs.png
similarity index 100%
rename from gramps/plugins/webstuff/images/crosshairs.png
rename to images/webstuff/crosshairs.png
diff --git a/gramps/plugins/webstuff/images/favicon.ico b/images/webstuff/favicon.ico
similarity index 100%
rename from gramps/plugins/webstuff/images/favicon.ico
rename to images/webstuff/favicon.ico
diff --git a/gramps/plugins/webstuff/images/favicon2.ico b/images/webstuff/favicon2.ico
similarity index 100%
rename from gramps/plugins/webstuff/images/favicon2.ico
rename to images/webstuff/favicon2.ico
diff --git a/gramps/plugins/webstuff/images/gramps-geo-altmap.png b/images/webstuff/gramps-geo-altmap.png
similarity index 100%
rename from gramps/plugins/webstuff/images/gramps-geo-altmap.png
rename to images/webstuff/gramps-geo-altmap.png
diff --git a/gramps/plugins/webstuff/images/gramps-geo-birth.png b/images/webstuff/gramps-geo-birth.png
similarity index 100%
rename from gramps/plugins/webstuff/images/gramps-geo-birth.png
rename to images/webstuff/gramps-geo-birth.png
diff --git a/gramps/plugins/webstuff/images/gramps-geo-death.png b/images/webstuff/gramps-geo-death.png
similarity index 100%
rename from gramps/plugins/webstuff/images/gramps-geo-death.png
rename to images/webstuff/gramps-geo-death.png
diff --git a/gramps/plugins/webstuff/images/gramps-geo-mainmap.png b/images/webstuff/gramps-geo-mainmap.png
similarity index 100%
rename from gramps/plugins/webstuff/images/gramps-geo-mainmap.png
rename to images/webstuff/gramps-geo-mainmap.png
diff --git a/gramps/plugins/webstuff/images/gramps-geo-marriage.png b/images/webstuff/gramps-geo-marriage.png
similarity index 100%
rename from gramps/plugins/webstuff/images/gramps-geo-marriage.png
rename to images/webstuff/gramps-geo-marriage.png
diff --git a/gramps/plugins/webstuff/images/somerights20.gif b/images/webstuff/somerights20.gif
similarity index 100%
rename from gramps/plugins/webstuff/images/somerights20.gif
rename to images/webstuff/somerights20.gif
diff --git a/mac/gramps.bundle b/mac/gramps.bundle
index 8b2bc4a30..d09962cec 100644
--- a/mac/gramps.bundle
+++ b/mac/gramps.bundle
@@ -72,10 +72,6 @@
${prefix}/lib/enchant
-
- ${prefix}/lib/libgettextpo.0.dylib
-
-
${prefix}/lib/libosmgpsmap.3.dylib
diff --git a/po/fr.po b/po/fr.po
index 5b450108c..68d2f90c2 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -3880,11 +3880,11 @@ msgstr "Âge"
#: ../gramps/gen/lib/attrtype.py:75
msgid "Father's Age"
-msgstr "Âge du père"
+msgstr "Âge du mari / compagnon"
#: ../gramps/gen/lib/attrtype.py:76
msgid "Mother's Age"
-msgstr "Âge de la mère"
+msgstr "Âge de la femme / compagne"
#: ../gramps/gen/lib/attrtype.py:77
#: ../gramps/gen/lib/eventroletype.py:66
@@ -31137,7 +31137,7 @@ msgstr "Organisation des vues
Quelques vues peuvent représenter vos
#: ../gramps/data/tips.xml.in.h:23
msgid "Navigating Back and Forward
Gramps maintains a list of previous active objects such as People, Events and . You can move forward and backward through the list using "Go > Forward" and "Go > Back" or the arrow buttons."
-msgstr "Navigation Précédent et Suivant
Gramps conserve une liste des objets actifs tels que les individus, événements lorsque vous naviguez dans votre base de données. Vous pouvez avancer et reculer dans la liste à l'aide de « Aller à > Suivant" et "Aller à > Précédent »."
+msgstr "Navigation Précédent et Suivant
Gramps conserve une liste des objets actifs tels que les individus, événements lorsque vous naviguez dans votre base de données. Vous pouvez avancer et reculer dans la liste à l'aide de « Aller à > Suivant" et "Aller à > Précédent »."
#: ../gramps/data/tips.xml.in.h:24
msgid "Keyboard Shortcuts
Tired of having to take your hand off the keyboard to use the mouse? Many functions in Gramps have keyboard shortcuts. If one exists for a function it is displayed on the right side of the menu."
diff --git a/po/ru.po b/po/ru.po
index 942187927..3279790f4 100644
--- a/po/ru.po
+++ b/po/ru.po
@@ -16,7 +16,7 @@ msgstr ""
"Project-Id-Version: ru\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-05-09 12:49+0200\n"
-"PO-Revision-Date: 2013-06-12 01:16+0300\n"
+"PO-Revision-Date: 2013-06-18 10:28+0300\n"
"Last-Translator: Vassilii Khachaturov \n"
"Language-Team: Russian \n"
"Language: ru\n"
@@ -92,7 +92,7 @@ msgstr "ОШИБКА: Неопознанный формат для файла э
#: ../gramps/cli/arghandler.py:405
msgid "List of known Family Trees in your database path\n"
msgstr ""
-"Путь к базе данных"
+"Путь к базе данных "
"с семейным древом\n"
#: ../gramps/cli/arghandler.py:410
@@ -218,6 +218,8 @@ msgstr "Неизвестное название книги."
#, python-format
msgid "Book name not given. Please use one of %(donottranslate)s=bookname."
msgstr ""
+"Не задано название книги. Пожалуйста, укажите одно из %"
+"(donottranslate)s=bookname."
#: ../gramps/cli/arghandler.py:706
#, python-format
@@ -679,7 +681,7 @@ msgstr ""
#: ../gramps/cli/plug/__init__.py:268
msgid "Output file name. MANDATORY"
-msgstr ""
+msgstr "Имя файла на выходе. ОБЯЗАТЕЛЬНО"
#: ../gramps/cli/plug/__init__.py:269
msgid "=format"
@@ -699,7 +701,7 @@ msgstr "Название стиля."
#: ../gramps/cli/plug/__init__.py:271
msgid "Paper size name."
-msgstr ""
+msgstr "Формат листа бумаги."
#: ../gramps/cli/plug/__init__.py:272 ../gramps/cli/plug/__init__.py:273
#: ../gramps/cli/plug/__init__.py:275 ../gramps/cli/plug/__init__.py:277
@@ -709,7 +711,7 @@ msgstr ""
#: ../gramps/cli/plug/__init__.py:272
msgid "Paper orientation number."
-msgstr "Paper orientation number."
+msgstr "Ориентация страницы."
#: ../gramps/cli/plug/__init__.py:273
msgid "Left paper margin"
@@ -722,15 +724,15 @@ msgstr "Размер в см"
#: ../gramps/cli/plug/__init__.py:275
msgid "Right paper margin"
-msgstr ""
+msgstr "Правое поле"
#: ../gramps/cli/plug/__init__.py:277
msgid "Top paper margin"
-msgstr ""
+msgstr "Верхнее поле"
#: ../gramps/cli/plug/__init__.py:279
msgid "Bottom paper margin"
-msgstr ""
+msgstr "Нижнее поле"
#: ../gramps/cli/plug/__init__.py:281
msgid "=css filename"
@@ -738,7 +740,7 @@ msgstr ""
#: ../gramps/cli/plug/__init__.py:281
msgid "CSS filename to use, html format only"
-msgstr ""
+msgstr "Имя файла CSS, только для формата HTML"
#: ../gramps/cli/plug/__init__.py:312 ../gramps/gen/plug/report/_paper.py:91
#: ../gramps/gen/plug/report/_paper.py:113
@@ -786,7 +788,7 @@ msgstr " Возможные параметры:"
#: ../gramps/cli/plug/__init__.py:585
msgid "(no help available)"
-msgstr ""
+msgstr "(подсказка отсутствует)"
#: ../gramps/cli/plug/__init__.py:594
msgid " Available values are:"
@@ -805,19 +807,19 @@ msgstr "Не удалось записать отчет. "
#: ../gramps/gen/config.py:285
msgid "Imported %Y/%m/%d %H:%M:%S"
-msgstr ""
+msgstr "Импортировано %Y/%m/%d %H:%M:%S"
#: ../gramps/gen/config.py:294
msgid "Missing Given Name"
-msgstr "Отсутствующее имя"
+msgstr "Имя отсутствует"
#: ../gramps/gen/config.py:295
msgid "Missing Record"
-msgstr "Отсутствующая информация"
+msgstr "Запись отсутствует"
#: ../gramps/gen/config.py:296
msgid "Missing Surname"
-msgstr "Отсутствующая Фамилия"
+msgstr "Фамилия отсутствует"
#: ../gramps/gen/config.py:303 ../gramps/gen/config.py:305
msgid "Living"
@@ -900,6 +902,15 @@ msgid ""
"computer with that software that created the Family Tree, export it to XML "
"and load that XML into the version of Gramps you intend to use."
msgstr ""
+"Gramps хранит свои данные в базе данных Беркли. Семейное древо, "
+"которое Вы пытаетесь загрузить, было записано в формате СУБД Беркли "
+"версии %(env_version)s. Текущая же версия Gramps version использкет "
+"СУБД Беркли версии %(bdb_version)s. Таким образом, Вы пытаетесь "
+"загрузить данные записанные в более новом формате в устаревшую "
+"сборку программы, это, скорее всего, не удастся. Правильные способ "
+"для решения этой проблемы — использовать экспорт и импорт в формате "
+"XML. Попытайтесь открыть это древо на том компьютере, где оно было "
+"создано, экспортируйте его в XML, а затем импортируйте его здесь."
#: ../gramps/gen/db/exceptions.py:128
#, python-format
@@ -916,6 +927,17 @@ msgid ""
"If you have made a backup, then you can get Gramps to try to open the tree "
"and upgrade it"
msgstr ""
+"Версию BSDDB древа, которое Вы пытаетесь открыть, надо обновить "
+"с %(env_version)s на %(bdb_version)s.\n"
+"\n"
+"Скорее всего это значит, что это древо было создано в более старой версии "
+"Gramps. Открытие его в настоящей версии Gramps может безвозвратно "
+"повредить Ваше древо. Настоятельно рекомендуется сделать резервную "
+"копию Ваших данных, см.: \n"
+"http://www.gramps-project.org/wiki/index.php?title=How_to_make_a_backup\n"
+"\n"
+"Если Вы уже сделали резервную копию, то Вы можете попробовать открыть "
+"это древо, при этом произойдёт обновление версии BSDDB."
#: ../gramps/gen/db/exceptions.py:151
msgid ""
@@ -956,6 +978,19 @@ msgid ""
"See: \n"
"http://www.gramps-project.org/wiki/index.php?title=How_to_make_a_backup"
msgstr ""
+"Структура данных семейного древа, которую использует Gramps, изменилась "
+"с тех пор, как данное дерево было создано.\n"
+"\n"
+"По этой причине, для открытия этого древа необходимо произвести обновление "
+"формата структуры данных.\n"
+"После обновления использовать предыдущие версии Gramps будет невозможно, "
+"даже если делать экспорт в формат .gramps xml!\n"
+"\n"
+"Обновление — сложная процедура, которую нельзя прерывать, иначе данные "
+"могут быть безвозвратно повреждены. Поэтому, перед началом обновления, "
+"сделайте резервную копию. "
+"См.: \n"
+"http://www.gramps-project.org/wiki/index.php?title=How_to_make_a_backup"
#: ../gramps/gen/db/undoredo.py:249 ../gramps/gen/db/undoredo.py:286
#: ../gramps/gen/db/write.py:2026
@@ -1015,7 +1050,7 @@ msgstr ""
# statistics over import results
#: ../gramps/gen/db/upgrade.py:530
msgid "Upgrade Statistics"
-msgstr ""
+msgstr "Итоги обновления:"
#: ../gramps/gen/db/write.py:1023
#, python-format
@@ -1035,6 +1070,8 @@ msgid ""
"A second transaction is started while there is still a transaction, \"%s\", "
"active in the database."
msgstr ""
+"Начата вторая транзакция с базой данных, хотя текущая транзакция, «%s», ещё "
+"не завершилась."
#: ../gramps/gen/display/name.py:331
msgid "Default format (defined by Gramps preferences)"
@@ -1163,11 +1200,11 @@ msgstr "семпрозвище"
#: ../gramps/gen/display/name.py:1067
#, python-format
msgid "Wrong name format string %s"
-msgstr ""
+msgstr "Неверная строка формата имени «%s»"
#: ../gramps/gen/display/name.py:1071
msgid "ERROR, Edit Name format in Preferences"
-msgstr ""
+msgstr "ОШИБКА, Установите строку формата в меню «Настройки»"
#: ../gramps/gen/filters/_filterparser.py:120
#, python-format
@@ -1267,7 +1304,7 @@ msgstr "Общие фильтры"
#: ../gramps/gen/filters/rules/_changedsincebase.py:82
msgid "Wrong format of date-time"
-msgstr ""
+msgstr "Неверный формат даты/времени"
#: ../gramps/gen/filters/rules/_changedsincebase.py:83
#, python-format
@@ -1275,6 +1312,8 @@ msgid ""
"Only date-times in the iso format of yyyy-mm-dd hh:mm:ss, where the time "
"part is optional, are accepted. %s does not satisfy."
msgstr ""
+"Допускаются только дата/время в формате вида ГГГГ-ММ-ДД ЧЧ:ММ:СС или только "
+"ГГГГ-ММ-ДД. «%s» не годится."
#: ../gramps/gen/filters/rules/_hascitationbase.py:51
#: ../gramps/gen/filters/rules/citation/_hascitation.py:50
@@ -1325,7 +1364,7 @@ msgstr "Цитаты, удовлетворяющие параметрам"
#: ../gramps/gen/filters/rules/_hascitationbase.py:55
#: ../gramps/gen/filters/rules/citation/_hascitation.py:55
msgid "Matches citations with particular parameters"
-msgstr "Выбирает цитаты с определёнными параметрами"
+msgstr "Выбирает цитаты с данными параметрами"
#: ../gramps/gen/filters/rules/_hascitationbase.py:56
#: ../gramps/gen/filters/rules/_hassourcebase.py:54
@@ -1339,7 +1378,7 @@ msgstr "Выбирает цитаты с определёнными параме
#: ../gramps/gen/filters/rules/person/_hassourceof.py:49
#: ../gramps/gen/filters/rules/place/_hassourceof.py:49
msgid "Citation/source filters"
-msgstr ""
+msgstr "Фильтры цитат/источников"
#: ../gramps/gen/filters/rules/_haseventbase.py:57
#: ../gramps/gen/filters/rules/person/_familywithincompleteevent.py:47
@@ -1447,7 +1486,7 @@ msgstr "Название:"
#: ../gramps/gen/filters/rules/_matchesfilterbase.py:72
#, python-format
msgid "Can't find filter %s in the defined custom filters"
-msgstr ""
+msgstr "Не могу найти фильтр «%s» среди заданных фильтров пользователя."
#: ../gramps/gen/filters/rules/_matchessourcefilterbase.py:49
#: ../gramps/gen/filters/rules/citation/_matchessourcefilter.py:50
@@ -1542,7 +1581,7 @@ msgstr "Цитаты с <числом> документов"
#: ../gramps/gen/filters/rules/citation/_hasgallery.py:48
msgid "Matches citations with a certain number of items in the gallery"
-msgstr "Выбирает цитаты с определенным числом документов в галерее"
+msgstr "Выбирает цитаты с данным числом документов в галерее"
#: ../gramps/gen/filters/rules/citation/_hasidof.py:47
msgid "Citation with "
@@ -1558,7 +1597,7 @@ msgstr "Цитаты с <числом> заметок"
#: ../gramps/gen/filters/rules/citation/_hasnote.py:49
msgid "Matches citations having a certain number of notes"
-msgstr "Выбирает цитаты с определённым числом заметок"
+msgstr "Выбирает цитаты с данным числом заметок"
#: ../gramps/gen/filters/rules/citation/_hasnotematchingsubstringof.py:45
msgid "Citations having notes containing "
@@ -1587,7 +1626,7 @@ msgstr "Цитаты с числом ссылок <число>"
#: ../gramps/gen/filters/rules/citation/_hasreferencecountof.py:46
msgid "Matches citations with a certain reference count"
-msgstr ""
+msgstr "Выбирает цитаты с данным счётчиком ссылок"
#: ../gramps/gen/filters/rules/citation/_hassource.py:50
#: ../gramps/gen/filters/rules/media/_hasmedia.py:48
@@ -1633,7 +1672,7 @@ msgstr "Источники, удовлетворяющие параметрам"
#: ../gramps/gen/filters/rules/citation/_hassource.py:55
msgid "Matches citations with a source of a particular value"
-msgstr ""
+msgstr "Выбирает цитаты из данного источника"
#: ../gramps/gen/filters/rules/citation/_hassource.py:57
msgid "Source filters"
@@ -1674,6 +1713,8 @@ msgid ""
"Matches citations with sources with a repository reference that match a "
"certain repository filter"
msgstr ""
+"Выбирает цитаты из источников из хранилищ, соответствующих указанному фильтру "
+"хранилищ"
#: ../gramps/gen/filters/rules/citation/_matchessourcefilter.py:51
msgid "Citations with source matching the