Merge changes between 2.0.1 and 2.0.2 with the main trunk

svn: r4785
This commit is contained in:
Alex Roitman
2005-06-05 04:01:56 +00:00
parent 97b0b31fab
commit 9ee0f10127
49 changed files with 11834 additions and 11636 deletions

166
src/plugins/Checkpoint.py Normal file
View File

@@ -0,0 +1,166 @@
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2005 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$
"Database Processing/Extract information from names"
#-------------------------------------------------------------------------
#
# python modules
#
#-------------------------------------------------------------------------
import os
import popen2
import locale
import time
from gettext import gettext as _
#-------------------------------------------------------------------------
#
# gnome/gtk
#
#-------------------------------------------------------------------------
import gtk
#-------------------------------------------------------------------------
#
# gramps modules
#
#-------------------------------------------------------------------------
from QuestionDialog import OkDialog, ErrorDialog
import WriteXML
#-------------------------------------------------------------------------
#
#
#
#-------------------------------------------------------------------------
def runTool(database,active_person,callback,parent=None):
try:
Checkpoint(database,callback,parent)
except:
import DisplayTrace
DisplayTrace.DisplayTrace()
#-------------------------------------------------------------------------
#
# Checkpoint
#
#-------------------------------------------------------------------------
class Checkpoint:
def __init__(self,db,callback,parent):
self.cb = callback
self.db = db
self.parent = parent
self.use_custom = False
self.custom_str = "cat > /tmp/temp.file"
self.run()
def run(self):
"""
RCS will be a builtin command, since we can handle all
configuration on our own. This isn't true for most versioning
systems, which usually require external setup, and external
communication.
"""
self.parent.status_text(_("Checkpointing database..."))
if self.use_custom:
self.custom()
else:
self.rcs()
self.parent.progress.set_fraction(0)
self.parent.modify_statusbar()
def timestamp(self):
format = locale.nl_langinfo(locale.D_T_FMT)
return unicode(time.strftime(format,time.localtime(time.time())))
def custom(self):
"""
Passed the generated XML file to the specified command.
"""
proc = popen2.Popen3(self.custom_str, True)
xmlwrite = WriteXML.XmlWriter(self.db,self.callback,False,False)
xmlwrite.write_handle(proc.tochild)
status = proc.wait()
if status:
ErrorDialog(_("Checkpoint failed"),
"\n".join(proc.childerr.readlines()))
del proc
def rcs(self):
"""
Check the generated XML file into RCS. Initialize the RCS file if
it does not already exist.
"""
(archive_base,ext) = os.path.splitext(self.db.get_save_path())
archive = archive_base + ",v"
if not os.path.exists(archive):
proc = popen2.Popen3('rcs -i -U -q -t-"GRAMPS database" %s' % archive,True)
proc.tochild.write(comment)
proc.tochild.close()
status = proc.wait()
if status:
ErrorDialog(_("Checkpoint failed"),
"\n".join(proc.childerr.readlines()))
del proc
return
xmlwrite = WriteXML.XmlWriter(self.db,self.callback,False,False)
xmlwrite.write(archive_base)
comment = self.timestamp()
proc = popen2.Popen3("ci %s" % archive_base,True)
proc.tochild.write(comment)
proc.tochild.close()
status = proc.wait()
if status:
ErrorDialog(_("Checkpoint failed"),
"\n".join(proc.childerr.readlines()))
del proc
def callback(self,value):
"""
Call back function for the WriteXML function that updates the
status progress bar.
"""
self.parent.progress.set_fraction(value)
while(gtk.events_pending()):
gtk.main_iteration()
#------------------------------------------------------------------------
#
#
#
#------------------------------------------------------------------------
from PluginMgr import register_tool
register_tool(
runTool,
_("Checkpoint the database"),
category=_("Revision control"),
description=_("Store a snapshot of the current database into "
"a revision control system"))

View File

