* src/ReadXML.py (start_childof): Use integer relations.

* src/WriteXML.py (write_xml_data): Properly test frel.
* src/rule.glade: Change button label; add "need to close" label.
* src/EditPlace.py: Typo.


svn: r4149
This commit is contained in:
Alex Roitman 2005-03-10 00:04:50 +00:00
parent dce5cc2a9b
commit 8c1061b9a7
5 changed files with 98 additions and 16 deletions

View File

@ -16,6 +16,11 @@
* src/data/gramps.schemas: Place dont-ask key into interface dir. * src/data/gramps.schemas: Place dont-ask key into interface dir.
* src/Marriage.py (did_data_change): Compare gramps_id, not handle. * src/Marriage.py (did_data_change): Compare gramps_id, not handle.
* src/ReadXML.py (start_childof): Use integer relations.
* src/WriteXML.py (write_xml_data): Properly test frel.
* src/rule.glade: Change button label; add "need to close" label.
* src/EditPlace.py: Typo.
2005-03-09 Don Allingham <don@gramps-project.org> 2005-03-09 Don Allingham <don@gramps-project.org>
* src/NameEdit.py: assign date on close * src/NameEdit.py: assign date on close

View File

@ -55,7 +55,7 @@ import NameDisplay
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
pycode_tgts = [ pycode_tgts = [
('url' , 0, 0) ('url' , 0, 0),
('srcref', 0, 4)] ('srcref', 0, 4)]
#------------------------------------------------------------------------- #-------------------------------------------------------------------------

View File

@ -797,14 +797,14 @@ class GrampsParser:
if attrs.has_key("mrel"): if attrs.has_key("mrel"):
try: try:
mrel = const.child_rel_notrans[attrs["mrel"]] mrel = const.child_rel_notrans.index(attrs["mrel"])
except: except:
mrel = RelLib.Person.CHILD_REL_NONE mrel = RelLib.Person.CHILD_REL_NONE
else: else:
mrel = RelLib.Person.CHILD_REL_BIRTH mrel = RelLib.Person.CHILD_REL_BIRTH
if attrs.has_key("frel"): if attrs.has_key("frel"):
try: try:
frel = const.child_rel_notrans[attrs["frel"]] frel = const.child_rel_notrans.index(attrs["frel"])
except: except:
frel = RelLib.Person.CHILD_REL_NONE frel = RelLib.Person.CHILD_REL_NONE
else: else:

View File

@ -1,7 +1,7 @@
# #
# Gramps - a GTK+/GNOME based genealogy program # Gramps - a GTK+/GNOME based genealogy program
# #
# Copyright (C) 2000-2004 Donald N. Allingham # Copyright (C) 2000-2005 Donald N. Allingham
# #
# This program is free software; you can redistribute it and/or modify # 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 # it under the terms of the GNU General Public License as published by
@ -30,11 +30,11 @@ GRAMPS' XML file format.
# load standard python libraries # load standard python libraries
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
import string
import time import time
import shutil import shutil
import os import os
import codecs import codecs
from gettext import gettext as _
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
@ -51,8 +51,6 @@ import gtk
import const import const
import RelLib import RelLib
import Date import Date
from gettext import gettext as _
from QuestionDialog import ErrorDialog from QuestionDialog import ErrorDialog
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
@ -196,7 +194,7 @@ class XmlWriter:
def write_xml_data(self): def write_xml_data(self):
date = string.split(time.ctime(time.time())) date = time.ctime(time.time()).split()
owner = self.db.get_researcher() owner = self.db.get_researcher()
person_len = self.db.get_number_of_people() person_len = self.db.get_number_of_people()
family_len = len(self.db.get_family_handles()) family_len = len(self.db.get_family_handles())
@ -211,7 +209,7 @@ class XmlWriter:
self.g.write("<database xmlns=\"http://gramps.sourceforge.net/database\">\n") self.g.write("<database xmlns=\"http://gramps.sourceforge.net/database\">\n")
self.g.write(" <header>\n") self.g.write(" <header>\n")
self.g.write(" <created date=\"%s %s %s\"" % \ self.g.write(" <created date=\"%s %s %s\"" % \
(date[2],string.upper(date[1]),date[4])) (date[2],date[1].upper(),date[4]))
self.g.write(" version=\"" + const.version + "\"") self.g.write(" version=\"" + const.version + "\"")
self.g.write(" people=\"%d\"" % person_len) self.g.write(" people=\"%d\"" % person_len)
self.g.write(" families=\"%d\"" % family_len) self.g.write(" families=\"%d\"" % family_len)
@ -304,7 +302,7 @@ class XmlWriter:
mrel=' mrel="%s"' % const.child_rel_notrans[alt[1]] mrel=' mrel="%s"' % const.child_rel_notrans[alt[1]]
else: else:
mrel='' mrel=''
if alt[2] != "Birth": if alt[2] != RelLib.Person.CHILD_REL_BIRTH:
frel=' frel="%s"' % const.child_rel_notrans[alt[2]] frel=' frel="%s"' % const.child_rel_notrans[alt[2]]
else: else:
frel='' frel=''
@ -455,7 +453,7 @@ class XmlWriter:
self.g.write('<%s format="%d">' % (val,format)) self.g.write('<%s format="%d">' % (val,format))
else: else:
self.g.write('<%s>' % val) self.g.write('<%s>' % val)
self.g.write(self.fix(string.rstrip(text))) self.g.write(self.fix(text.rstrip()))
self.g.write("</%s>\n" % val) self.g.write("</%s>\n" % val)
def write_text(self,val,text,indent=0): def write_text(self,val,text,indent=0):
@ -465,7 +463,7 @@ class XmlWriter:
self.g.write(" " * indent) self.g.write(" " * indent)
self.g.write('<%s>' % val) self.g.write('<%s>' % val)
self.g.write(self.fix(string.rstrip(text))) self.g.write(self.fix(text.rstrip()))
self.g.write("</%s>\n" % val) self.g.write("</%s>\n" % val)
def dump_event(self,event,index=1): def dump_event(self,event,index=1):

