* src/GraphLayout.py: removed, incorporated into DesGraph
* src/Makefile.am: removed GraphLayout.py * src/Plugins.py: don't enter into menus if not in debug mode * src/plugins/CmdRef.py: don't enter into menus if not in debug mode * src/plugins/Eval.py: don't enter into menus if not in debug mode * src/plugins/Leak.py: don't enter into menus if not in debug mode * src/plugins/TestcaseGenerator.py: don't enter into menus if not in debug mode * src/plugins/DumpGenderStats.py: don't enter into menus if not * src/AncestorChart.py: Move to unsupported * src/DesGraph.py: Move to unsupported * src/AncestorChart2.py: More consistent name * src/DescendChart.py: More consistent name svn: r5398
This commit is contained in:
parent
052833510f
commit
ee076d94bd
@ -1,3 +1,18 @@
|
|||||||
|
2005-11-10 Don Allingham <don@gramps-project.org>
|
||||||
|
* src/GraphLayout.py: removed, incorporated into DesGraph
|
||||||
|
* src/Makefile.am: removed GraphLayout.py
|
||||||
|
* src/Plugins.py: don't enter into menus if not in debug mode
|
||||||
|
* src/plugins/CmdRef.py: don't enter into menus if not in debug mode
|
||||||
|
* src/plugins/Eval.py: don't enter into menus if not in debug mode
|
||||||
|
* src/plugins/Leak.py: don't enter into menus if not in debug mode
|
||||||
|
* src/plugins/TestcaseGenerator.py: don't enter into menus if not
|
||||||
|
in debug mode
|
||||||
|
* src/plugins/DumpGenderStats.py: don't enter into menus if not
|
||||||
|
* src/AncestorChart.py: Move to unsupported
|
||||||
|
* src/DesGraph.py: Move to unsupported
|
||||||
|
* src/AncestorChart2.py: More consistent name
|
||||||
|
* src/DescendChart.py: More consistent name
|
||||||
|
|
||||||
2005-11-10 Alex Roitman <shura@gramps-project.org>
|
2005-11-10 Alex Roitman <shura@gramps-project.org>
|
||||||
* src/po/nl.po: Typo.
|
* src/po/nl.po: Typo.
|
||||||
* src/plugins/IndivSummary.py: Move to Unsupported (duplicates
|
* src/plugins/IndivSummary.py: Move to Unsupported (duplicates
|
||||||
|
@ -1,91 +0,0 @@
|
|||||||
#
|
|
||||||
# Gramps - a GTK+/GNOME based genealogy program
|
|
||||||
#
|
|
||||||
# Copyright (C) 2000-2004 Donald N. Allingham
|
|
||||||
#
|
|
||||||
# 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$
|
|
||||||
|
|
||||||
|
|
||||||
import sets
|
|
||||||
import Errors
|
|
||||||
import NameDisplay
|
|
||||||
|
|
||||||
class GraphLayout:
|
|
||||||
|
|
||||||
def __init__(self,database,plist,person_handle):
|
|
||||||
self.database = database
|
|
||||||
self.plist = plist
|
|
||||||
self.person_handle = person_handle
|
|
||||||
self.v = []
|
|
||||||
self.e = []
|
|
||||||
self.maxx = 0
|
|
||||||
self.maxy = 0
|
|
||||||
|
|
||||||
def max_size(self):
|
|
||||||
return (self.maxx,self.maxy)
|
|
||||||
|
|
||||||
def layout(self):
|
|
||||||
return ([],[])
|
|
||||||
|
|
||||||
class DescendLine(GraphLayout):
|
|
||||||
|
|
||||||
def layout(self):
|
|
||||||
self.elist = [(0,0)]
|
|
||||||
try:
|
|
||||||
self.space_for(self.person_handle)
|
|
||||||
except RuntimeError,msg:
|
|
||||||
person = self.database.get_person_from_handle(self.person_handle)
|
|
||||||
raise Errors.DatabaseError(
|
|
||||||
_("Database error: %s is defined as his or her own ancestor") %
|
|
||||||
NameDisplay.displayer.display(person))
|
|
||||||
|
|
||||||
return (self.v,self.e[1:])
|
|
||||||
|
|
||||||
def space_for(self,person_handle,level=1.0,pos=1.0):
|
|
||||||
|
|
||||||
person = self.database.get_person_from_handle(person_handle)
|
|
||||||
|
|
||||||
last = self.elist[-1]
|
|
||||||
self.elist.append((level,pos))
|
|
||||||
self.e.append((last[0],last[1],level,pos))
|
|
||||||
self.v.append((person_handle,level,pos))
|
|
||||||
if level > self.maxx:
|
|
||||||
self.maxx = level
|
|
||||||
if pos > self.maxy:
|
|
||||||
self.maxy = pos
|
|
||||||
|
|
||||||
for family_handle in person.get_family_handle_list():
|
|
||||||
family = self.database.get_family_from_handle(family_handle)
|
|
||||||
for child_handle in family.get_child_handle_list():
|
|
||||||
self.space_for(child_handle,level+1.0,pos)
|
|
||||||
pos = pos + max(self.depth(child_handle),1)
|
|
||||||
if pos > self.maxy:
|
|
||||||
self.maxy = pos
|
|
||||||
self.elist.pop()
|
|
||||||
|
|
||||||
def depth(self,person_handle,val=0):
|
|
||||||
person = self.database.get_person_from_handle(person_handle)
|
|
||||||
for family_handle in person.get_family_handle_list():
|
|
||||||
family = self.database.get_family_from_handle(family_handle)
|
|
||||||
clist = family.get_child_handle_list()
|
|
||||||
val = val + len(clist)
|
|
||||||
for child_handle in clist:
|
|
||||||
d = self.depth(child_handle)
|
|
||||||
if d > 0:
|
|
||||||
val = val + d - 1 #first child is always on the same
|
|
||||||
return val #row as the parent, so subtract 1
|
|
@ -65,7 +65,6 @@ gdir_PYTHON = \
|
|||||||
GrampsMime.py\
|
GrampsMime.py\
|
||||||
gramps_main.py\
|
gramps_main.py\
|
||||||
gramps.py\
|
gramps.py\
|
||||||
GraphLayout.py\
|
|
||||||
ImageSelect.py\
|
ImageSelect.py\
|
||||||
ImgManip.py\
|
ImgManip.py\
|
||||||
latin_ansel.py\
|
latin_ansel.py\
|
||||||
|
@ -731,7 +731,9 @@ class ReloadOptions(Tool.ToolOptions):
|
|||||||
# Register the plugin reloading tool
|
# Register the plugin reloading tool
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
PluginMgr.register_tool(
|
|
||||||
|
if __debug__:
|
||||||
|
PluginMgr.register_tool(
|
||||||
name = 'reload',
|
name = 'reload',
|
||||||
category = Tool.TOOL_DEBUG,
|
category = Tool.TOOL_DEBUG,
|
||||||
tool_class = Reload,
|
tool_class = Reload,
|
||||||
|
@ -273,4 +273,5 @@ register_report(
|
|||||||
author_name = "Donald N. Allingham",
|
author_name = "Donald N. Allingham",
|
||||||
author_email = "don@gramps-project.org",
|
author_email = "don@gramps-project.org",
|
||||||
description = _("Produces a graphical ancestral tree graph"),
|
description = _("Produces a graphical ancestral tree graph"),
|
||||||
|
unsupported = True,
|
||||||
)
|
)
|
||||||
|
@ -519,7 +519,7 @@ register_report(
|
|||||||
report_class = AncestorChart,
|
report_class = AncestorChart,
|
||||||
options_class = AncestorChartOptions,
|
options_class = AncestorChartOptions,
|
||||||
modes = Report.MODE_GUI | Report.MODE_BKI | Report.MODE_CLI,
|
modes = Report.MODE_GUI | Report.MODE_BKI | Report.MODE_CLI,
|
||||||
translated_name = _("Ancestor Chart (Wall Chart)"),
|
translated_name = _("Ancestor Graph"),
|
||||||
status = _("Stable"),
|
status = _("Stable"),
|
||||||
author_name = "Donald N. Allingham",
|
author_name = "Donald N. Allingham",
|
||||||
author_email = "don@gramps-project.org",
|
author_email = "don@gramps-project.org",
|
||||||
|
@ -242,9 +242,12 @@ class CmdRefOptions(Tool.ToolOptions):
|
|||||||
#
|
#
|
||||||
#
|
#
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
from PluginMgr import register_tool
|
|
||||||
|
|
||||||
register_tool(
|
if __debug__:
|
||||||
|
|
||||||
|
from PluginMgr import register_tool
|
||||||
|
|
||||||
|
register_tool(
|
||||||
name = 'cmdref',
|
name = 'cmdref',
|
||||||
category = Tool.TOOL_DEBUG,
|
category = Tool.TOOL_DEBUG,
|
||||||
tool_class = CmdRef,
|
tool_class = CmdRef,
|
||||||
|
@ -41,7 +41,6 @@ import gtk
|
|||||||
# GRAMPS modules
|
# GRAMPS modules
|
||||||
#
|
#
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
import GraphLayout
|
|
||||||
import Report
|
import Report
|
||||||
import BaseDoc
|
import BaseDoc
|
||||||
from SubstKeywords import SubstKeywords
|
from SubstKeywords import SubstKeywords
|
||||||
@ -57,6 +56,71 @@ _BORN = _('b.')
|
|||||||
_DIED = _('d.')
|
_DIED = _('d.')
|
||||||
_sep = 0.5
|
_sep = 0.5
|
||||||
|
|
||||||
|
class GraphLayout:
|
||||||
|
|
||||||
|
def __init__(self,database,plist,person_handle):
|
||||||
|
self.database = database
|
||||||
|
self.plist = plist
|
||||||
|
self.person_handle = person_handle
|
||||||
|
self.v = []
|
||||||
|
self.e = []
|
||||||
|
self.maxx = 0
|
||||||
|
self.maxy = 0
|
||||||
|
|
||||||
|
def max_size(self):
|
||||||
|
return (self.maxx,self.maxy)
|
||||||
|
|
||||||
|
def layout(self):
|
||||||
|
return ([],[])
|
||||||
|
|
||||||
|
class DescendLine(GraphLayout):
|
||||||
|
|
||||||
|
def layout(self):
|
||||||
|
self.elist = [(0,0)]
|
||||||
|
try:
|
||||||
|
self.space_for(self.person_handle)
|
||||||
|
except RuntimeError,msg:
|
||||||
|
person = self.database.get_person_from_handle(self.person_handle)
|
||||||
|
raise Errors.DatabaseError(
|
||||||
|
_("Database error: %s is defined as his or her own ancestor") %
|
||||||
|
NameDisplay.displayer.display(person))
|
||||||
|
|
||||||
|
return (self.v,self.e[1:])
|
||||||
|
|
||||||
|
def space_for(self,person_handle,level=1.0,pos=1.0):
|
||||||
|
|
||||||
|
person = self.database.get_person_from_handle(person_handle)
|
||||||
|
|
||||||
|
last = self.elist[-1]
|
||||||
|
self.elist.append((level,pos))
|
||||||
|
self.e.append((last[0],last[1],level,pos))
|
||||||
|
self.v.append((person_handle,level,pos))
|
||||||
|
if level > self.maxx:
|
||||||
|
self.maxx = level
|
||||||
|
if pos > self.maxy:
|
||||||
|
self.maxy = pos
|
||||||
|
|
||||||
|
for family_handle in person.get_family_handle_list():
|
||||||
|
family = self.database.get_family_from_handle(family_handle)
|
||||||
|
for child_handle in family.get_child_handle_list():
|
||||||
|
self.space_for(child_handle,level+1.0,pos)
|
||||||
|
pos = pos + max(self.depth(child_handle),1)
|
||||||
|
if pos > self.maxy:
|
||||||
|
self.maxy = pos
|
||||||
|
self.elist.pop()
|
||||||
|
|
||||||
|
def depth(self,person_handle,val=0):
|
||||||
|
person = self.database.get_person_from_handle(person_handle)
|
||||||
|
for family_handle in person.get_family_handle_list():
|
||||||
|
family = self.database.get_family_from_handle(family_handle)
|
||||||
|
clist = family.get_child_handle_list()
|
||||||
|
val = val + len(clist)
|
||||||
|
for child_handle in clist:
|
||||||
|
d = self.depth(child_handle)
|
||||||
|
if d > 0:
|
||||||
|
val = val + d - 1 #first child is always on the same
|
||||||
|
return val #row as the parent, so subtract 1
|
||||||
|
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# DescendantGraph
|
# DescendantGraph
|
||||||
@ -91,7 +155,7 @@ class DescendantGraph(Report.Report):
|
|||||||
self.lines = 0
|
self.lines = 0
|
||||||
|
|
||||||
plist = self.database.get_person_handles(sort_handles=False)
|
plist = self.database.get_person_handles(sort_handles=False)
|
||||||
self.layout = GraphLayout.DescendLine(self.database,plist,person.get_handle())
|
self.layout = DescendLine(self.database,plist,person.get_handle())
|
||||||
(self.v,self.e) = self.layout.layout()
|
(self.v,self.e) = self.layout.layout()
|
||||||
|
|
||||||
self.text = {}
|
self.text = {}
|
||||||
@ -348,4 +412,5 @@ register_report(
|
|||||||
author_name = "Donald N. Allingham",
|
author_name = "Donald N. Allingham",
|
||||||
author_email = "don@gramps-project.org",
|
author_email = "don@gramps-project.org",
|
||||||
description = _("Generates a graph of descendants of the active person"),
|
description = _("Generates a graph of descendants of the active person"),
|
||||||
|
unsupported = True,
|
||||||
)
|
)
|
||||||
|
@ -470,7 +470,7 @@ register_report(
|
|||||||
report_class = DescendChart,
|
report_class = DescendChart,
|
||||||
options_class = DescendChartOptions,
|
options_class = DescendChartOptions,
|
||||||
modes = Report.MODE_GUI | Report.MODE_BKI | Report.MODE_CLI,
|
modes = Report.MODE_GUI | Report.MODE_BKI | Report.MODE_CLI,
|
||||||
translated_name = _("Descendant Wall Chart"),
|
translated_name = _("Descendant Graph"),
|
||||||
status = _("Stable"),
|
status = _("Stable"),
|
||||||
author_name = "Donald N. Allingham",
|
author_name = "Donald N. Allingham",
|
||||||
author_email = "don@gramps-project.org",
|
author_email = "don@gramps-project.org",
|
||||||
|
@ -88,9 +88,12 @@ class DumpGenderStatsOptions(Tool.ToolOptions):
|
|||||||
#
|
#
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
from PluginMgr import register_tool
|
|
||||||
|
|
||||||
register_tool(
|
if __debug__:
|
||||||
|
|
||||||
|
from PluginMgr import register_tool
|
||||||
|
|
||||||
|
register_tool(
|
||||||
name = 'dgenstats',
|
name = 'dgenstats',
|
||||||
category = Tool.TOOL_DEBUG,
|
category = Tool.TOOL_DEBUG,
|
||||||
tool_class = DumpGenderStats,
|
tool_class = DumpGenderStats,
|
||||||
|
@ -144,9 +144,11 @@ class EvalOptions(Tool.ToolOptions):
|
|||||||
#
|
#
|
||||||
#
|
#
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
from PluginMgr import register_tool
|
|
||||||
|
|
||||||
register_tool(
|
if __debug__:
|
||||||
|
from PluginMgr import register_tool
|
||||||
|
|
||||||
|
register_tool(
|
||||||
name = 'eval',
|
name = 'eval',
|
||||||
category = Tool.TOOL_DEBUG,
|
category = Tool.TOOL_DEBUG,
|
||||||
tool_class = Eval,
|
tool_class = Eval,
|
||||||
|
@ -140,9 +140,11 @@ class LeakOptions(Tool.ToolOptions):
|
|||||||
#
|
#
|
||||||
#
|
#
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
from PluginMgr import register_tool
|
|
||||||
|
|
||||||
register_tool(
|
if __debug__:
|
||||||
|
from PluginMgr import register_tool
|
||||||
|
|
||||||
|
register_tool(
|
||||||
name = 'eval',
|
name = 'eval',
|
||||||
category = Tool.TOOL_DEBUG,
|
category = Tool.TOOL_DEBUG,
|
||||||
tool_class = Leak,
|
tool_class = Leak,
|
||||||
|
@ -1377,9 +1377,11 @@ class TestcaseGeneratorOptions(Tool.ToolOptions):
|
|||||||
#
|
#
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
from PluginMgr import register_tool
|
|
||||||
|
|
||||||
register_tool(
|
if __debug__:
|
||||||
|
from PluginMgr import register_tool
|
||||||
|
|
||||||
|
register_tool(
|
||||||
name = 'testcasegenerator',
|
name = 'testcasegenerator',
|
||||||
category = Tool.TOOL_DEBUG,
|
category = Tool.TOOL_DEBUG,
|
||||||
tool_class = TestcaseGenerator,
|
tool_class = TestcaseGenerator,
|
||||||
@ -1389,6 +1391,8 @@ register_tool(
|
|||||||
status = _("Beta"),
|
status = _("Beta"),
|
||||||
author_name = "Martin Hawlisch",
|
author_name = "Martin Hawlisch",
|
||||||
author_email = "martin@hawlisch.de",
|
author_email = "martin@hawlisch.de",
|
||||||
description = _("The testcase generator will generate some persons and families"
|
description = _("The testcase generator will generate some persons "
|
||||||
" that have broken links in the database or data that is in conflict to a relation.")
|
"and families that have broken links in the database "
|
||||||
|
"or data that is in conflict to a relation.")
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user