mailto fixing and setup.py

git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@83 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
calvin 2000-05-16 21:05:33 +00:00
parent 71b07ee8d8
commit b4578bab56
6 changed files with 25 additions and 14 deletions

View file

@ -10,6 +10,5 @@ include debian/copyright
include debian/control
include debian/dirs
include debian/docs
include debian/files
include DNS/README
recursive-include test *.html *.py

View file

@ -1,9 +1,9 @@
VERSION=$(shell ./setup.py --version)
#HOST=treasure.calvinsplayground.de
#PROXY=
HOST=treasure.calvinsplayground.de
PROXY=
#PROXY=-P$(HOST):5050
HOST=fsinfo.cs.uni-sb.de
PROXY=-Pwww-proxy.uni-sb.de:3128
#HOST=fsinfo.cs.uni-sb.de
#PROXY=-Pwww-proxy.uni-sb.de:3128
PACKAGE = linkchecker
DEBPACKAGE = $(PACKAGE)_$(VERSION)_i386.deb
ALLPACKAGES = ../$(DEBPACKAGE)
@ -33,5 +33,5 @@ test:
rm -f test/*.result
@for i in test/*.html; do \
echo "Testing $$i. Results are in $$i.result"; \
./$(PACKAGE) -t0 -N"news.rz.uni-sb.de" -v -a $$i > $$i.result 2>&1; \
./$(PACKAGE) -r1 -o text -t0 -N"news.rz.uni-sb.de" -v -a $$i > $$i.result 2>&1; \
done

View file

@ -22,18 +22,18 @@ from UrlData import LinkCheckerException
# regular expression strings for partially RFC822 compliant adress scanning
# XXX far from complete mail adress scanning; enhance only when needed!
word = r"[-\w%']+"
words = r"[-\w%'\s]+"
word = r"[-\w%'!]+"
words = r"[-\w%'!\s]+"
dotwords = r"(%s(?:\.%s)*)" % (word,word)
adress = "%s@%s" % (dotwords, dotwords)
route_adress = "%s<%s>" % (words, adress)
mailbox = "(%s|%s)" % (adress, route_adress)
mailboxes = "%s?(,%s)*" % (mailbox, mailbox)
mailboxes = "%s?(\s*,\s*%s)*" % (mailbox, mailbox)
# regular expression strings for RFC2368 compliant mailto: scanning
header = word+"="+word
headers = r"(?:\?%s(&%s)*)?" % (header, header)
mailto = "^mailto:"+mailboxes+headers
mailto = "^mailto:"+mailboxes+headers+"$"
# compiled
adress_re = re.compile(adress)

4
linkchecker.bat.tmpl Normal file
View file

@ -0,0 +1,4 @@
@echo off
rem Limited to 9 parameters? Is there a $* for Windows?
python "$path_to_linkchecker" %1 %2 %3 %4 %5 %6 %7 %8 %9

View file

@ -21,12 +21,12 @@ from distutils.dist import Distribution
from Template import Template
import sys,os,string
# Autodetect the existence of an SSL library (this is pretty shitty)
class LCDistribution(Distribution):
default_include_dirs = ['/usr/include/openssl',
'/usr/local/include/openssl']
def run_commands (self):
self.check_ssl()
self.replace_in_scripts()
for cmd in self.commands:
self.run_command (cmd)
@ -52,6 +52,14 @@ class LCDistribution(Distribution):
return d
return 0
def replace_in_scripts(self):
inst = self.find_command_obj("install")
inst.ensure_ready()
t = Template("linkchecker.bat.tmpl")
f = open("linkchecker.bat","w")
f.write(t.fill_in({"path_to_linkchecker": inst.install_scripts}))
f.close()
setup (name = "linkchecker",
version = "1.2.3",

View file

@ -6,9 +6,9 @@
<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>
<a href="mailto:o'hara@doctor.fraggle-hause?subject=äöü">5</a>
<!-- illegal -->
<a href="mailto:Bastian Kleineidam <calvin@host1?foo=bar>">3</a>
<a href="mailto:">6</a>
<!-- illegal -->
<a href="mailto:o'hara@doctor.fraggle-hause?subject=äöü">5</a>
<a href="mailto:Bastian Kleineidam <calvin@host1?foo=bar>">3</a>
</body>
</html>