mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-04-15 11:51:02 +00:00
fix download size reporting
git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@668 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
parent
80c178682a
commit
36fb2e9a36
1 changed files with 5 additions and 3 deletions
|
|
@ -365,7 +365,7 @@ class UrlData:
|
|||
t = time.time()
|
||||
self.data = self.urlConnection.read()
|
||||
self.downloadtime = time.time() - t
|
||||
self.setInfo("D/L size %s"%StringUtil.strsize(len(self.data)))
|
||||
self.checkSize(len(self.data))
|
||||
return self.data
|
||||
|
||||
|
||||
|
|
@ -381,8 +381,10 @@ class UrlData:
|
|||
def checkSize (self, sizebytes):
|
||||
"""if a maximum size was given, call this function to check it
|
||||
against the content size of this url"""
|
||||
if sizebytes >= self.config["warnsizebytes"]:
|
||||
self.setWarning(linkcheck._("Content size %s is larger than %s")%\
|
||||
self.setInfo("D/L size %s"%StringUtil.strsize(sizebytes))
|
||||
if self.config["warnsizebytes"] is not None:
|
||||
if sizebytes >= self.config["warnsizebytes"]:
|
||||
self.setWarning(linkcheck._("Content size %s is larger than %s")%\
|
||||
(StringUtil.strsize(sizebytes),
|
||||
StringUtil.strsize(self.config["warnsizebytes"])))
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue