logging and logfields

git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@255 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
calvin 2001-05-01 11:38:10 +00:00
parent ca8195991c
commit 62c70d6708
7 changed files with 69 additions and 80 deletions

2
debian/changelog vendored
View file

@ -1,4 +1,4 @@
linkchecker-ssl (1.3.0) unstable; urgency=low
linkchecker (1.3.0) unstable; urgency=low
* require and use Python >= 2.0
* fix ignored configfile settings for loggers

19
debian/control vendored
View file

@ -1,20 +1,17 @@
Source: linkchecker-ssl
Section: non-US/main
Source: linkchecker
Section: web
Priority: optional
Maintainer: Bastian Kleineidam <calvin@debian.org>
Build-Depends: python2-base, python2-dev, debhelper (>= 3.0.0), libssl-dev
Build-Depends: python2-base, python2-dev, debhelper (>= 3.0.0)
Build-Depends-Indep: gettext
Standards-Version: 3.5.4
Package: linkchecker-ssl
Architecture: any
Package: linkchecker
Architecture: all
Depends: python2-base
Recommends: linkchecker (>= ${Source-Version})
Description: HTTPS module for linkchecker
Includes the Python module 'linkcheckerssl' to support https://
links for LinkChecker.
.
Linkchecker features:
Suggests: linkchecker-ssl (>= ${Source-Version})
Description: check HTML documents for broken links
Features:
o recursive checking
o multithreaded
o output can be colored or normal text, HTML, SQL, CSV or a sitemap

2
debian/control-ssl vendored
View file

@ -4,7 +4,7 @@ Priority: optional
Maintainer: Bastian Kleineidam <calvin@debian.org>
Build-Depends: python2-base, python2-dev, debhelper (>= 3.0.0), libssl-dev
Build-Depends-Indep: gettext
Standards-Version: 3.5.3
Standards-Version: 3.5.4
Package: linkchecker-ssl
Architecture: any

75
debian/rules vendored
View file

