GEPS008: Fix Gedcom Import/Export problem

svn: r19670
This commit is contained in:
Nick Hall 2012-05-27 11:33:12 +00:00
parent e6571398cb
commit 02d0af7c0a
4 changed files with 15 additions and 15 deletions

View File

@ -39,7 +39,7 @@ from gen.ggettext import gettext as _
from gen.ggettext import ngettext
import config
from gen.display.name import displayer as name_displayer
from gen.filters import GenericFilter, Rules
from gen.filters import GenericFilter, rules
from gui.utils import ProgressMeter
class Progress(object):
@ -422,21 +422,21 @@ class WriterOptionBox(object):
des = GenericFilter()
# feature request 2356: avoid genitive form
des.set_name(_("Descendants of %s") % name)
des.add_rule(Rules.Person.IsDescendantOf([gramps_id, 1]))
des.add_rule(rules.person.IsDescendantOf([gramps_id, 1]))
df = GenericFilter()
# feature request 2356: avoid genitive form
df.set_name(_("Descendant Families of %s") % name)
df.add_rule(Rules.Person.IsDescendantFamilyOf([gramps_id, 1]))
df.add_rule(rules.person.IsDescendantFamilyOf([gramps_id, 1]))
ans = GenericFilter()
# feature request 2356: avoid genitive form
ans.set_name(_("Ancestors of %s") % name)
ans.add_rule(Rules.Person.IsAncestorOf([gramps_id, 1]))
ans.add_rule(rules.person.IsAncestorOf([gramps_id, 1]))
com = GenericFilter()
com.set_name(_("People with common ancestor with %s") % name)
com.add_rule(Rules.Person.HasCommonAncestorWith([gramps_id]))
com.add_rule(rules.person.HasCommonAncestorWith([gramps_id]))
return [des, df, ans, com]

View File

@ -139,11 +139,11 @@ class FilterParser(handler.ContentHandler):
Upgrade argument lists to latest version.
"""
# HasPlace rule has extra locality field in v3.3
if self.r == Rules.Place.HasPlace and len(self.a) == 8:
if self.r == rules.place.HasPlace and len(self.a) == 8:
self.a = self.a[0:2] + [u''] + self.a[4:8] + [self.a[3]] + \
[self.a[2]]
# HasNameOf rule has new fields for surnames in v3.3
if self.r == Rules.Person.HasNameOf and len(self.a) == 7:
if self.r == rules.person.HasNameOf and len(self.a) == 7:
self.a = self.a[0:2] + [self.a[3]] + [self.a[2]] + [self.a[6]] + \
[u''] + [self.a[4]] + [u'', u''] + [self.a[5]] + \
[u'', u'0']

View File

@ -247,7 +247,7 @@ def get_person_filters(person, include_single=True):
@param include_single: include a filter to include the single person
@type person: boolean
"""
from gen.filters import GenericFilter, Rules, CustomFilters
from gen.filters import GenericFilter, rules, CustomFilters
from gen.display.name import displayer as name_displayer
if person:
@ -261,30 +261,30 @@ def get_person_filters(person, include_single=True):
if include_single:
filt_id = GenericFilter()
filt_id.set_name(name)
filt_id.add_rule(Rules.Person.HasIdOf([gramps_id]))
filt_id.add_rule(rules.person.HasIdOf([gramps_id]))
all = GenericFilter()
all.set_name(_("Entire Database"))
all.add_rule(Rules.Person.Everyone([]))
all.add_rule(rules.person.Everyone([]))
des = GenericFilter()
# feature request 2356: avoid genitive form
des.set_name(_("Descendants of %s") % name)
des.add_rule(Rules.Person.IsDescendantOf([gramps_id, 1]))
des.add_rule(rules.person.IsDescendantOf([gramps_id, 1]))
df = GenericFilter()
# feature request 2356: avoid genitive form
df.set_name(_("Descendant Families of %s") % name)
df.add_rule(Rules.Person.IsDescendantFamilyOf([gramps_id, 1]))
df.add_rule(rules.person.IsDescendantFamilyOf([gramps_id, 1]))
ans = GenericFilter()
# feature request 2356: avoid genitive form
ans.set_name(_("Ancestors of %s") % name)
ans.add_rule(Rules.Person.IsAncestorOf([gramps_id, 1]))
ans.add_rule(rules.person.IsAncestorOf([gramps_id, 1]))
com = GenericFilter()
com.set_name(_("People with common ancestor with %s") % name)
com.add_rule(Rules.Person.HasCommonAncestorWith([gramps_id]))
com.add_rule(rules.person.HasCommonAncestorWith([gramps_id]))
if include_single:
the_filters = [filt_id, all, des, df, ans, com]

View File

@ -120,7 +120,7 @@ from gen.updatecallback import UpdateCallback
import gen.mime
import LdsUtils
import Utils
import gen.datehandler._dateparser as DateParser
from gen.datehandler._dateparser import DateParser
from gen.db.dbconst import EVENT_KEY
from QuestionDialog import WarningDialog
from gen.lib.const import IDENTICAL, DIFFERENT