config bug fixed

git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@77 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
calvin 2000-04-29 20:04:11 +00:00
parent 461b37ac33
commit 6f375c936c
8 changed files with 75 additions and 58 deletions

View file

@ -1,8 +1,8 @@
VERSION=$(shell ./setup.py --version)
#HOST=treasure.calvinsplayground.de
HOST=treasure.calvinsplayground.de
PROXY=
#PROXY=-P$(HOST):5050
HOST=fsinfo.cs.uni-sb.de
#HOST=fsinfo.cs.uni-sb.de
#PROXY=-Pwww-proxy.uni-sb.de:3128
PACKAGE = linkchecker
DEBPACKAGE = $(PACKAGE)_$(VERSION)_i386.deb
@ -19,7 +19,7 @@ clean:
rm -rf $(ALLPACKAGES) $(PACKAGE)-out.*
install:
./setup.py install --prefix=/tmp/usr --exec-prefix=/tmp/usr
./setup.py install --prefix=/tmp/usr
# do what I mean, Distutils!
cp -a /tmp/usr/* $(DESTDIR)/usr
# remove following line if Distutils have script support
@ -32,7 +32,7 @@ dist:
fakeroot debian/rules binary
files:
./$(PACKAGE) -Ftext -Fhtml -Fgml -Fsql -R -t0 -v $(PROXY) -i$(HOST) http://$(HOST)/~calvin/
./$(PACKAGE) -ocolored -Ftext -Fhtml -Fgml -Fsql -Fcsv -R -t0 -v $(PROXY) -i$(HOST) http://$(HOST)/~calvin/
homepage:
scp debian/changelog shell1.sourceforge.net:/home/groups/linkchecker/htdocs/changes.txt

13
debian/changelog vendored
View file

@ -1,16 +1,17 @@
linkchecker (1.3.0) unstable; urgency=low
linkchecker (1.2.3) unstable; urgency=low
* Blacklist output support
* typo fix for adjustWinPath
* added some source code documentation
* Improved error messages for wrong options
* FileOutput mapping in Config.py
* improved error messages for wrong options
* configuration file option for output filenames
* linkchecker.bat installation support for windows
* included test suite in distribution
* Improved mailto: link parsing
* improved mailto: link parsing
* Blacklist output support
* CSV output support
* SSL autodetection in setup.py
-- Bastian Kleineidam <calvin@users.sourceforge.net> Fri, 28 Apr 2000 12:59:13 +0200
-- Bastian Kleineidam <calvin@users.sourceforge.net> Fri, 28 Apr 2000 13:48:14 +0200
linkchecker (1.2.2) unstable; urgency=low

View file

@ -11,7 +11,7 @@ from os.path import expanduser,normpath,normcase,join,isfile
from types import StringType
import Logging
Version = "1.3.0"
Version = "1.2.3"
AppName = "LinkChecker"
App = AppName+" "+Version
UserAgent = AppName+"/"+Version
@ -344,7 +344,7 @@ class Configuration(UserDict.UserDict):
for key in filenames.keys():
if self.data["fileoutputnames"].has_key(key) and \
type(filenames[key]) == StringType:
self.data["fileoutputnames"] = filenames[key]
self.data["fileoutputnames"][key] = filenames[key]
except ConfigParser.Error: pass
try:
filelist = string.split(cfgparser.get(section, "fileoutput"))

View file

@ -5,15 +5,15 @@ from UrlData import LinkCheckerException
# regular expression strings
tag_str = r"^mailto:"
adress_str = r"([a-zA-Z]['\-\w.]*)@([\w\-]+(\.[\w\-]+)*))"
adress_str = r"([a-zA-Z]['\-\w.]*)@([\w\-]+(?:\.[\w\-]+)*)"
complete_adress_str = "("+adress_str+"|[\w\-\s]*<"+adress_str+">)"
suffix_str = r"(\?.+)?"
mailto_str = tag_str+complete_adress_str+\
"(\s*,"+complete_adress_str+")*"+suffix_str
# compiled
mailto_re = re.compile(mailto_str)
adress_re = re.compile(adress_str)
mailto_re = re.compile(mailto_str)
class MailtoUrlData(HostCheckingUrlData):
"Url link with mailto scheme"
@ -23,42 +23,37 @@ class MailtoUrlData(HostCheckingUrlData):
mo = mailto_re.match(self.urlName)
if not mo:
raise LinkCheckerException, "Illegal mailto link syntax"
self.adresses = re.findall(adress_re, self.urlName)
Config.debug(str(self.adresses))
raise Exception, "Nix"
self.host = None
self.user = None
self.adresses = map(lambda x: (x[0], string.lower(x[1])),
re.findall(adress_re, self.urlName))
def checkConnection(self, config):
DNS.ParseResolvConf()
Config.debug("Looking up mail host\n")
mxrecords = DNS.mxlookup(self.host)
if not len(mxrecords):
self.setError("No mail host for "+self.host+" found")
return
smtpconnect = 0
for mxrecord in mxrecords:
try:
Config.debug("Connect to "+str(mxrecord)+"\n")
self.urlConnection = SMTP(mxrecord[1])
Config.debug("Connected to "+str(mxrecord[1])+"\n")
smtpconnect = 1
self.urlConnection.helo()
info = self.urlConnection.verify(self.user)
if info[0]==250:
self.setInfo("Verified adress: "+info[1])
except:
type, value = sys.exc_info()[:2]
print type,value
if smtpconnect: break
for user,host in self.adresses:
mxrecords = DNS.mxlookup(host)
if not len(mxrecords):
self.setError("No mail host for "+host+" found")
return
smtpconnect = 0
for mxrecord in mxrecords:
try:
self.urlConnection = SMTP(mxrecord[1])
smtpconnect = 1
self.urlConnection.helo()
info = self.urlConnection.verify(user)
if info[0]==250:
self.setInfo("Verified adress: "+info[1])
except:
type, value = sys.exc_info()[:2]
print type,value
if smtpconnect: break
if not smtpconnect:
self.setWarning("None of the mail hosts for "+self.host+
" accepts an SMTP connection: "+str(value))
mxrecord = mxrecords[0][1]
else:
mxrecord = mxrecord[1]
self.setValid("found mail host "+mxrecord)
if not smtpconnect:
self.setWarning("None of the mail hosts for "+host+
" accepts an SMTP connection: "+str(value))
mxrecord = mxrecords[0][1]
else:
mxrecord = mxrecord[1]
self.setValid("found mail host "+mxrecord)
def closeConnection(self):
@ -68,7 +63,7 @@ class MailtoUrlData(HostCheckingUrlData):
def getCacheKey(self):
return "mailto:"+self.user+"@"+HostCheckingUrlData.getCacheKey(self)
return "mailto:"+str(self.adresses)
def __str__(self):

View file

@ -198,7 +198,7 @@ for opt,arg in options:
elif opt=="-F" or opt=="--file-output":
if linkcheck.Config.Loggers.has_key(arg) and arg != "blacklist":
config["fileoutput"].append(linkcheck.Config.Loggers[arg](
open(linkcheck.Config.FileOutput[arg], "w")))
open(config["fileoutputnames"][arg], "w")))
else:
printUsage("Illegal argument '"+arg+\
"' for option '-F, --file-output'")

View file

@ -8,6 +8,8 @@
#warnings=0
#quiet=0
#fileoutput = text colored html gml sql
# customize your output filenames
#fileoutputnames = {'text': 'myoutput.txt', 'html': 'mylinks.htm'}
[checking]
#threads=5

View file

@ -2,17 +2,34 @@
from distutils.core import setup
from distutils.dist import Distribution
from Template import Template
import sys
import sys,os,string
# Autodetect the existence of an SSL library (this is pretty shitty)
# Autodetect Windows platforms to include the linkchecker.bat script
class LCDistribution(Distribution):
default_include_dirs = ['/usr/include/openssl',
'/usr/local/include/openssl']
def run_commands (self):
if self.has_ssl():
self.check_ssl()
self.check_windows()
for cmd in self.commands:
self.run_command (cmd)
def check_ssl(self):
incldir = self.has_ssl()
if incldir:
self.announce("SSL header file ssl.h found, "
"enabling SSL compilation.")
self.ext_modules = [('ssl', {'sources': ['ssl.c'],
'include_dirs': ['/usr/include/openssl'],
'include_dirs': [incldir],
'library_dirs': ['/usr/lib'],
'libs': ['ssl']})]
else:
self.announce("SSL header file ssl.h missing, "
"disabling SSL compilation.\n"
"Use the -I option for the build_ext command.")
def check_windows(self):
if sys.platform=='win32':
inst = self.find_command_obj("install")
inst.ensure_ready()
@ -21,15 +38,18 @@ class LCDistribution(Distribution):
f.write(t.fill_in({"path_to_linkchecker": inst.install_scripts}))
f.close()
self.scripts.append('linkchecker.bat')
for cmd in self.commands:
self.run_command (cmd)
def has_ssl(self):
return 1
incls = self.find_command_obj("build_ext").include_dirs
incls = (incls and string.split(incls, os.pathsep)) or []
for d in incls + self.default_include_dirs:
if os.path.exists(os.path.join(d, "ssl.h")):
return d
return 0
setup (name = "linkchecker",
version = "1.3.0",
version = "1.2.3",
description = "check links of HTML pages",
author = "Bastian Kleineidam",
author_email = "calvin@users.sourceforge.net",
@ -49,8 +69,7 @@ o restrict link checking to your local domain
o HTTP proxy support
o give username/password for HTTP and FTP authorization
o robots.txt exclusion protocol support
"""
""",
distclass = LCDistribution,
packages = ['','DNS','linkcheck'],
scripts = ['linkchecker'],

View file

@ -2,7 +2,7 @@
<html><head></head>
<body>
<!-- legal -->
<a href=mailto:calvin@localhost?subject=Hallo!%%&to=Pfuscher>1</a>
<a href=mailto:calvin@LocalHost?subject=Hallo!%%&to=Pfuscher>1</a>
<a href="mailto:Dude <calvin@studcs.uni-sb.de> , Killer <calvin@cs.uni-sb.de>?subject=bla">2</a>
<a href="mailto:Bastian Kleineidam <calvin@host1>?foo=bar">3</a>
<a href="mailto:Bastian Kleineidam <calvin@studcs.uni-sb.de>">4</a>