From 711439fa8f865b6cdb6facb05545ad7116e25c38 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Tue, 17 Jul 2001 12:39:56 +0000 Subject: [PATCH] Get around the junk at the beginning of a PAF file file svn: r253 --- gramps/src/plugins/ReadGedcom.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gramps/src/plugins/ReadGedcom.py b/gramps/src/plugins/ReadGedcom.py index 2e5152480..efe944e5a 100644 --- a/gramps/src/plugins/ReadGedcom.py +++ b/gramps/src/plugins/ReadGedcom.py @@ -65,6 +65,7 @@ for val in const.familyConstantEvents.keys(): ged2fam[key] = val lineRE = re.compile(r"\s*(\d+)\s+(\S+)\s*(.*)$") +headRE = re.compile(r"\s*(\d+)\s+HEAD") nameRegexp = re.compile(r"([\S\s]*\S)?\s*/([^/]+)?/\s*,?\s*([\S]+)?") #------------------------------------------------------------------------- @@ -1118,8 +1119,11 @@ class GedcomParser: # #--------------------------------------------------------------------- def parse_header_head(self): - matches = self.get_next() - + line = string.replace(self.lines[self.index],'\r','') + match = headRE.match(line) + if not match: + raise GedcomParser.SyntaxError, self.lines[self.index] + self.index = self.index + 1 if matches[1] != "HEAD": self.barf(0)