Minor cleanup

svn: r1554
This commit is contained in:
Alex Roitman 2003-05-20 21:58:24 +00:00
parent 9801107224
commit 8a0324d967

View File

@ -351,7 +351,7 @@ class GedcomParser:
else: else:
self.groups = (int(l[0]),l[1],l[2]) self.groups = (int(l[0]),l[1],l[2])
except: except:
msg = _("Warning: line %d was not understood, so it was ignored.") % self.index msg = _("Warning: line %d was not understood, so it was ignored.") % self.index
msg = "%s\n\t%s\n" % (msg,self.text) msg = "%s\n\t%s\n" % (msg,self.text)
self.errmsg(msg) self.errmsg(msg)
self.error_count = self.error_count + 1 self.error_count = self.error_count + 1
@ -360,26 +360,17 @@ class GedcomParser:
return self.groups return self.groups
def barf(self,level): def barf(self,level):
msg = _("Warning: line %d was not understood, so it was ignored.") % self.index msg = _("Warning: line %d was not understood, so it was ignored.") % self.index
if self.window: self.errmsg(msg)
self.errmsg(msg)
else:
print msg
msg = "\n\t%s\n" % self.text msg = "\n\t%s\n" % self.text
if self.window: self.errmsg(msg)
self.errmsg(msg) self.error_count = self.error_count + 1
self.error_count = self.error_count + 1
else:
print msg
self.ignore_sub_junk(level) self.ignore_sub_junk(level)
def warn(self,msg): def warn(self,msg):
if self.window: self.errmsg(msg)
self.errmsg(msg) self.error_count = self.error_count + 1
self.error_count = self.error_count + 1
else:
print msg
def backup(self): def backup(self):
self.backoff = 1 self.backoff = 1