@@ -486,7 +486,8 @@ class FamilyGroupOptions(ReportOptions.ReportOptions):
"""
spouses = self.get_spouses(dialog.db,dialog.person)
spouse_index = self.spouse_menu.get_active()
self.options_dict['spouse_id'] = spouses[spouse_index][0]
if spouses:
self.options_dict['spouse_id'] = spouses[spouse_index][0]
def make_default_style(self,default_style):
"""Make default output style for the Family Group Report."""

View File

@@ -30,7 +30,6 @@ pkgdata_PYTHON = \
IndivComplete.py\
IndivSummary.py\
Merge.py\
NavWebPage.py\
PatchNames.py\
ReadPkg.py\
RelCalc.py\

View File

@@ -612,10 +612,10 @@ class ScratchPadListView:
self.treetips = TreeTips.TreeTips(self._widget,2,True)
# Set the column that inline searching will use.
# Set the column that inline searching will use.
# The search does not appear to work properly so I am disabling it for now.
self._widget.set_enable_search(False)
#self._widget.set_search_column(1)
#self._widget.set_search_column(1)
self._widget.drag_dest_set(gtk.DEST_DEFAULT_ALL,
(ScratchPadListView.LOCAL_DRAG_TARGET,) + \

View File

@@ -29,6 +29,7 @@
#------------------------------------------------------------------------
import os
import shutil
import locale
from gettext import gettext as _
#------------------------------------------------------------------------
@@ -57,6 +58,7 @@ import Errors
import Utils
from QuestionDialog import ErrorDialog
import ReportOptions
from NameDisplay import displayer as _nd
#------------------------------------------------------------------------
#
@@ -943,8 +945,6 @@ class WebReport(Report.Report):
doc.write_text(_("Family Tree Index"))
doc.end_paragraph()
person_handle_list.sort(self.sort.by_last_name)
a = {}
for person_handle in person_handle_list:
person = self.database.get_person_from_handle(person_handle)
@@ -956,7 +956,7 @@ class WebReport(Report.Report):
section_number = 1
link_keys = a.keys()
link_keys.sort()
link_keys.sort(locale.strcoll)
for n in link_keys:
a[n] = section_number
section_number = section_number + 1
@@ -980,6 +980,7 @@ class WebReport(Report.Report):
p_id_list = [ p_id for p_id in person_handle_list if \
(self.database.get_person_from_handle(p_id).get_primary_name().get_surname() \
and (self.database.get_person_from_handle(p_id).get_primary_name().get_surname()[0] == n) ) ]
p_id_list.sort(self.sort.by_sorted_name)
doc = HtmlLinkDoc(self.selected_style,None,template,None)
doc.set_extension(self.ext)
doc.set_title(_("Section %s") % n)
@@ -998,7 +999,7 @@ class WebReport(Report.Report):
for person_handle in p_id_list:
the_person = self.database.get_person_from_handle(person_handle)
name = the_person.get_primary_name().get_name()
name = _nd.sorted(the_person)
if self.birth_dates:
birth_handle = self.database.get_person_from_handle(person_handle).get_birth_handle()
@@ -1040,6 +1041,7 @@ class WebReport(Report.Report):
p_id_list = [ p_id for p_id in person_handle_list if \
(self.database.get_person_from_handle(p_id).get_primary_name().get_surname() \
and (self.database.get_person_from_handle(p_id).get_primary_name().get_surname()[0] == n) ) ]
p_id_list.sort(self.sort.by_sorted_name)
doc.start_paragraph('IndexLabel')
if self.include_alpha_links:
doc.write_linktarget("%03d" % a[n])
@@ -1049,7 +1051,7 @@ class WebReport(Report.Report):
for person_handle in p_id_list:
the_person = self.database.get_person_from_handle(person_handle)
name = the_person.get_primary_name().get_name()
name = _nd.sorted(the_person)
if self.birth_dates:
birth_handle = self.database.get_person_from_handle(person_handle).get_birth_handle()

View File

@@ -20,7 +20,7 @@
<property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
<property name="has_separator">True</property>
<signal name="delete_event" handler="on_scratch_pad_delete_event" last_modification_time="Wed, 25 May 2005 06:50:50 GMT"/>
<signal name="delete_event" handler="on_scratch_pad_delete_event" last_modification_time="Wed, 25 May 2005 13:26:32 GMT"/>
<child internal-child="vbox">
<widget class="GtkVBox" id="dialog-vbox1">