diff --git a/linkcheck/checker/consumer.py b/linkcheck/checker/consumer.py index 01983982..39208c2a 100644 --- a/linkcheck/checker/consumer.py +++ b/linkcheck/checker/consumer.py @@ -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: diff --git a/linkcheck/checker/ftpurl.py b/linkcheck/checker/ftpurl.py index edd8d1cb..8ea3a63a 100644 --- a/linkcheck/checker/ftpurl.py +++ b/linkcheck/checker/ftpurl.py @@ -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() diff --git a/linkcheck/checker/pool.py b/linkcheck/checker/pool.py index e623aba7..7aa018a4 100644 --- a/linkcheck/checker/pool.py +++ b/linkcheck/checker/pool.py @@ -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): """ diff --git a/linkcheck/checker/urlbase.py b/linkcheck/checker/urlbase.py index 4154c6c2..b8e86c06 100644 --- a/linkcheck/checker/urlbase.py +++ b/linkcheck/checker/urlbase.py @@ -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 diff --git a/linkcheck/linkparse.py b/linkcheck/linkparse.py index c4f4fac5..9bc8cec2 100644 --- a/linkcheck/linkparse.py +++ b/linkcheck/linkparse.py @@ -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()