mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-04-09 17:10:58 +00:00
documentation
git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@2906 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
parent
c797748a91
commit
041df3a48d
5 changed files with 26 additions and 0 deletions
|
|
@ -37,21 +37,33 @@ _lock = thread.allocate_lock()
|
|||
|
||||
|
||||
def print_tocheck (tocheck):
|
||||
"""
|
||||
Print the number of queued URLs.
|
||||
"""
|
||||
msg = _n("%5d URL queued,", "%5d URLs queued,", tocheck) % tocheck
|
||||
print >> stderr, msg,
|
||||
|
||||
|
||||
def print_links (links):
|
||||
"""
|
||||
Print the number of checked URLs.
|
||||
"""
|
||||
msg = _n("%4d URL checked,", "%4d URLs checked,", links) % links
|
||||
print >> stderr, msg,
|
||||
|
||||
|
||||
def print_active (active):
|
||||
"""
|
||||
Print the number of active threads.
|
||||
"""
|
||||
msg = _n("%2d active thread,", "%2d active threads,", active) % active
|
||||
print >> stderr, msg,
|
||||
|
||||
|
||||
def print_duration (duration):
|
||||
"""
|
||||
Print the run time.
|
||||
"""
|
||||
msg = _("runtime %s") % linkcheck.strformat.strduration(duration)
|
||||
print >> stderr, msg,
|
||||
|
||||
|
|
@ -174,6 +186,10 @@ class Consumer (object):
|
|||
pass
|
||||
|
||||
def _abort (self):
|
||||
"""
|
||||
Abort checking and send end-of-output message to logger.
|
||||
Private method not disabling exceptions.
|
||||
"""
|
||||
# wait for threads to finish
|
||||
while not self.no_more_threads():
|
||||
if self.num_waited > 30:
|
||||
|
|
|
|||
|
|
@ -228,6 +228,7 @@ class FtpUrl (internpaturl.InternPatternUrl, proxysupport.ProxySupport):
|
|||
ftpcmd = "RETR %s" % self.filename
|
||||
buf = StringIO.StringIO()
|
||||
def stor_data (s):
|
||||
"""Helper method storing given data"""
|
||||
buf.write(s)
|
||||
self.url_connection.retrbinary(ftpcmd, stor_data)
|
||||
self.data = buf.getvalue()
|
||||
|
|
|
|||
|
|
@ -21,6 +21,9 @@ Store and retrieve open connections.
|
|||
import time
|
||||
|
||||
class ConnectionPool (object):
|
||||
"""
|
||||
Connection pool class, storing a set of connections for URL retrieval.
|
||||
"""
|
||||
|
||||
def __init__ (self):
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -101,6 +101,9 @@ class UrlBase (object):
|
|||
self.scheme = url.split(":", 1)[0] or "file"
|
||||
|
||||
def reset (self):
|
||||
"""
|
||||
Reset all variables to default values.
|
||||
"""
|
||||
# self.url is constructed by self.build_url() out of base_url
|
||||
# and (base_ref or parent) as absolute and normed url.
|
||||
# This the real url we use when checking so it also referred to
|
||||
|
|
|
|||
|
|
@ -148,6 +148,9 @@ class MetaRobotsFinder (TagFinder):
|
|||
|
||||
|
||||
def is_meta_url (attr, attrs):
|
||||
"""
|
||||
Check if the meta attributes contain a URL.
|
||||
"""
|
||||
res = False
|
||||
if attr == "content":
|
||||
equiv = attrs.get_true('http-equiv', u'').lower()
|
||||
|
|
|
|||
Loading…
Reference in a new issue