@ -1,7 +1,8 @@
#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.
PACKAGE=linkchecker-ssl
PACKAGE=linkchecker
DOCDIR = debian/$(PACKAGE)/usr/share/doc/$(PACKAGE)
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
@ -13,40 +14,23 @@ export DH_COMPAT=3
export DH_OPTIONS
nossl:
@echo change to nossl version...
@cat debian/changelog | sed '1 s/linkchecker-ssl/linkchecker/' >debian/changelog-nossl
@cd debian && for i in *-nossl; do \
f=`echo $$i | sed -e 's/-nossl//'`; \
mv $$f $$f-ssl; \
@echo already nossl version environments
ssl:
@echo change to ssl version...
@cat debian/changelog | sed '1 s/linkchecker/linkchecker-ssl/' >debian/changelog-ssl
@cd debian && for i in *-ssl; do \
f=`echo $$i | sed -e 's/-ssl//'`; \
mv $$f $$f-nossl; \
mv $$i $$f; \
echo -n "$$f "; \
done
@chmod +x debian/rules
@echo done
ssl:
@echo already ssl version environments
configure: configure-stamp
configure-stamp:
dh_testdir
./setup.py config -lcrypto
touch configure-stamp
build: configure-stamp build-stamp
build-stamp:
dh_testdir
rm -rf debian/$(PACKAGE) debian/$(PACKAGE)-ssl
./setup.py build
touch build-stamp
clean:
dh_testdir
rm -f build-stamp configure-stamp
$(MAKE) clean
dh_clean
include debian/rules.mk
install: build
dh_testdir
@ -54,34 +38,38 @@ install: build
dh_installdirs
$(MAKE) locale
./setup.py install --root=`pwd`/debian/$(PACKAGE) --no-compile
# remove everything but the ssl modules
rm -rf debian/$(PACKAGE)/usr/man
rm -rf debian/$(PACKAGE)/usr/bin
rm -rf debian/$(PACKAGE)/usr/share
rm -rf debian/$(PACKAGE)/usr/lib/python2.0/site-packages/{linkcheck,DNS}
rm -rf debian/$(PACKAGE)/usr/lib/python2.0/site-packages/*.py
# remove man pages, we install them with dh_installman
rm -r debian/$(PACKAGE)/usr/man
# remove example files, we install them with dh_installexamples
rm -r debian/$(PACKAGE)/usr/share/linkchecker/examples/
# remove any SSL related files
rm -r debian/$(PACKAGE)/usr/lib/python2.0/site-packages/linkcheckssl
# install additional doc files
install -c -m 644 DNS/README $(DOCDIR)/README_DNS.txt
install -c -m 644 test/*.py $(DOCDIR)/test
install -c -m 644 test/html/*.html $(DOCDIR)/test/html
install -c -m 644 test/output/test_* $(DOCDIR)/test/output
# install system wide configuration file in etc
mv debian/$(PACKAGE)/usr/share/linkchecker/linkcheckerrc debian/$(PACKAGE)/etc
# Build architecture-independent files here.
binary-indep: build install
# Build architecture-dependent files here.
binary-arch: build install
dh_testdir
dh_testroot
# dh_installdebconf
# dh_installdocs
# dh_installexamples lc.* lconline/*.html
dh_installdocs
dh_installexamples lc.* lconline/*.html
# dh_installmenu
# dh_installemacsen
# dh_installpam
# dh_installinit
# dh_installcron
# dh_installman linkchecker.1
dh_installman linkchecker.1
# dh_installinfo
# dh_undocumented linkchecker.1
dh_installchangelogs
# dh_link
dh_installchangelogs
dh_link
dh_strip
dh_compress
dh_fixperms
@ -93,5 +81,8 @@ binary-arch: build install
dh_md5sums
dh_builddeb
# Build architecture-dependent files here.
binary-arch: build install
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install configure

1
debian/rules-ssl vendored
View file

@ -14,6 +14,7 @@ export DH_OPTIONS
nossl:
@echo change to nossl version...
@cat debian/changelog | sed '1 s/linkchecker-ssl/linkchecker/' >debian/changelog-nossl
@cd debian && for i in *-nossl; do \
f=`echo $$i | sed -e 's/-nossl//'`; \
mv $$f $$f-ssl; \

View file

@ -250,11 +250,11 @@ class Configuration(UserDict.UserDict):
def robotsTxtCache_set_NoThreads(self, key, val):
self.robotsTxtCache[key] = val
def newLogger(self, name, dict={}):
namespace = {}
namespace.update(self[name])
namespace.update(dict)
return apply(Loggers[name], (), namespace)
def newLogger(self, logtype, dict={}):
args = {}
args.update(self[logtype])
args.update(dict)
return apply(Loggers[logtype], (), args)
def incrementLinknumber_NoThreads(self):
self['linknumber'] += 1
@ -389,6 +389,17 @@ class Configuration(UserDict.UserDict):
return
section="output"
for key in Loggers.keys():
if cfgparser.has_section(key):
debug(key+": ")
for opt in cfgparser.options(key):
try: self[key][opt] = cfgparser.get(key, opt)
except ConfigParser.Error, msg: debug(str(msg)+"\n")
try:
self[key]['fields'] = map(string.strip,
string.split(cfgparser.get(key, 'fields'), ','))
debug("fields %s\n"%str(self[key]['fields']))
except ConfigParser.Error, msg: debug(str(msg)+"\n")
try:
log = cfgparser.get(section, "log")
if Loggers.has_key(log):
@ -414,17 +425,6 @@ class Configuration(UserDict.UserDict):
self['fileoutput'].append(
self.newLogger(arg, {'fileoutput':1}))
except ConfigParser.Error: pass
for key in Loggers.keys():
if cfgparser.has_section(key):
debug(key+"\n")
for opt in cfgparser.options(key):
try: self[key][opt] = cfgparser.get(key, opt)
except ConfigParser.Error, msg: debug(str(msg))
try:
self[key]['fields'] = map(string.strip,
string.split(cfgparser.get(key, 'fields'), ','))
debug("fields %s"%str(self[key]['fields']))
except ConfigParser.Error, msg: debug(str(msg))
section="checking"
try:

View file

@ -62,7 +62,7 @@ class Logger:
def __init__(self, **args):
self.logfields = None # all fields
if args.has_key('fields'):
if type(args['fields']) == ListType:
if "all" not in args['fields']:
self.logfields = args['fields']
@ -72,14 +72,14 @@ class Logger:
return name in self.logfields
def init(self):
raise Exception, "abstract function"
def init(self):
raise Exception, "abstract function"
def newUrl(self, urlData):
raise Exception, "abstract function"
def newUrl(self, urlData):
raise Exception, "abstract function"
def endOfOutput(self, linknumber=-1):
raise Exception, "abstract function"
def endOfOutput(self, linknumber=-1):
raise Exception, "abstract function"
@ -389,7 +389,7 @@ class ColoredLogger(StandardLogger):
self.fd.write("o\n")
self.prefix = 0
self.currentPage=None
if self.logfield("url")
if self.logfield("url"):
if self.prefix:
self.fd.write("|\n+- ")
else:
@ -581,7 +581,7 @@ class XMLLogger(StandardLogger):
self.nodeid += 1
self.fd.write(' <node name="%d" ' % node.id)
self.fd.write(">\n")
if self.logfield("realurl")
if self.logfield("realurl"):
self.fd.write(" <label>%s</label>\n" % quote(node.url))
self.fd.write(" <data>\n")
if node.downloadtime and self.logfield("dltime"):