mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-04-01 05:30:26 +00:00
ignore flush errors
git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@1335 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
parent
896d992f77
commit
715a80afff
7 changed files with 31 additions and 20 deletions
|
|
@ -59,7 +59,7 @@ class CSVLogger (StandardLogger):
|
|||
"# dlsize;"+self.lineterminator+\
|
||||
"# checktime;"+self.lineterminator+\
|
||||
"# cached;"+self.lineterminator)
|
||||
self.fd.flush()
|
||||
self.flush()
|
||||
self.writer = csv.writer(self.fd, dialect='excel', delimiter=self.separator, lineterminator=self.lineterminator)
|
||||
|
||||
|
||||
|
|
@ -75,7 +75,7 @@ class CSVLogger (StandardLogger):
|
|||
urlData.dlsize, urlData.checktime,
|
||||
urlData.cached]
|
||||
self.writer.writerow(row)
|
||||
self.fd.flush()
|
||||
self.flush()
|
||||
|
||||
|
||||
def endOfOutput (self, linknumber=-1):
|
||||
|
|
@ -85,6 +85,6 @@ class CSVLogger (StandardLogger):
|
|||
duration = self.stoptime - self.starttime
|
||||
self.fd.write("# "+i18n._("Stopped checking at %s (%s)%s")%\
|
||||
(strtime(self.stoptime), strduration(duration), self.lineterminator))
|
||||
self.fd.flush()
|
||||
self.flush()
|
||||
self.fd.close()
|
||||
self.fd = None
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@ class ColoredLogger (StandardLogger):
|
|||
self.errors += 1
|
||||
self.fd.write(self.colorinvalid+urlData.errorString+
|
||||
self.colorreset+"\n")
|
||||
self.fd.flush()
|
||||
self.flush()
|
||||
|
||||
def endOfOutput (self, linknumber=-1):
|
||||
if self.fd is None: return
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ class GMLLogger (StandardLogger):
|
|||
self.fd.write("# "+(i18n._("Write comments and bugs to %s\n\n") % \
|
||||
Config.Email))
|
||||
self.fd.write("graph [\n directed 1\n")
|
||||
self.fd.flush()
|
||||
self.flush()
|
||||
|
||||
|
||||
def newUrl (self, urlData):
|
||||
|
|
@ -85,7 +85,7 @@ class GMLLogger (StandardLogger):
|
|||
if self.has_field("result"):
|
||||
self.fd.write(" valid %d\n" % (node.valid and 1 or 0))
|
||||
self.fd.write(" ]\n")
|
||||
self.fd.flush()
|
||||
self.flush()
|
||||
|
||||
|
||||
def endOfOutput (self, linknumber=-1):
|
||||
|
|
@ -96,5 +96,5 @@ class GMLLogger (StandardLogger):
|
|||
duration = self.stoptime - self.starttime
|
||||
self.fd.write("# "+i18n._("Stopped checking at %s (%s)\n")%\
|
||||
(strtime(self.stoptime), strduration(duration)))
|
||||
self.fd.flush()
|
||||
self.flush()
|
||||
self.fd = None
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ class HtmlLogger (StandardLogger):
|
|||
"<br><blockquote>"+Config.Freeware+"<br><br>"+
|
||||
(i18n._("Start checking at %s\n") % strtime(self.starttime))+
|
||||
"<br>")
|
||||
self.fd.flush()
|
||||
self.flush()
|
||||
|
||||
|
||||
def newUrl (self, urlData):
|
||||
|
|
@ -136,7 +136,7 @@ class HtmlLogger (StandardLogger):
|
|||
"</td>\n"+self.tableerror+
|
||||
urlData.errorString+"</td>\n</tr>\n")
|
||||
self.fd.write("</table></td></tr></table><br clear=\"all\">")
|
||||
self.fd.flush()
|
||||
self.flush()
|
||||
|
||||
|
||||
def endOfOutput (self, linknumber=-1):
|
||||
|
|
@ -169,5 +169,5 @@ class HtmlLogger (StandardLogger):
|
|||
self.fd.write(i18n._("Write comments and bugs to %s\n\n") %\
|
||||
('<a href="mailto:'+Config.Email+'">'+Config.Email+"</a>."))
|
||||
self.fd.write("</small></body></html>")
|
||||
self.fd.flush()
|
||||
self.flush()
|
||||
self.fd = None
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ class SQLLogger (StandardLogger):
|
|||
self.fd.write("-- "+(i18n._("Get the newest version at %s\n") % Config.Url))
|
||||
self.fd.write("-- "+(i18n._("Write comments and bugs to %s\n\n") % \
|
||||
Config.Email))
|
||||
self.fd.flush()
|
||||
self.flush()
|
||||
|
||||
|
||||
def newUrl (self, urlData):
|
||||
|
|
@ -69,7 +69,7 @@ class SQLLogger (StandardLogger):
|
|||
urlData.dlsize,
|
||||
urlData.cached,
|
||||
self.separator))
|
||||
self.fd.flush()
|
||||
self.flush()
|
||||
|
||||
|
||||
def endOfOutput (self, linknumber=-1):
|
||||
|
|
@ -79,5 +79,5 @@ class SQLLogger (StandardLogger):
|
|||
duration = self.stoptime - self.starttime
|
||||
self.fd.write("-- "+i18n._("Stopped checking at %s (%s)\n")%\
|
||||
(strtime(self.stoptime), strduration(duration)))
|
||||
self.fd.flush()
|
||||
self.flush()
|
||||
self.fd = None
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ __init__(self, **args)
|
|||
self.fd.write(i18n._("Get the newest version at %s\n") % Config.Url)
|
||||
self.fd.write(i18n._("Write comments and bugs to %s\n\n") % Config.Email)
|
||||
self.fd.write(i18n._("Start checking at %s\n") % strtime(self.starttime))
|
||||
self.fd.flush()
|
||||
self.flush()
|
||||
|
||||
|
||||
def newUrl (self, urlData):
|
||||
|
|
@ -132,11 +132,12 @@ __init__(self, **args)
|
|||
else:
|
||||
self.errors += 1
|
||||
self.fd.write(urlData.errorString+"\n")
|
||||
self.fd.flush()
|
||||
self.flush()
|
||||
|
||||
|
||||
def endOfOutput (self, linknumber=-1):
|
||||
if self.fd is None: return
|
||||
if self.fd is None:
|
||||
return
|
||||
if self.has_field('outro'):
|
||||
self.fd.write(i18n._("\nThats it. "))
|
||||
#if self.warnings==1:
|
||||
|
|
@ -157,5 +158,15 @@ __init__(self, **args)
|
|||
duration = self.stoptime - self.starttime
|
||||
self.fd.write(i18n._("Stopped checking at %s (%s)\n") % \
|
||||
(strtime(self.stoptime), strduration(duration)))
|
||||
self.fd.flush()
|
||||
self.flush()
|
||||
self.fd = None
|
||||
|
||||
|
||||
def flush (self):
|
||||
"""ignore flush errors since we are not responsible for proper
|
||||
flushing of log output streams"""
|
||||
if self.fd:
|
||||
try:
|
||||
self.fd.flush()
|
||||
except IOError:
|
||||
pass
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ class XMLLogger (StandardLogger):
|
|||
Config.Email)
|
||||
self.fd.write("-->\n\n")
|
||||
self.fd.write('<GraphXML>\n<graph isDirected="true">\n')
|
||||
self.fd.flush()
|
||||
self.flush()
|
||||
|
||||
|
||||
def newUrl (self, urlData):
|
||||
|
|
@ -98,7 +98,7 @@ class XMLLogger (StandardLogger):
|
|||
(node.valid and 1 or 0))
|
||||
self.fd.write(" </data>\n")
|
||||
self.fd.write(" </edge>\n")
|
||||
self.fd.flush()
|
||||
self.flush()
|
||||
|
||||
|
||||
def endOfOutput (self, linknumber=-1):
|
||||
|
|
@ -111,5 +111,5 @@ class XMLLogger (StandardLogger):
|
|||
self.fd.write(i18n._("Stopped checking at %s (%s)\n")%\
|
||||
(strtime(self.stoptime), strduration(duration)))
|
||||
self.fd.write("-->")
|
||||
self.fd.flush()
|
||||
self.flush()
|
||||
self.fd = None
|
||||
|
|
|
|||
Loading…
Reference in a new issue