2007-04-20 Don Allingham <don@gramps-project.org>

* src/DisplayModels/_BaseModel.py (BaseModel.add_row_by_handle): 
	if search not defined, do an insert
	* src/GrampsDb/_ReadGedcom.py: fix calendar parsing
	* src/GrampsDb/_WriteGedcom.py: fix calendar generation



svn: r8413
This commit is contained in:
Don Allingham 2007-04-21 04:54:28 +00:00
parent 1c2514d9b2
commit dc2afe8f55
6 changed files with 493 additions and 284 deletions

View File

@ -1,3 +1,9 @@
2007-04-20 Don Allingham <don@gramps-project.org>
* src/DisplayModels/_BaseModel.py (BaseModel.add_row_by_handle):
if search not defined, do an insert
* src/GrampsDb/_ReadGedcom.py: fix calendar parsing
* src/GrampsDb/_WriteGedcom.py: fix calendar generation
2007-04-19 Brian Matherly <brian@gramps-project.org>
* src/docgen/ODFDoc.py: PROPERLY escape ampersands

File diff suppressed because it is too large Load Diff

View File

@ -64,7 +64,7 @@ import QuestionDialog
# constants
#
#-------------------------------------------------------------------------
DEFAULT_DIR = os.path.join(const.home_dir,"grampsdb")
DEFAULT_DIR = os.path.join(const.home_dir, "grampsdb")
DEFAULT_TITLE = _("Family Tree")
NAME_FILE = "name.txt"
META_NAME = "meta_data.db"

View File

@ -254,7 +254,7 @@ class BaseModel(gtk.GenericTreeModel):
self.node_map.clear_map()
def add_row_by_handle(self,handle):
if self.search and self.search.match(handle):
if not self.search or (self.search and self.search.match(handle)):
data = self.map(handle)
key = locale.strxfrm(self.sort_func(data))

View File

@ -79,9 +79,9 @@ for __val in personalConstantAttributes.keys():
#-------------------------------------------------------------------------
MOD = re.compile(r"\s*(INT|EST|CAL)\s+(.*)$")
CAL = re.compile(r"\s*(ABT|BEF|AFT)?\s*@#D([^@]+)@\s*(.*)$")
RANGE = re.compile(r"\s*BET\s+@#D([^@]+)@\s*(.*)\s+AND\s+@#D([^@]+)@\s*(.*)$")
SPAN = re.compile(r"\s*FROM\s+@#D([^@]+)@\s*(.*)\s+TO\s+@#D([^@]+)@\s*(.*)$")
CAL = re.compile(r"\s*(ABT|BEF|AFT)?\s*@#D?([^@]+)@\s*(.*)$")
RANGE = re.compile(r"\s*BET\s+@#D?([^@]+)@\s*(.*)\s+AND\s+@#D?([^@]+)@\s*(.*)$")
SPAN = re.compile(r"\s*FROM\s+@#D?([^@]+)@\s*(.*)\s+TO\s+@#D?([^@]+)@\s*(.*)$")
CALENDAR_MAP = {
"FRENCH R" : RelLib.Date.CAL_FRENCH,
@ -296,7 +296,10 @@ def extract_date(text):
match = CAL.match(text)
if match:
(abt, cal, data) = match.groups()
if abt:
dateobj = DATE_CNV.parse("%s %s" % (abt, data))
else:
dateobj = DATE_CNV.parse(data)
dateobj.set_calendar(CALENDAR_MAP.get(cal,
RelLib.Date.CAL_GREGORIAN))
dateobj.set_quality(qual)

View File

@ -105,9 +105,9 @@ _month = [
"JUL", "AUG", "SEP", "OCT", "NOV", "DEC" ]
_calmap = {
RelLib.Date.CAL_HEBREW : (_hmonth, '@#HEBREW@'),
RelLib.Date.CAL_FRENCH : (_fmonth, '@#FRENCH R@'),
RelLib.Date.CAL_JULIAN : (_month, '@#JULIAN@'),
RelLib.Date.CAL_HEBREW : (_hmonth, '@#DHEBREW@'),
RelLib.Date.CAL_FRENCH : (_fmonth, '@#DFRENCH R@'),
RelLib.Date.CAL_JULIAN : (_month, '@#DJULIAN@'),
}
_caldef = {