2000-06-11 20:26:08 +00:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
|
|
|
|
|
# profiling test
|
|
|
|
|
import sys,re,profile,pstats
|
|
|
|
|
# add the path to linkcheck module if you do not install with distutils
|
|
|
|
|
$syspath
|
|
|
|
|
import linkcheck
|
|
|
|
|
url='http://www.yahoo.de/'
|
|
|
|
|
config = linkcheck.Config.Configuration()
|
2000-06-12 12:59:34 +00:00
|
|
|
|
2000-06-13 13:57:37 +00:00
|
|
|
config['recursionlevel'] = 2
|
2000-06-12 12:59:34 +00:00
|
|
|
config['anchors'] = 1
|
|
|
|
|
config['internlinks'].append(re.compile(r"^(ftp|https?)://.*yahoo.*"))
|
|
|
|
|
# avoid checking of local files (security!)
|
|
|
|
|
config["externlinks"].append((re.compile("^file:"), 1))
|
|
|
|
|
config.appendUrl(linkcheck.UrlData.GetUrlDataFrom(url, 0))
|
|
|
|
|
profile.run("linkcheck.checkUrls(config)", "threads.prof")
|
|
|
|
|
|
|
|
|
|
config.reset()
|
|
|
|
|
|
|
|
|
|
config.disableThreading()
|
2000-06-13 13:57:37 +00:00
|
|
|
config['recursionlevel'] = 2
|
2000-06-11 20:26:08 +00:00
|
|
|
config['anchors'] = 1
|
2000-06-12 12:59:34 +00:00
|
|
|
config['internlinks'].append(re.compile(r"^(ftp|https?)://.*yahoo.*"))
|
2000-06-11 20:26:08 +00:00
|
|
|
# avoid checking of local files (security!)
|
|
|
|
|
config["externlinks"].append((re.compile("^file:"), 1))
|
|
|
|
|
config.appendUrl(linkcheck.UrlData.GetUrlDataFrom(url, 0))
|
2000-06-12 12:59:34 +00:00
|
|
|
profile.run("linkcheck.checkUrls(config)", "nothreads.prof")
|
|
|
|
|
|