View File

@ -411,7 +411,7 @@
<property name="max_length">0</property> <property name="max_length">0</property>
<property name="text" translatable="yes"></property> <property name="text" translatable="yes"></property>
<property name="has_frame">True</property> <property name="has_frame">True</property>
<property name="invisible_char" translatable="yes">*</property> <property name="invisible_char">*</property>
<property name="activates_default">False</property> <property name="activates_default">False</property>
<signal name="changed" handler="on_filter_name_changed"/> <signal name="changed" handler="on_filter_name_changed"/>
</widget> </widget>
@ -434,7 +434,7 @@
<property name="max_length">0</property> <property name="max_length">0</property>
<property name="text" translatable="yes"></property> <property name="text" translatable="yes"></property>
<property name="has_frame">True</property> <property name="has_frame">True</property>
<property name="invisible_char" translatable="yes">*</property> <property name="invisible_char">*</property>
<property name="activates_default">False</property> <property name="activates_default">False</property>
</widget> </widget>
<packing> <packing>
@ -544,12 +544,70 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_default">True</property> <property name="can_default">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="label">gtk-close</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property> <property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property> <property name="focus_on_click">True</property>
<property name="response_id">0</property> <property name="response_id">0</property>
<signal name="clicked" handler="on_close_clicked"/> <signal name="clicked" handler="on_close_clicked"/>
<child>
<widget class="GtkAlignment" id="alignment1">
<property name="visible">True</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xscale">0</property>
<property name="yscale">0</property>
<property name="top_padding">0</property>
<property name="bottom_padding">0</property>
<property name="left_padding">0</property>
<property name="right_padding">0</property>
<child>
<widget class="GtkHBox" id="hbox6">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">2</property>
<child>
<widget class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="stock">gtk-ok</property>
<property name="icon_size">4</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label29">
<property name="visible">True</property>
<property name="label">Apply and close</property>
<property name="use_underline">True</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
</widget>
</child>
</widget>
</child>
</widget> </widget>
</child> </child>
</widget> </widget>
@ -721,6 +779,27 @@
<property name="fill">True</property> <property name="fill">True</property>
</packing> </packing>
</child> </child>
<child>
<widget class="GtkLabel" id="label30">
<property name="visible">True</property>
<property name="label" translatable="yes">Note: changes take effect only after this window is closed</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">6</property>
<property name="ypad">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
</widget> </widget>
<packing> <packing>
<property name="padding">0</property> <property name="padding">0</property>