2002-03-28 18:57:53 +00:00
|
|
|
#!/usr/bin/python
|
2000-06-18 12:36:42 +00:00
|
|
|
"""
|
|
|
|
|
Copyright (C) 2000 Bastian Kleineidam
|
|
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
|
"""
|
2000-06-11 20:26:08 +00:00
|
|
|
|
|
|
|
|
# profiling test
|
2002-06-07 20:47:35 +00:00
|
|
|
import sys, profile, os
|
2002-03-28 18:57:53 +00:00
|
|
|
sys.path.append(os.getcwd())
|
|
|
|
|
import linkcheck
|
|
|
|
|
|
2000-06-21 01:27:37 +00:00
|
|
|
#linkcheck.Config.DebugFlag = 1
|
|
|
|
|
|
2002-03-28 18:57:53 +00:00
|
|
|
def runit (config, name):
|
2000-06-21 01:27:37 +00:00
|
|
|
url='http://www.heise.de/'
|
2002-03-28 18:57:53 +00:00
|
|
|
config['recursionlevel'] = 1
|
2000-06-21 01:27:37 +00:00
|
|
|
config['anchors'] = 1
|
2002-06-07 20:47:35 +00:00
|
|
|
config['internlinks'].append(linkcheck.getLinkPat(r"^https?://www\.heise\.de"))
|
2000-06-21 01:27:37 +00:00
|
|
|
# avoid checking of local files (security!)
|
2002-06-07 20:47:35 +00:00
|
|
|
config["externlinks"].append(linkcheck.getLinkPat("^file:", strict=1))
|
|
|
|
|
config.appendUrl(linkcheck.UrlData.GetUrlDataFrom(url, 0, config))
|
2000-06-21 01:27:37 +00:00
|
|
|
profile.run("linkcheck.checkUrls(config)", name)
|
|
|
|
|
|
|
|
|
|
if __name__=='__main__':
|
|
|
|
|
config = linkcheck.Config.Configuration()
|
|
|
|
|
config.disableThreading()
|
|
|
|
|
runit(config, "nothreads.prof")
|
|
|
|
|
config.reset()
|
|
|
|
|
config.enableThreading(10)
|
|
|
|
|
runit(config, "threads.prof")
|
2000-06-12 12:59:34 +00:00
|
|
|
|