From d42b5e2a3a29557b8f90a5791c254731b977b03b Mon Sep 17 00:00:00 2001 From: Nick Hall Date: Thu, 7 Jun 2012 20:59:32 +0000 Subject: [PATCH] GEPS008: Moved Relationship module svn: r19789 --- po/POTFILES.in | 4 +++- src/Makefile.am | 1 - src/gen/Makefile.am | 1 + src/{Relationship.py => gen/relationship.py} | 0 src/gui/displaystate.py | 4 ++-- src/gui/viewmanager.py | 4 ++-- src/plugins/drawreport/Calendar.py | 4 ++-- src/plugins/quickview/all_relations.py | 4 ++-- src/plugins/quickview/siblings.py | 4 ++-- src/plugins/rel/rel_ca.py | 14 +++++++------- src/plugins/rel/rel_cs.py | 8 ++++---- src/plugins/rel/rel_da.py | 10 +++++----- src/plugins/rel/rel_de.py | 10 +++++----- src/plugins/rel/rel_es.py | 8 ++++---- src/plugins/rel/rel_fi.py | 10 +++++----- src/plugins/rel/rel_fr.py | 14 +++++++------- src/plugins/rel/rel_hr.py | 8 ++++---- src/plugins/rel/rel_hu.py | 8 ++++---- src/plugins/rel/rel_it.py | 10 +++++----- src/plugins/rel/rel_nl.py | 8 ++++---- src/plugins/rel/rel_no.py | 10 +++++----- src/plugins/rel/rel_pl.py | 12 ++++++------ src/plugins/rel/rel_pt.py | 8 ++++---- src/plugins/rel/rel_ru.py | 10 +++++----- src/plugins/rel/rel_sk.py | 12 ++++++------ src/plugins/rel/rel_sl.py | 8 ++++---- src/plugins/rel/rel_sv.py | 10 +++++----- src/plugins/textreport/BirthdayReport.py | 4 ++-- src/plugins/textreport/KinshipReport.py | 4 ++-- src/plugins/tool/RelCalc.py | 4 ++-- src/plugins/webreport/NarrativeWeb.py | 4 ++-- 31 files changed, 111 insertions(+), 109 deletions(-) rename src/{Relationship.py => gen/relationship.py} (100%) diff --git a/po/POTFILES.in b/po/POTFILES.in index 9f149cc75..5c87d1d3a 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -9,7 +9,6 @@ src/ExportOptions.py src/gramps.py src/LdsUtils.py src/PlaceUtils.py -src/Relationship.py src/Reorder.py src/Spell.py src/ToolTips.py @@ -23,6 +22,9 @@ src/cli/clidbman.py src/cli/grampscli.py src/cli/plug/__init__.py +# gen +src/gen/relationship.py + # gen db API src/gen/db/base.py src/gen/db/exceptions.py diff --git a/src/Makefile.am b/src/Makefile.am index 05049cfd3..ace23a1f6 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -25,7 +25,6 @@ gdir_PYTHON = \ LdsUtils.py \ Lru.py\ MacTransUtils.py\ - Relationship.py\ Reorder.py\ Sort.py\ soundex.py\ diff --git a/src/gen/Makefile.am b/src/gen/Makefile.am index 0b96e61a8..9a7d5b1bc 100644 --- a/src/gen/Makefile.am +++ b/src/gen/Makefile.am @@ -26,6 +26,7 @@ pkgpython_PYTHON = \ errors.py \ ggettext.py \ recentfiles.py \ + relationship.py \ updatecallback.py \ user.py diff --git a/src/Relationship.py b/src/gen/relationship.py similarity index 100% rename from src/Relationship.py rename to src/gen/relationship.py diff --git a/src/gui/displaystate.py b/src/gui/displaystate.py index bfc8222e4..3a1820051 100644 --- a/src/gui/displaystate.py +++ b/src/gui/displaystate.py @@ -59,7 +59,7 @@ from gui.views.navigationview import NavigationView import config from gen.display.name import displayer as name_displayer from gui.managedwindow import GrampsWindowManager -import Relationship +from gen.relationship import get_relationship_calculator from gui.glade import Glade from Utils import navigation_label @@ -466,7 +466,7 @@ class DisplayState(gen.utils.Callback): """method that rebinds the relationship to the current rel calc Should be called after load or reload of plugins """ - self.relationship = Relationship.get_relationship_calculator(reinit=True) + self.relationship = get_relationship_calculator(reinit=True) def set_gendepth(self, value): """ Set the generations we search back for showing relationships diff --git a/src/gui/viewmanager.py b/src/gui/viewmanager.py index d62f7706b..290946bf4 100644 --- a/src/gui/viewmanager.py +++ b/src/gui/viewmanager.py @@ -76,7 +76,7 @@ from gui.plug import (PluginWindows, ReportPluginDialog, ToolPluginDialog) from gui.plug.report import report from gen.plug.utils import version_str_to_tup, load_addon_file from gui.pluginmanager import GuiPluginManager -import Relationship +from gen.relationship import get_relationship_calculator from gui.displaystate import DisplayState, RecentDocsMenu import const import constfunc @@ -332,7 +332,7 @@ class ViewManager(CLIManager): self.do_reg_plugins(self.dbstate, self.uistate) #plugins loaded now set relationship class - self.rel_class = Relationship.get_relationship_calculator() + self.rel_class = get_relationship_calculator() self.uistate.set_relationship_class() # Need to call after plugins have been registered self.check_for_updates() diff --git a/src/plugins/drawreport/Calendar.py b/src/plugins/drawreport/Calendar.py index 60678de2e..8958fd96e 100644 --- a/src/plugins/drawreport/Calendar.py +++ b/src/plugins/drawreport/Calendar.py @@ -38,7 +38,7 @@ import time #------------------------------------------------------------------------ from gen.display.name import displayer as _nd from gen.errors import ReportError -import Relationship +from gen.relationship import get_relationship_calculator from gen.plug.docgen import (FontStyle, ParagraphStyle, GraphicsStyle, FONT_SERIF, PARA_ALIGN_CENTER, PARA_ALIGN_LEFT, PARA_ALIGN_RIGHT) @@ -266,7 +266,7 @@ class Calendar(Report): db.get_number_of_people()) people = self.filter.apply(self.database, people, self._user.step_progress) - rel_calc = Relationship.get_relationship_calculator() + rel_calc = get_relationship_calculator() self._user.end_progress() self._user.begin_progress(_('Calendar Report'), diff --git a/src/plugins/quickview/all_relations.py b/src/plugins/quickview/all_relations.py index 3448162ea..83821cee5 100644 --- a/src/plugins/quickview/all_relations.py +++ b/src/plugins/quickview/all_relations.py @@ -33,7 +33,7 @@ Display a person's relations to the home person from gen.simple import SimpleAccess, SimpleDoc from gen.ggettext import gettext as _ -import Relationship +from gen.relationship import get_relationship_calculator # define the formatting string once as a constant. Since this is reused @@ -60,7 +60,7 @@ class AllRelReport(): self.person = person self.sdb = SimpleAccess(database) self.sdoc = SimpleDoc(document) - self.rel_class = Relationship.get_relationship_calculator() + self.rel_class = get_relationship_calculator() self.msg_list = [] diff --git a/src/plugins/quickview/siblings.py b/src/plugins/quickview/siblings.py index baa5086aa..c8b9a073c 100644 --- a/src/plugins/quickview/siblings.py +++ b/src/plugins/quickview/siblings.py @@ -28,7 +28,7 @@ Display a person's siblings in a report window from gen.simple import SimpleAccess, SimpleDoc from gui.plug.quick import QuickTable -import Relationship +from gen.relationship import get_relationship_calculator from gen.ggettext import gettext as _ def run(database, document, person): @@ -40,7 +40,7 @@ def run(database, document, person): sdb = SimpleAccess(database) sdoc = SimpleDoc(document) stab = QuickTable(sdb) - rel_class = Relationship.get_relationship_calculator() + rel_class = get_relationship_calculator() # display the title # feature request 2356: avoid genitive form diff --git a/src/plugins/rel/rel_ca.py b/src/plugins/rel/rel_ca.py index 78e7a4879..dc064276a 100644 --- a/src/plugins/rel/rel_ca.py +++ b/src/plugins/rel/rel_ca.py @@ -39,7 +39,7 @@ not explicitly in the dictionary, but "netastre" is. #------------------------------------------------------------------------- import gen.lib -import Relationship +import gen.relationship #------------------------------------------------------------------------- @@ -807,7 +807,7 @@ def _get_neboda_valenciana(levela, levelb, inlaw="", step=""): stramplada = _LEVEL_NAME_F[amplada] return retorn+u" valenciana "+ stramplada+inlaw -class RelationshipCalculator(Relationship.RelationshipCalculator): +class RelationshipCalculator(gen.relationship.RelationshipCalculator): """ RelationshipCalculator Class """ @@ -815,7 +815,7 @@ class RelationshipCalculator(Relationship.RelationshipCalculator): INLAW = u' polític' def __init__(self): - Relationship.RelationshipCalculator.__init__(self) + gen.relationship.RelationshipCalculator.__init__(self) # kinship report @@ -824,7 +824,7 @@ class RelationshipCalculator(Relationship.RelationshipCalculator): only_birth=True, in_law_a=False, in_law_b=False): """ - see Relationship.py + see relationship.py """ rel_str = u"parents llunyans" @@ -906,7 +906,7 @@ class RelationshipCalculator(Relationship.RelationshipCalculator): in_law_b=False, ): """ - see Relationship.py + see relationship.py """ if only_birth: @@ -1042,7 +1042,7 @@ class RelationshipCalculator(Relationship.RelationshipCalculator): def get_sibling_relationship_string(self, sib_type, gender_a, gender_b, in_law_a=False, in_law_b=False): """ - voir Relationship.py + voir relationship.py """ if in_law_a or in_law_b: @@ -1114,6 +1114,6 @@ if __name__ == "__main__": # rel_xx.py module, and test your work with: # python src/plugins/rel/rel_xx.py #"" - from Relationship import test + from gen.relationship import test RC = RelationshipCalculator() test(RC, True) diff --git a/src/plugins/rel/rel_cs.py b/src/plugins/rel/rel_cs.py index b273e3a0e..16bbbe243 100644 --- a/src/plugins/rel/rel_cs.py +++ b/src/plugins/rel/rel_cs.py @@ -34,7 +34,7 @@ Czech-specific classes for relationships. #------------------------------------------------------------------------- import gen.lib -import Relationship +import gen.relationship #------------------------------------------------------------------------- # @@ -73,13 +73,13 @@ _niece_level = [ "", "neteř", "praneteř", "prapraneteř", ] # # #------------------------------------------------------------------------- -class RelationshipCalculator(Relationship.RelationshipCalculator): +class RelationshipCalculator(gen.relationship.RelationshipCalculator): """ RelationshipCalculator Class """ def __init__(self): - Relationship.RelationshipCalculator.__init__(self) + gen.relationship.RelationshipCalculator.__init__(self) def get_male_cousin(self, level): if level > len(_level_name)-1: @@ -227,6 +227,6 @@ if __name__ == "__main__": rel_xx.py module, and test your work with: python src/plugins/rel/rel_xx.py """ - from Relationship import test + from gen.relationship import test RC = RelationshipCalculator() test(RC, True) diff --git a/src/plugins/rel/rel_da.py b/src/plugins/rel/rel_da.py index 8cba92690..29f95c8e2 100644 --- a/src/plugins/rel/rel_da.py +++ b/src/plugins/rel/rel_da.py @@ -23,7 +23,7 @@ # $Id$ -# Written by Alex Roitman, largely based on Relationship.py by Don Allingham +# Written by Alex Roitman, largely based on relationship.py by Don Allingham # and on valuable input from Lars Kr. Lundin """ Specific classes for relationships. @@ -35,7 +35,7 @@ Specific classes for relationships. #------------------------------------------------------------------------- import gen.lib -import Relationship +import gen.relationship #------------------------------------------------------------------------- # @@ -76,13 +76,13 @@ _niece_level = [ "", "niecen", "næstsøskendebarnet", "søsterens barnebarn", ] # # #------------------------------------------------------------------------- -class RelationshipCalculator(Relationship.RelationshipCalculator): +class RelationshipCalculator(gen.relationship.RelationshipCalculator): """ RelationshipCalculator Class """ def __init__(self): - Relationship.RelationshipCalculator.__init__(self) + gen.relationship.RelationshipCalculator.__init__(self) def get_parents(self, level): if level > len(_parents_level)-1: @@ -199,7 +199,7 @@ if __name__ == "__main__": rel_xx.py module, and test your work with: python src/plugins/rel/rel_xx.py """ - from Relationship import test + from gen.relationship import test RC = RelationshipCalculator() test(RC, True) diff --git a/src/plugins/rel/rel_de.py b/src/plugins/rel/rel_de.py index 57b159aef..1492578a3 100644 --- a/src/plugins/rel/rel_de.py +++ b/src/plugins/rel/rel_de.py @@ -23,7 +23,7 @@ # $Id$ -# Original version written by Alex Roitman, largely based on Relationship.py +# Original version written by Alex Roitman, largely based on relationship.py # by Don Allingham and on valuable input from Dr. Martin Senftleben # Modified by Joachim Breitner to not use „Großcousine“, in accordance with # http://de.wikipedia.org/wiki/Verwandtschaftsbeziehung @@ -47,7 +47,7 @@ import re #------------------------------------------------------------------------- import gen.lib -import Relationship +import gen.relationship #------------------------------------------------------------------------- # @@ -127,12 +127,12 @@ _schwippschwager = { # #------------------------------------------------------------------------- -class RelationshipCalculator(Relationship.RelationshipCalculator): +class RelationshipCalculator(gen.relationship.RelationshipCalculator): """ RelationshipCalculator Class """ def __init__(self): - Relationship.RelationshipCalculator.__init__(self) + gen.relationship.RelationshipCalculator.__init__(self) def _make_roman(self, num): roman = '' @@ -300,6 +300,6 @@ if __name__ == "__main__": rel_xx.py module, and test your work with: python src/plugins/rel/rel_xx.py """ - from Relationship import test + from gen.relationship import test rc = RelationshipCalculator() test(rc, True) diff --git a/src/plugins/rel/rel_es.py b/src/plugins/rel/rel_es.py index 13509740c..b7ac3497b 100644 --- a/src/plugins/rel/rel_es.py +++ b/src/plugins/rel/rel_es.py @@ -33,7 +33,7 @@ Spanish-specific classes for relationships. #------------------------------------------------------------------------- import gen.lib -import Relationship +import gen.relationship #------------------------------------------------------------------------- # @@ -118,13 +118,13 @@ _niece_level = [ "", "sobrina", "sobrina nieta", "sobrina bisnieta", ] # # #------------------------------------------------------------------------- -class RelationshipCalculator(Relationship.RelationshipCalculator): +class RelationshipCalculator(gen.relationship.RelationshipCalculator): """ RelationshipCalculator Class """ def __init__(self): - Relationship.RelationshipCalculator.__init__(self) + gen.relationship.RelationshipCalculator.__init__(self) def get_male_cousin(self, level): if level < len(_level_name_male): @@ -330,6 +330,6 @@ if __name__ == "__main__": rel_xx.py module, and test your work with: python src/plugins/rel/rel_xx.py """ - from Relationship import test + from gen.relationship import test RC = RelationshipCalculator() test(RC, True) diff --git a/src/plugins/rel/rel_fi.py b/src/plugins/rel/rel_fi.py index 5fc9d464e..5c477e83b 100644 --- a/src/plugins/rel/rel_fi.py +++ b/src/plugins/rel/rel_fi.py @@ -23,7 +23,7 @@ # $Id$ -# Written by Alex Roitman, largely based on Relationship.py by Don Allingham +# Written by Alex Roitman, largely based on relationship.py by Don Allingham # and on valuable input from Eero Tamminen """ Specific classes for relationships. @@ -35,7 +35,7 @@ Specific classes for relationships. #------------------------------------------------------------------------- import gen.lib -import Relationship +import gen.relationship #------------------------------------------------------------------------- # @@ -51,13 +51,13 @@ _parents_level = [ "", "vanhemmat", "isovanhemmat", "isoisovanhemmat", # # #------------------------------------------------------------------------- -class RelationshipCalculator(Relationship.RelationshipCalculator): +class RelationshipCalculator(gen.relationship.RelationshipCalculator): """ RelationshipCalculator Class """ def __init__(self): - Relationship.RelationshipCalculator.__init__(self) + gen.relationship.RelationshipCalculator.__init__(self) def get_cousin(self, level): if level == 0: @@ -219,6 +219,6 @@ if __name__ == "__main__": rel_xx.py module, and test your work with: python src/plugins/rel/rel_xx.py """ - from Relationship import test + from gen.relationship import test RC = RelationshipCalculator() test(RC, True) diff --git a/src/plugins/rel/rel_fr.py b/src/plugins/rel/rel_fr.py index 6114d142f..77345926f 100644 --- a/src/plugins/rel/rel_fr.py +++ b/src/plugins/rel/rel_fr.py @@ -33,7 +33,7 @@ French-specific classes for relationships. #------------------------------------------------------------------------- import gen.lib -import Relationship +import gen.relationship #------------------------------------------------------------------------- @@ -413,7 +413,7 @@ def get_niece(level, inlaw=""): else: return _NIECE_LEVEL[level] % inlaw -class RelationshipCalculator(Relationship.RelationshipCalculator): +class RelationshipCalculator(gen.relationship.RelationshipCalculator): """ RelationshipCalculator Class """ @@ -421,7 +421,7 @@ class RelationshipCalculator(Relationship.RelationshipCalculator): INLAW = u' (par alliance)' def __init__(self): - Relationship.RelationshipCalculator.__init__(self) + gen.relationship.RelationshipCalculator.__init__(self) # kinship report @@ -430,7 +430,7 @@ class RelationshipCalculator(Relationship.RelationshipCalculator): only_birth=True, in_law_a=False, in_law_b=False): """ - voir Relationship.py + voir relationship.py """ rel_str = u"des parents lointains" @@ -551,7 +551,7 @@ class RelationshipCalculator(Relationship.RelationshipCalculator): in_law_b=False, ): """ - voir Relationship.py + voir relationship.py """ if only_birth: @@ -776,7 +776,7 @@ class RelationshipCalculator(Relationship.RelationshipCalculator): def get_sibling_relationship_string(self, sib_type, gender_a, gender_b, in_law_a=False, in_law_b=False): """ - voir Relationship.py + voir relationship.py """ if in_law_a or in_law_b: @@ -855,6 +855,6 @@ if __name__ == "__main__": rel_xx.py module, and test your work with: python src/plugins/rel/rel_xx.py """ - from Relationship import test + from gen.relationship import test RC = RelationshipCalculator() test(RC, True) diff --git a/src/plugins/rel/rel_hr.py b/src/plugins/rel/rel_hr.py index ae6dbd83c..c0537aaec 100644 --- a/src/plugins/rel/rel_hr.py +++ b/src/plugins/rel/rel_hr.py @@ -33,7 +33,7 @@ Croatian-specific classes for calculating relationships and kinship names. #------------------------------------------------------------------------- #import gen.lib -import Relationship +import gen.relationship _PARENTS = ['', 'otac i majka', 'djedovi i bake', 'pradjedovi i prabake', '%s pradjedovi i %s prabake'] @@ -149,12 +149,12 @@ def _get_uncles(gen, inlaw): # #------------------------------------------------------------------------- -class RelationshipCalculator(Relationship.RelationshipCalculator): +class RelationshipCalculator(gen.relationship.RelationshipCalculator): """ RelationshipCalculator Class """ def __init__(self): - Relationship.RelationshipCalculator.__init__(self) + gen.relationship.RelationshipCalculator.__init__(self) def get_plural_relationship_string(self, gena, genb, reltocommon_a='', reltocommon_b='', only_birth=True, in_law_a=False, in_law_b=False): @@ -193,6 +193,6 @@ if __name__ == "__main__": # imported modules): # export PYTHONPATH=/path/to/gramps/src # python src/plugins/rel/rel_ru.py - from Relationship import test + from gen.relationship import test RC = RelationshipCalculator() test(RC, True) diff --git a/src/plugins/rel/rel_hu.py b/src/plugins/rel/rel_hu.py index 6a0a58ce3..4ad3f6b49 100644 --- a/src/plugins/rel/rel_hu.py +++ b/src/plugins/rel/rel_hu.py @@ -35,7 +35,7 @@ Specific classes for relationships. #------------------------------------------------------------------------- import gen.lib -import Relationship +import gen.relationship #------------------------------------------------------------------------- # @@ -55,13 +55,13 @@ _level = \ # Specific relationship functions # #------------------------------------------------------------------------- -class RelationshipCalculator(Relationship.RelationshipCalculator): +class RelationshipCalculator(gen.relationship.RelationshipCalculator): """ RelationshipCalculator Class """ def __init__(self): - Relationship.RelationshipCalculator.__init__(self) + gen.relationship.RelationshipCalculator.__init__(self) def get_parents (self, level): @@ -295,6 +295,6 @@ if __name__ == "__main__": rel_xx.py module, and test your work with: python src/plugins/rel/rel_xx.py """ - from Relationship import test + from gen.relationship import test RC = RelationshipCalculator() test(RC, True) diff --git a/src/plugins/rel/rel_it.py b/src/plugins/rel/rel_it.py index 3a824a86f..e9545e989 100644 --- a/src/plugins/rel/rel_it.py +++ b/src/plugins/rel/rel_it.py @@ -38,7 +38,7 @@ Italian-Specific classes for relationships. #------------------------------------------------------------------------- import gen.lib -import Relationship +import gen.relationship #------------------------------------------------------------------------- # @@ -123,7 +123,7 @@ _niece_level = [ "", "la nipote%(step)s%(inlaw)s", # # #------------------------------------------------------------------------- -class RelationshipCalculator(Relationship.RelationshipCalculator): +class RelationshipCalculator(gen.relationship.RelationshipCalculator): """ RelationshipCalculator Class """ @@ -133,7 +133,7 @@ class RelationshipCalculator(Relationship.RelationshipCalculator): STEP = ' adottiv%(gen)s' def __init__(self): - Relationship.RelationshipCalculator.__init__(self) + gen.relationship.RelationshipCalculator.__init__(self) #------------------------------------------------------------------------- # @@ -380,7 +380,7 @@ class RelationshipCalculator(Relationship.RelationshipCalculator): only_birth=True, in_law_a=False, in_law_b=False): """ - See Comment in Relationship Class (Relationship.py) + See Comment in Relationship Class (relationship.py) """ if only_birth: @@ -518,6 +518,6 @@ if __name__ == "__main__": rel_xx.py module, and test your work with: python src/plugins/rel/rel_xx.py """ - from Relationship import test + from gen.relationship import test RC = RelationshipCalculator() test(RC, True) diff --git a/src/plugins/rel/rel_nl.py b/src/plugins/rel/rel_nl.py index d691d6dde..d23d793d3 100644 --- a/src/plugins/rel/rel_nl.py +++ b/src/plugins/rel/rel_nl.py @@ -31,7 +31,7 @@ Specific classes for relationships. #------------------------------------------------------------------------- import gen.lib -import Relationship +import gen.relationship #------------------------------------------------------------------------- # @@ -243,7 +243,7 @@ _uncle_level = [ "", # # #------------------------------------------------------------------------- -class RelationshipCalculator(Relationship.RelationshipCalculator): +class RelationshipCalculator(gen.relationship.RelationshipCalculator): """ RelationshipCalculator Class """ @@ -255,7 +255,7 @@ class RelationshipCalculator(Relationship.RelationshipCalculator): INLAW = 'aangetrouwde ' def __init__(self): - Relationship.RelationshipCalculator.__init__(self) + gen.relationship.RelationshipCalculator.__init__(self) def get_parents(self, level): if level > len(_parents_level)-1: @@ -553,6 +553,6 @@ if __name__ == "__main__": rel_xx.py module, and test your work with: python src/plugins/rel/rel_xx.py """ - from Relationship import test + from gen.relationship import test RC = RelationshipCalculator() test(RC, True) diff --git a/src/plugins/rel/rel_no.py b/src/plugins/rel/rel_no.py index 90972a901..30318fb1a 100644 --- a/src/plugins/rel/rel_no.py +++ b/src/plugins/rel/rel_no.py @@ -23,7 +23,7 @@ # $Id$ -# Written by Alex Roitman, largely based on Relationship.py by Don Allingham +# Written by Alex Roitman, largely based on relationship.py by Don Allingham # and on valuable input from Frode Jemtland """ Norwegian-Specific classes for relationships. @@ -35,7 +35,7 @@ Norwegian-Specific classes for relationships. #------------------------------------------------------------------------- import gen.lib -import Relationship +import gen.relationship #------------------------------------------------------------------------- @@ -53,13 +53,13 @@ _cousin_terms = _cousin_level + ["fetter", "kusine"] # # #------------------------------------------------------------------------- -class RelationshipCalculator(Relationship.RelationshipCalculator): +class RelationshipCalculator(gen.relationship.RelationshipCalculator): """ RelationshipCalculator Class """ def __init__(self): - Relationship.RelationshipCalculator.__init__(self) + gen.relationship.RelationshipCalculator.__init__(self) def get_parents(self, level): if level == 0: @@ -262,6 +262,6 @@ if __name__ == "__main__": rel_xx.py module, and test your work with: python src/plugins/rel/rel_xx.py """ - from Relationship import test + from gen.relationship import test RC = RelationshipCalculator() test(RC, True) diff --git a/src/plugins/rel/rel_pl.py b/src/plugins/rel/rel_pl.py index 8b542178d..cc0ef8bf2 100644 --- a/src/plugins/rel/rel_pl.py +++ b/src/plugins/rel/rel_pl.py @@ -25,8 +25,8 @@ # Rewritten in 2008 for 3.x version by Łukasz Rymarczyk # Written in 2007 by Piotr Czubaszek, largely based on rel_de.py by Alex Roitman. -# PL: Po objaśnienia oznaczania relacji zobacz Relationship.py -# EN: For more information see Relationship.py +# PL: Po objaśnienia oznaczania relacji zobacz relationship.py +# EN: For more information see relationship.py # """ Polish-specific definitions of relationships. @@ -38,7 +38,7 @@ Polish-specific definitions of relationships. #------------------------------------------------------------------------- import gen.lib -import Relationship +import gen.relationship #------------------------------------------------------------------------- @@ -251,13 +251,13 @@ _niece_level_of_sisters_daughter = [ "", "siostrzenica", # #------------------------------------------------------------------------- -class RelationshipCalculator(Relationship.RelationshipCalculator): +class RelationshipCalculator(gen.relationship.RelationshipCalculator): """ RelationshipCalculator Class """ def __init__(self): - Relationship.RelationshipCalculator.__init__(self) + gen.relationship.RelationshipCalculator.__init__(self) def get_son(self, level, inlaw=''): """ @@ -923,6 +923,6 @@ if __name__ == "__main__": rel_xx.py module, and test your work with: python src/plugins/rel/rel_xx.py """ - from Relationship import test + from gen.relationship import test RC = RelationshipCalculator() test(RC, True) diff --git a/src/plugins/rel/rel_pt.py b/src/plugins/rel/rel_pt.py index b26fa0a3e..8d4faeae3 100644 --- a/src/plugins/rel/rel_pt.py +++ b/src/plugins/rel/rel_pt.py @@ -35,7 +35,7 @@ Specific classes for relationships. #------------------------------------------------------------------------- import gen.lib -import Relationship +import gen.relationship #------------------------------------------------------------------------- # @@ -144,13 +144,13 @@ _NEPHEWS_NIECES_LEVEL = [u"", u"sobrinhos e sobrinhas", # # #------------------------------------------------------------------------- -class RelationshipCalculator(Relationship.RelationshipCalculator): +class RelationshipCalculator(gen.relationship.RelationshipCalculator): """ RelationshipCalculator Class """ def __init__(self): - Relationship.RelationshipCalculator.__init__(self) + gen.relationship.RelationshipCalculator.__init__(self) def get_male_cousin(self, level): if level < len(_level_name_male): @@ -457,6 +457,6 @@ if __name__ == "__main__": rel_xx.py module, and test your work with: python src/plugins/rel/rel_xx.py """ - from Relationship import test + from gen.relationship import test RC = RelationshipCalculator() test(RC, True) diff --git a/src/plugins/rel/rel_ru.py b/src/plugins/rel/rel_ru.py index 012b36a55..31643ba48 100644 --- a/src/plugins/rel/rel_ru.py +++ b/src/plugins/rel/rel_ru.py @@ -23,7 +23,7 @@ # $Id$ -# Written by Alex Roitman, largely based on Relationship.py by Don Allingham. +# Written by Alex Roitman, largely based on relationship.py by Don Allingham. """ Russian-specific definitions of relationships """ @@ -34,7 +34,7 @@ Russian-specific definitions of relationships #------------------------------------------------------------------------- import gen.lib -import Relationship +import gen.relationship #------------------------------------------------------------------------- @@ -299,13 +299,13 @@ _nephews_nieces_level = [ # # #------------------------------------------------------------------------- -class RelationshipCalculator(Relationship.RelationshipCalculator): +class RelationshipCalculator(gen.relationship.RelationshipCalculator): """ RelationshipCalculator Class """ def __init__(self): - Relationship.RelationshipCalculator.__init__(self) + gen.relationship.RelationshipCalculator.__init__(self) def get_parents(self, level): if level > len(_parents_level)-1: @@ -502,6 +502,6 @@ if __name__ == "__main__": rel_xx.py module, and test your work with: python src/plugins/rel/rel_xx.py """ - from Relationship import test + from gen.relationship import test RC = RelationshipCalculator() test(RC, True) diff --git a/src/plugins/rel/rel_sk.py b/src/plugins/rel/rel_sk.py index d4b3d3dec..7a37af88a 100644 --- a/src/plugins/rel/rel_sk.py +++ b/src/plugins/rel/rel_sk.py @@ -31,7 +31,7 @@ Slovak-specific classes for relationships. #------------------------------------------------------------------------- import gen.lib -import Relationship +import gen.relationship #------------------------------------------------------------------------- # @@ -107,7 +107,7 @@ _nephews_nieces_level = [ "", "synovci a netere", # #------------------------------------------------------------------------- -class RelationshipCalculator(Relationship.RelationshipCalculator): +class RelationshipCalculator(gen.relationship.RelationshipCalculator): """ RelationshipCalculator Class """ @@ -116,7 +116,7 @@ class RelationshipCalculator(Relationship.RelationshipCalculator): def __init__(self): - Relationship.RelationshipCalculator.__init__(self) + gen.relationship.RelationshipCalculator.__init__(self) # od aktívnej osoby vzhľadom k spoločnému predkovi Ga=[level] @@ -232,7 +232,7 @@ class RelationshipCalculator(Relationship.RelationshipCalculator): only_birth=True, in_law_a=False, in_law_b=False): """ - see Relationship.py + see relationship.py """ rel_str = "vzdialení príbuzní" gen = " z %s-ej generácie" @@ -324,7 +324,7 @@ class RelationshipCalculator(Relationship.RelationshipCalculator): only_birth=True, in_law_a=False, in_law_b=False): """ - see Relationship.py + see relationship.py """ if only_birth: step = '' @@ -591,6 +591,6 @@ if __name__ == "__main__": rel_xx.py module, and test your work with: python src/plugins/rel/rel_xx.py """ - from Relationship import test + from gen.relationship import test RC = RelationshipCalculator() test(RC, True) diff --git a/src/plugins/rel/rel_sl.py b/src/plugins/rel/rel_sl.py index 8ee73cc1f..1aac96412 100644 --- a/src/plugins/rel/rel_sl.py +++ b/src/plugins/rel/rel_sl.py @@ -34,7 +34,7 @@ Slovenian-specific definitions of relationships #------------------------------------------------------------------------- import gen.lib -import Relationship +import gen.relationship #------------------------------------------------------------------------- @@ -66,13 +66,13 @@ _neph_niec = [ u"", u"nečaki", u"pranečaki", u"prapranečaki" ] # # #------------------------------------------------------------------------- -class RelationshipCalculator(Relationship.RelationshipCalculator): +class RelationshipCalculator(gen.relationship.RelationshipCalculator): """ RelationshipCalculator Class """ def __init__(self): - Relationship.RelationshipCalculator.__init__(self) + gen.relationship.RelationshipCalculator.__init__(self) def getAncestor(self, level): if level > len(_ancestors)-1: @@ -329,7 +329,7 @@ if __name__ == "__main__": rel_xx.py module, and test your work with: python src/plugins/rel/rel_xx.py """ - from Relationship import test + from gen.relationship import test RC = RelationshipCalculator() test(RC, True) # diff --git a/src/plugins/rel/rel_sv.py b/src/plugins/rel/rel_sv.py index 96d8b8be1..2aedffded 100644 --- a/src/plugins/rel/rel_sv.py +++ b/src/plugins/rel/rel_sv.py @@ -23,7 +23,7 @@ # $Id$ -# Written by Alex Roitman, largely based on Relationship.py by Don Allingham +# Written by Alex Roitman, largely based on relationship.py by Don Allingham # and on valuable input from Jens Arvidsson # Updated to 3.0 by Peter Landgren 2007-12-30. # @@ -37,7 +37,7 @@ Swedish-specific definitions of relationships #------------------------------------------------------------------------- import gen.lib -import Relationship +import gen.relationship #------------------------------------------------------------------------- @@ -67,7 +67,7 @@ u"artonde", u"nittonde", u"tjugonde" ] # # #------------------------------------------------------------------------- -class RelationshipCalculator(Relationship.RelationshipCalculator): +class RelationshipCalculator(gen.relationship.RelationshipCalculator): """ RelationshipCalculator Class """ @@ -80,7 +80,7 @@ class RelationshipCalculator(Relationship.RelationshipCalculator): def __init__(self): - Relationship.RelationshipCalculator.__init__(self) + gen.relationship.RelationshipCalculator.__init__(self) def _get_cousin(self, level, step, inlaw): if level > len(_cousin_level)-1: @@ -540,6 +540,6 @@ if __name__ == "__main__": rel_xx.py module, and test your work with: python src/plugins/rel/rel_xx.py """ - from Relationship import test + from gen.relationship import test RC = RelationshipCalculator() test(RC, True) diff --git a/src/plugins/textreport/BirthdayReport.py b/src/plugins/textreport/BirthdayReport.py index 3cb5a9c7f..8919b4322 100644 --- a/src/plugins/textreport/BirthdayReport.py +++ b/src/plugins/textreport/BirthdayReport.py @@ -40,7 +40,7 @@ import datetime, time from gen.display.name import displayer as global_name_display from gen.errors import ReportError from gen.lib import NameType, EventType, Name, Date, Person -import Relationship +from gen.relationship import get_relationship_calculator from gen.plug.docgen import (FontStyle, ParagraphStyle, GraphicsStyle, FONT_SERIF, PARA_ALIGN_RIGHT, PARA_ALIGN_LEFT, PARA_ALIGN_CENTER) @@ -218,7 +218,7 @@ class CalendarReport(Report): self._user.step_progress) self._user.end_progress() - rel_calc = Relationship.get_relationship_calculator() + rel_calc = get_relationship_calculator() self._user.begin_progress(_('Birthday and Anniversary Report'), _('Reading database...'), len(people)) diff --git a/src/plugins/textreport/KinshipReport.py b/src/plugins/textreport/KinshipReport.py index bca203954..1bdbc88c4 100644 --- a/src/plugins/textreport/KinshipReport.py +++ b/src/plugins/textreport/KinshipReport.py @@ -40,7 +40,7 @@ from gen.ggettext import gettext as _ #------------------------------------------------------------------------ from gen.display.name import displayer as global_name_display from gen.errors import ReportError -import Relationship +from gen.relationship import get_relationship_calculator from gen.plug.docgen import (IndexMark, FontStyle, ParagraphStyle, FONT_SANS_SERIF, INDEX_TYPE_TOC, PARA_ALIGN_CENTER) from gen.plug.menu import (NumberOption, BooleanOption, PersonOption, @@ -100,7 +100,7 @@ class KinshipReport(Report): self._name_display.set_default_format(name_format) self.__db = database - self.rel_calc = Relationship.get_relationship_calculator() + self.rel_calc = get_relationship_calculator() self.kinship_map = {} self.spouse_map = {} diff --git a/src/plugins/tool/RelCalc.py b/src/plugins/tool/RelCalc.py index feea58003..efd6e7eeb 100644 --- a/src/plugins/tool/RelCalc.py +++ b/src/plugins/tool/RelCalc.py @@ -48,7 +48,7 @@ from gen.display.name import displayer as name_displayer from gui.managedwindow import ManagedWindow from gui.views.treemodels import PeopleBaseModel, PersonTreeModel from libpersonview import BasePersonView -import Relationship +from gen.relationship import get_relationship_calculator from gui.dialog import ErrorDialog from gui.plug import tool @@ -93,7 +93,7 @@ class RelCalc(tool.Tool, ManagedWindow): self.colord.append((0, col, size)) self.dbstate = dbstate - self.relationship = Relationship.get_relationship_calculator() + self.relationship = get_relationship_calculator() self.relationship.connect_db_signals(dbstate) self.glade = Glade() diff --git a/src/plugins/webreport/NarrativeWeb.py b/src/plugins/webreport/NarrativeWeb.py index 03d8d65fb..ade57237f 100644 --- a/src/plugins/webreport/NarrativeWeb.py +++ b/src/plugins/webreport/NarrativeWeb.py @@ -108,7 +108,7 @@ from libgedcom import make_gedcom_date from PlaceUtils import conv_lat_lon from gui.pluginmanager import GuiPluginManager -import Relationship +from gen.relationship import get_relationship_calculator #------------------------------------------------ # constants #------------------------------------------------ @@ -7025,7 +7025,7 @@ class NavWebReport(Report): self.base_pages() # for use with discovering biological, half, and step siblings for use in display_ind_parents()... - rel_class = Relationship.get_relationship_calculator() + rel_class = get_relationship_calculator() # build classes IndividualListPage and IndividualPage self.person_pages(ind_list, place_list, source_list, place_lat_long, rel_class)