From 94a5fb8ea3aa952358a42b042181c0b40a3c8a75 Mon Sep 17 00:00:00 2001 From: calvin Date: Sun, 9 Jun 2002 15:32:14 +0000 Subject: [PATCH] tests, linkname git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@475 e7d03fd6-7b0d-0410-9947-9c21f3af8025 --- Makefile | 3 ++- debian/changelog | 2 +- linkcheck/UrlData.py | 50 +++++++++++++++++++++++------------------- linkcheck/linkname.py | 22 ++++++++++--------- test/output/test_file | 8 +++++++ test/output/test_http | 15 +++++++++++++ test/output/test_https | 1 + test/output/test_mail | 12 ++++++++++ test/output/test_misc | 2 ++ 9 files changed, 81 insertions(+), 34 deletions(-) diff --git a/Makefile b/Makefile index a1010f40..e05517fb 100644 --- a/Makefile +++ b/Makefile @@ -57,6 +57,7 @@ deb_unsigned: cleandeb files: locale env http_proxy="" $(PYTHON) $(PACKAGE) $(LCOPTS) -i$(HOST) http://$(HOST)/ + for f in linkchecker-out.*; do gzip --best $$f; done VERSION: echo $(VERSION) > VERSION @@ -67,7 +68,7 @@ VERSION-DEVEL: upload: distclean dist files VERSION scp debian/changelog $(HTMLDIR)/changes.txt scp README $(HTMLDIR)/readme.txt - scp linkchecker-out.* $(HTMLDIR) + scp linkchecker-out.*.gz $(HTMLDIR) scp VERSION $(HTMLDIR)/raw/ #scp dist/* $(HTMLDIR)/ ncftpput upload.sourceforge.net /incoming dist/* && read -p "Make new SF file releases and then press Enter:" diff --git a/debian/changelog b/debian/changelog index 738dbc9b..f1c9e588 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,6 @@ linkchecker (1.5.5) unstable; urgency=low - * linkcheck/linkname.py: fix linkname regular expressions (from 1.4.8) + * linkcheck/linkname.py: fix linkname regular expressions (from 1.4.9) * linkchecker: documentation typos * linkcheck/__init__.py: use getLinkPat function for all config entries, not just commandline diff --git a/linkcheck/UrlData.py b/linkcheck/UrlData.py index b34e6205..2edf1e70 100644 --- a/linkcheck/UrlData.py +++ b/linkcheck/UrlData.py @@ -77,16 +77,16 @@ _linkMatcher = r""" \s* # whitespace %s # tag name \s+ # whitespace - ([^"'>]|"[^"]*"|'[^']*')* # skip leading attributes + ([^"'>]|"[^"\n]*"|'[^'\n]*')* # skip leading attributes %s # attrib name \s* # whitespace = # equal sign \s* # whitespace (?P # attribute value - "[^"]*" | # in double quotes - '[^']*' | # in single quotes + "[^"\n]*" | # in double quotes + '[^'\n]*' | # in single quotes [^\s>]+) # unquoted - ([^"'>]|"[^"]*"|'[^']*')* # skip trailing attributes + ([^"'>]|"[^"\n]*"|'[^'\n]*')* # skip trailing attributes > # close tag """ @@ -123,22 +123,22 @@ LinkTags = ( LinkPatterns = [] for tags,attrs in LinkTags: - attr = '(%s)'%'|'.join(attrs) tag = '(%s)'%'|'.join(tags) + attr = '(%s)'%'|'.join(attrs) LinkPatterns.append({'pattern': re.compile(_linkMatcher % (tag, attr), - re.VERBOSE|re.DOTALL), - 'tag': tag, - 'attr': attr}) + re.VERBOSE), + 'tags': tags, + 'attrs': attrs}) AnchorPattern = { - 'pattern': re.compile(_linkMatcher % ("a", "name"), re.VERBOSE|re.DOTALL), - 'tag': 'a', - 'attr': 'name', + 'pattern': re.compile(_linkMatcher % ("a", "name"), re.VERBOSE), + 'tags': ['a'], + 'attrs': ['name'], } BasePattern = { 'pattern': re.compile(_linkMatcher % ("base", "href"), re.VERBOSE), - 'tag': 'base', - 'attr': 'href', + 'tags': ['base'], + 'attrs': ['href'], } #CommentPattern = re.compile("