mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-04-20 06:10:59 +00:00
git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@113 e7d03fd6-7b0d-0410-9947-9c21f3af8025
29 lines
963 B
Python
Executable file
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")
|
|
|