linkchecker/test/profiletest.py.tmpl
2000-06-13 13:57:37 +00:00

29 lines
963 B
Python
Executable file

#!/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()
config['recursionlevel'] = 2
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()
config['recursionlevel'] = 2
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)", "nothreads.prof")