* 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>
|
||||
* src/po/nl.po: Typo.
|
||||
* 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\
|
||||
gramps_main.py\
|
||||
gramps.py\
|
||||
GraphLayout.py\
|
||||
ImageSelect.py\
|
||||
ImgManip.py\
|
||||
latin_ansel.py\
|
||||
|
@ -731,13 +731,15 @@ class ReloadOptions(Tool.ToolOptions):
|
||||
# Register the plugin reloading tool
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
PluginMgr.register_tool(
|
||||
name = 'reload',
|
||||
category = Tool.TOOL_DEBUG,
|
||||
tool_class = Reload,
|
||||
options_class = ReloadOptions,
|
||||
modes = Tool.MODE_GUI,
|
||||
translated_name = _("Reload plugins"),
|
||||
description=_("Attempt to reload plugins. "
|
||||
"Note: This tool itself is not reloaded!"),
|
||||
)
|
||||
|
||||
if __debug__:
|
||||
PluginMgr.register_tool(
|
||||
name = 'reload',
|
||||
category = Tool.TOOL_DEBUG,
|
||||
tool_class = Reload,
|
||||
options_class = ReloadOptions,
|
||||
modes = Tool.MODE_GUI,
|
||||
translated_name = _("Reload plugins"),
|
||||
description=_("Attempt to reload plugins. "
|
||||
"Note: This tool itself is not reloaded!"),
|
||||
)
|
||||
|
@ -273,4 +273,5 @@ register_report(
|
||||
author_name = "Donald N. Allingham",
|
||||
author_email = "don@gramps-project.org",
|
||||
description = _("Produces a graphical ancestral tree graph"),
|
||||
unsupported = True,
|
||||
)
|
||||
|
@ -519,7 +519,7 @@ register_report(
|
||||
report_class = AncestorChart,
|
||||
options_class = AncestorChartOptions,
|
||||
modes = Report.MODE_GUI | Report.MODE_BKI | Report.MODE_CLI,
|
||||
translated_name = _("Ancestor Chart (Wall Chart)"),
|
||||
translated_name = _("Ancestor Graph"),
|
||||
status = _("Stable"),
|
||||
author_name = "Donald N. Allingham",
|
||||
author_email = "don@gramps-project.org",
|
||||
|
@ -242,18 +242,21 @@ class CmdRefOptions(Tool.ToolOptions):
|
||||
#
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
from PluginMgr import register_tool
|
||||
|
||||
register_tool(
|
||||
name = 'cmdref',
|
||||
category = Tool.TOOL_DEBUG,
|
||||
tool_class = CmdRef,
|
||||
options_class = CmdRefOptions,
|
||||
modes = Tool.MODE_GUI | Tool.MODE_CLI,
|
||||
translated_name = _("Generate Commandline Plugin Reference"),
|
||||
status = _("Stable"),
|
||||
author_name = "Martin Hawlisch",
|
||||
author_email = "martin@hawlisch.de",
|
||||
description=_("Generates a DocBook XML file that contains "
|
||||
"a parameter reference of Reports and Tools.")
|
||||
)
|
||||
if __debug__:
|
||||
|
||||
from PluginMgr import register_tool
|
||||
|
||||
register_tool(
|
||||
name = 'cmdref',
|
||||
category = Tool.TOOL_DEBUG,
|
||||
tool_class = CmdRef,
|
||||
options_class = CmdRefOptions,
|
||||
modes = Tool.MODE_GUI | Tool.MODE_CLI,
|
||||
translated_name = _("Generate Commandline Plugin Reference"),
|
||||
status = _("Stable"),
|
||||
author_name = "Martin Hawlisch",
|
||||
author_email = "martin@hawlisch.de",
|
||||
description=_("Generates a DocBook XML file that contains "
|
||||
"a parameter reference of Reports and Tools.")
|
||||
)
|
||||
|
@ -41,7 +41,6 @@ import gtk
|
||||
# GRAMPS modules
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
import GraphLayout
|
||||
import Report
|
||||
import BaseDoc
|
||||
from SubstKeywords import SubstKeywords
|
||||
@ -57,6 +56,71 @@ _BORN = _('b.')
|
||||
_DIED = _('d.')
|
||||
_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
|
||||
@ -91,7 +155,7 @@ class DescendantGraph(Report.Report):
|
||||
self.lines = 0
|
||||
|
||||
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.text = {}
|
||||
@ -348,4 +412,5 @@ register_report(
|
||||
author_name = "Donald N. Allingham",
|
||||
author_email = "don@gramps-project.org",
|
||||
description = _("Generates a graph of descendants of the active person"),
|
||||
unsupported = True,
|
||||
)
|
||||
|
@ -470,7 +470,7 @@ register_report(
|
||||
report_class = DescendChart,
|
||||
options_class = DescendChartOptions,
|
||||
modes = Report.MODE_GUI | Report.MODE_BKI | Report.MODE_CLI,
|
||||
translated_name = _("Descendant Wall Chart"),
|
||||
translated_name = _("Descendant Graph"),
|
||||
status = _("Stable"),
|
||||
author_name = "Donald N. Allingham",
|
||||
author_email = "don@gramps-project.org",
|
||||
|
@ -88,15 +88,18 @@ class DumpGenderStatsOptions(Tool.ToolOptions):
|
||||
#
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from PluginMgr import register_tool
|
||||
|
||||
register_tool(
|
||||
name = 'dgenstats',
|
||||
category = Tool.TOOL_DEBUG,
|
||||
tool_class = DumpGenderStats,
|
||||
options_class = DumpGenderStatsOptions,
|
||||
modes = Tool.MODE_GUI | Tool.MODE_CLI,
|
||||
translated_name = _("Dumps gender statistics"),
|
||||
description = _("Will dump the statistics for the gender guessing "
|
||||
"from the first name.")
|
||||
)
|
||||
if __debug__:
|
||||
|
||||
from PluginMgr import register_tool
|
||||
|
||||
register_tool(
|
||||
name = 'dgenstats',
|
||||
category = Tool.TOOL_DEBUG,
|
||||
tool_class = DumpGenderStats,
|
||||
options_class = DumpGenderStatsOptions,
|
||||
modes = Tool.MODE_GUI | Tool.MODE_CLI,
|
||||
translated_name = _("Dumps gender statistics"),
|
||||
description = _("Will dump the statistics for the gender guessing "
|
||||
"from the first name.")
|
||||
)
|
||||
|
@ -144,17 +144,19 @@ class EvalOptions(Tool.ToolOptions):
|
||||
#
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
from PluginMgr import register_tool
|
||||
|
||||
register_tool(
|
||||
name = 'eval',
|
||||
category = Tool.TOOL_DEBUG,
|
||||
tool_class = Eval,
|
||||
options_class = EvalOptions,
|
||||
modes = Tool.MODE_GUI,
|
||||
translated_name = _("Python evaluation window"),
|
||||
status = _("Stable"),
|
||||
author_name = "Donald N. Allingham",
|
||||
author_email = "don@gramps-project.org",
|
||||
description=_("Provides a window that can evaluate python code")
|
||||
)
|
||||
if __debug__:
|
||||
from PluginMgr import register_tool
|
||||
|
||||
register_tool(
|
||||
name = 'eval',
|
||||
category = Tool.TOOL_DEBUG,
|
||||
tool_class = Eval,
|
||||
options_class = EvalOptions,
|
||||
modes = Tool.MODE_GUI,
|
||||
translated_name = _("Python evaluation window"),
|
||||
status = _("Stable"),
|
||||
author_name = "Donald N. Allingham",
|
||||
author_email = "don@gramps-project.org",
|
||||
description=_("Provides a window that can evaluate python code")
|
||||
)
|
||||
|
@ -140,17 +140,19 @@ class LeakOptions(Tool.ToolOptions):
|
||||
#
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
from PluginMgr import register_tool
|
||||
|
||||
register_tool(
|
||||
name = 'eval',
|
||||
category = Tool.TOOL_DEBUG,
|
||||
tool_class = Leak,
|
||||
options_class = LeakOptions,
|
||||
modes = Tool.MODE_GUI,
|
||||
translated_name = _("Show uncollected objects"),
|
||||
status = _("Stable"),
|
||||
author_name = "Donald N. Allingham",
|
||||
author_email = "don@gramps-project.org",
|
||||
description=_("Provide a window listing all uncollected objects"),
|
||||
)
|
||||
if __debug__:
|
||||
from PluginMgr import register_tool
|
||||
|
||||
register_tool(
|
||||
name = 'eval',
|
||||
category = Tool.TOOL_DEBUG,
|
||||
tool_class = Leak,
|
||||
options_class = LeakOptions,
|
||||
modes = Tool.MODE_GUI,
|
||||
translated_name = _("Show uncollected objects"),
|
||||
status = _("Stable"),
|
||||
author_name = "Donald N. Allingham",
|
||||
author_email = "don@gramps-project.org",
|
||||
description=_("Provide a window listing all uncollected objects"),
|
||||
)
|
||||
|
@ -1377,18 +1377,22 @@ class TestcaseGeneratorOptions(Tool.ToolOptions):
|
||||
#
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from PluginMgr import register_tool
|
||||
|
||||
register_tool(
|
||||
name = 'testcasegenerator',
|
||||
category = Tool.TOOL_DEBUG,
|
||||
tool_class = TestcaseGenerator,
|
||||
options_class = TestcaseGeneratorOptions,
|
||||
modes = Tool.MODE_GUI | Tool.MODE_CLI,
|
||||
translated_name = _("Generate Testcases for persons and families"),
|
||||
status = _("Beta"),
|
||||
author_name = "Martin Hawlisch",
|
||||
author_email = "martin@hawlisch.de",
|
||||
description = _("The testcase generator will generate some persons and families"
|
||||
" that have broken links in the database or data that is in conflict to a relation.")
|
||||
)
|
||||
if __debug__:
|
||||
from PluginMgr import register_tool
|
||||
|
||||
register_tool(
|
||||
name = 'testcasegenerator',
|
||||
category = Tool.TOOL_DEBUG,
|
||||
tool_class = TestcaseGenerator,
|
||||
options_class = TestcaseGeneratorOptions,
|
||||
modes = Tool.MODE_GUI | Tool.MODE_CLI,
|
||||
translated_name = _("Generate Testcases for persons and families"),
|
||||
status = _("Beta"),
|
||||
author_name = "Martin Hawlisch",
|
||||
author_email = "martin@hawlisch.de",
|
||||
description = _("The testcase generator will generate some persons "
|
||||
"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