Filtering improvements, web template improvements

svn: r933
This commit is contained in:
Don Allingham
2002-04-18 13:52:40 +00:00
parent e5101afb67
commit 6aecc2c3e8
20 changed files with 395 additions and 216 deletions

View File

@@ -42,6 +42,9 @@ import os
from string import find,join,strip,replace
import gtk
from latin_utf8 import utf8_to_latin
u2l = utf8_to_latin
#-------------------------------------------------------------------------
#
# GRAMPS modules
@@ -741,30 +744,30 @@ class FilterParser(handler.ContentHandler):
def startElement(self,tag,attrs):
if tag == "filter":
self.f = GenericFilter()
self.f.set_name(attrs['name'])
self.f.set_name(u2l(attrs['name']))
if attrs.has_key('function'):
try:
if int(attrs['function']):
if int(u2l(attrs['function'])):
op = 'or'
else:
op = 'and'
except ValueError:
op = attrs['function']
op = u2l(attrs['function'])
self.f.set_logical_op(op)
if attrs.has_key('comment'):
self.f.set_comment(attrs['comment'])
self.f.set_comment(u2l(attrs['comment']))
if attrs.has_key('invert'):
try:
self.f.set_invert(int(attrs['invert']))
self.f.set_invert(int(u2l(attrs['invert'])))
except ValueError:
pass
self.gfilter_list.add(self.f)
elif tag == "rule":
name = _(attrs['class'])
name = _(u2l(attrs['class']))
self.a = []
self.cname = tasks[name]
elif tag == "arg":
self.a.append(attrs['value'])
self.a.append(u2l(attrs['value']))
def endElement(self,tag):
if tag == "rule":