mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-04-21 14:44:44 +00:00
safe parse info
git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@871 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
parent
b5ebd56f2b
commit
5e4034a76c
1 changed files with 5 additions and 10 deletions
|
|
@ -113,23 +113,18 @@ class LinkParser (HtmlParser):
|
|||
|
||||
def _errorfun (self, msg, name):
|
||||
"""append msg to error list"""
|
||||
pos = "%d:%d" % (self.lineno(), self.column())
|
||||
self.parse_info.append("%s: %s: %s" % (name, pos, msg))
|
||||
print >> sys.stderr, name, pos, msg
|
||||
|
||||
self.parse_info.append("%s at line %d col %d: %s" % \
|
||||
(name, self.last_lineno(), self.last_column(), msg))
|
||||
|
||||
def error (self, msg):
|
||||
"""signal a filter/parser error"""
|
||||
self._errorfun(msg, "error:")
|
||||
|
||||
self._errorfun(msg, "error")
|
||||
|
||||
def warning (self, msg):
|
||||
"""signal a filter/parser warning"""
|
||||
self._errorfun(msg, "warning:")
|
||||
|
||||
self._errorfun(msg, "warning")
|
||||
|
||||
def fatalError (self, msg):
|
||||
"""signal a fatal filter/parser error"""
|
||||
self._errorfun(msg, "fatal error:")
|
||||
|
||||
self._errorfun(msg, "fatal error")
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue