mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-03-23 01:10:27 +00:00
remove has_incoming, debugging
git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@2945 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
parent
1bbad363da
commit
b733ffdb2a
1 changed files with 5 additions and 13 deletions
|
|
@ -117,31 +117,23 @@ class Cache (object):
|
|||
"""
|
||||
Add a new URL to list of URLs to check.
|
||||
"""
|
||||
linkcheck.log.debug(linkcheck.LOG_CACHE,
|
||||
"Add url %s...", repr(url_data))
|
||||
linkcheck.log.debug(linkcheck.LOG_CACHE, "Add url %r ...", url_data)
|
||||
if url_data.has_result:
|
||||
# do not check any further
|
||||
linkcheck.log.debug(linkcheck.LOG_CACHE, "... no, has result")
|
||||
return False
|
||||
# check the cache
|
||||
key = url_data.cache_url_key
|
||||
if key in self.checked:
|
||||
# url is cached and can be logged
|
||||
url_data.copy_from_cache(self.checked[key])
|
||||
linkcheck.log.debug(linkcheck.LOG_CACHE, "... no, cached")
|
||||
return False
|
||||
# url is not cached, so add to incoming queue
|
||||
self.incoming.append(url_data)
|
||||
linkcheck.log.debug(linkcheck.LOG_CACHE, "...added.")
|
||||
linkcheck.log.debug(linkcheck.LOG_CACHE, "... yes, added.")
|
||||
return True
|
||||
|
||||
def has_incoming (self, key):
|
||||
"""
|
||||
Check if incoming queue has an entry with the given key.
|
||||
|
||||
@param key: Usually obtained from url_data.cache_url_key
|
||||
@type key: String
|
||||
"""
|
||||
return key in self.incoming
|
||||
|
||||
def has_in_progress (self, key):
|
||||
"""
|
||||
Check if in-progress queue has an entry with the given key.
|
||||
|
|
@ -168,7 +160,7 @@ class Cache (object):
|
|||
"""
|
||||
data = url_data.get_cache_data()
|
||||
key = url_data.cache_url_key
|
||||
linkcheck.log.debug(linkcheck.LOG_CACHE, "Cache key %r...", key)
|
||||
linkcheck.log.debug(linkcheck.LOG_CACHE, "Caching %r", key)
|
||||
assert key not in self.checked, \
|
||||
key + u", " + unicode(self.checked[key])
|
||||
assert key in self.in_progress, key
|
||||
|
|
|
|||
Loading…
Reference in a new issue