2007-07-26 Don Allingham <don@gramps-project.org>

* src/DataViews/_PersonView.py: add siblings quick report
	* src/plugins/siblings.py: Added
	* src/plugins/all_events.py: add i18n support
	* src/plugins/Makefile.am: added new files



svn: r8774
This commit is contained in:
Don Allingham 2007-07-27 03:51:54 +00:00
parent cc807f08db
commit 255a59679d
6 changed files with 98 additions and 11 deletions

View File

@ -1,3 +1,9 @@
2007-07-26 Don Allingham <don@gramps-project.org>
* src/DataViews/_PersonView.py: add siblings quick report
* src/plugins/siblings.py: Added
* src/plugins/all_events.py: add i18n support
* src/plugins/Makefile.am: added new files
2007-07-24 Brian Matherly <brian@gramps-project.org>
* po/POTFILES.in: Add ImportCSV.py and ExportCSV.py

View File

@ -277,6 +277,8 @@ src/Selectors/_SelectorFactory.py
src/Selectors/__init__.py
# plugins directory
src/plugins/all_events.py
src/plugins/siblings.py
src/plugins/AncestorChart2.py
src/plugins/AncestorReport.py
src/plugins/BookReport.py

View File

@ -152,8 +152,11 @@ class PersonView(PageView.PersonNavView):
_("Edit the selected person"), self.edit),
('CloseAllNodes', None, _("Collapse all nodes"), None, None,
self.close_all_nodes),
('QuickReport', None, _("Quick Report"), None, None,
('QuickReport', None, _("Quick Report"), None, None, None),
('AllEvents', None, _("All Events"), None, None,
self.quick_report),
('Siblings', None, _("Siblings"), None, None,
self.siblings_report),
])
self.edit_action.add_actions(
@ -411,7 +414,10 @@ class PersonView(PageView.PersonNavView):
<menuitem action="Edit"/>
<menuitem action="Remove"/>
<separator/>
<menuitem action="QuickReport"/>
<menu action="QuickReport">
<menuitem action="AllEvents"/>
<menuitem action="Siblings"/>
</menu>
</popup>
</ui>'''
@ -954,16 +960,23 @@ class PersonView(PageView.PersonNavView):
path = (path[0]+1,)
ofile.end_page()
ofile.close()
def quick_report(self, obj):
def run_report(self, func):
from TextBufDoc import TextBufDoc
from Simple import make_basic_stylesheet
import all_events
if self.dbstate.active:
d = TextBufDoc(make_basic_stylesheet(), None, None)
handle = self.dbstate.active.handle
person = self.dbstate.db.get_person_from_handle(handle)
d.open("")
all_events.run(self.db, d, person)
func(self.db, d, person)
d.close()
def quick_report(self, obj):
import all_events
self.run_report(all_events.run)
def siblings_report(self, obj):
import siblings
self.run_report(siblings.run)

View File

@ -71,7 +71,9 @@ pkgdata_PYTHON = \
MediaManager.py\
RemoveUnused.py\
rel_pl.py\
RebuildRefMap.py
RebuildRefMap.py\
all_events.py \
siblings.py
pkgpyexecdir = @pkgpyexecdir@/plugins
pkgpythondir = @pkgpythondir@/plugins

View File

@ -1,4 +1,26 @@
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2007 Donald N. Allingham
# Copyright (C) 2007 Brian G. Matherly
#
# 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
#
from Simple import SimpleAccess, by_date, SimpleDoc
from gettext import gettext as _
def run(database, document, person):
@ -18,13 +40,12 @@ def run(database, document, person):
# display the results
sd.title("Sorted events of %s" % sa.name(person))
sd.title(_("Sorted events of %s") % sa.name(person))
sd.paragraph("")
sd.header1("Event Type\tEvent Date\tEvent Place")
sd.header1("\t".join(_("Event Type"),_("Event Date"),_("tEvent Place")))
for event in event_list:
sd.paragraph("%-12s\t%-12s\t%s" % (sa.event_type(event),
sa.event_date(event),
sa.event_place(event)))
sd.paragraph("Marriage %s" % sa.marriage_place(person))

43
src/plugins/siblings.py Normal file
View File

@ -0,0 +1,43 @@
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2007 Donald N. Allingham
# Copyright (C) 2007 Brian G. Matherly
#
# 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
#
from Simple import SimpleAccess, by_date, SimpleDoc
from gettext import gettext as _
def run(database, document, person):
sa = SimpleAccess(database)
sd = SimpleDoc(document)
sd.title(_("Siblings of %s") % sa.name(person))
sd.paragraph("")
sd.header1("%-30s\t%-10s\t%s" % (_("Sibling"),_("Gender"),_("Birth Date")))
gid = sa.gid(person)
for family in sa.child_in(person):
for child in sa.children(family):
if sa.gid(child) != gid:
sd.paragraph("%-30s\t%-10s\t%s" % (
sa.name(child),
sa.gender(child),
sa.birth_date(child)))