mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-03-26 18:50:32 +00:00
git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@71 e7d03fd6-7b0d-0410-9947-9c21f3af8025
28 lines
917 B
Python
28 lines
917 B
Python
"""__init__.py in linkcheck
|
|
|
|
Here we find the main function to call: checkUrls.
|
|
This is the only entry point into the linkcheck module and is used
|
|
of course by the linkchecker script.
|
|
"""
|
|
|
|
import Config,UrlData,OutputReader,sys,lc_cgi
|
|
|
|
def checkUrls(config = Config.Configuration()):
|
|
""" checkUrls gets a complete configuration object as parameter where all
|
|
runtime-dependent options are stored.
|
|
If you call checkUrls more than once, you can specify different
|
|
configurations.
|
|
|
|
In the config object there are functions to get a new URL (getUrl) and
|
|
to check it (checkUrl).
|
|
"""
|
|
config.log_init()
|
|
try:
|
|
while not config.finished():
|
|
if config.hasMoreUrls():
|
|
config.checkUrl(config.getUrl())
|
|
except KeyboardInterrupt:
|
|
config.finish()
|
|
config.log_endOfOutput()
|
|
sys.exit(1) # this is not good(tm)
|
|
config.log_endOfOutput()
|