diff --git a/Makefile b/Makefile index e9914b6f..ec9b5105 100644 --- a/Makefile +++ b/Makefile @@ -13,54 +13,51 @@ OFFLINETESTS = test_base test_misc test_file test_frames ONLINETESTS = test_mail test_http test_https test_news test_ftp DESTDIR=/. -.PHONY: all all: @echo "Read the file INSTALL to see how to build and install" -.PHONY: clean clean: -$(PYTHON) setup.py clean --all # ignore errors of this command $(MAKE) -C po clean find . -name '*.py[co]' | xargs rm -f -.PHONY: distclean distclean: clean cleandeb rm -rf dist build # just to be sure clean also the build dir rm -f VERSION _$(PACKAGE)_configdata.py MANIFEST Packages.gz # clean aborted dist builds and -out files rm -f $(PACKAGE)-* -.PHONY: cleandeb cleandeb: rm -rf debian/$(PACKAGE) debian/tmp rm -f debian/*.debhelper debian/{files,substvars} rm -f configure-stamp build-stamp -.PHONY: config config: $(PYTHON) setup.py config -lcrypto # no rpm package; too much trouble, cannot test -.PHONY: dist dist: locale config $(PYTHON) setup.py sdist --formats=gztar,zip bdist_wininst -deb: - # cleandeb because distutils choke on dangling symlinks - # (linkchecker.1 -> undocumented.1) - $(MAKE) cleandeb +# produce the .deb Debian package +deb_local: cleandeb + # standard for local use fakeroot debian/rules binary - env CVSROOT=:pserver:anonymous@cvs.linkchecker.sourceforge.net:/cvsroot/linkchecker cvs-buildpackage -Mlinkchecker -W/home/calvin/projects/cvs-build -sgpg -pgpg -k32EC6F3E -rfakeroot - #env CVSROOT=:pserver:anonymous@cvs.linkchecker.sourceforge.net:/cvsroot/linkchecker cvs-buildpackage -Mlinkchecker -W/home/calvin/projects/cvs-build -us -uc -rfakeroot -.PHONY: files +deb_signed: cleandeb + # ready for upload, signed with my GPG key + env CVSROOT=:pserver:anonymous@cvs.linkchecker.sourceforge.net:/cvsroot/linkchecker cvs-buildpackage -Mlinkchecker -W/home/calvin/projects/cvs-build -sgpg -pgpg -k32EC6F3E -rfakeroot + +deb_unsigned: cleandeb + # same thing, but unsigned (for local archives) + env CVSROOT=:pserver:anonymous@cvs.linkchecker.sourceforge.net:/cvsroot/linkchecker cvs-buildpackage -Mlinkchecker -W/home/calvin/projects/cvs-build -us -uc -rfakeroot + files: locale env http_proxy="" $(PYTHON) $(PACKAGE) $(LCOPTS) -i$(HOST) http://$(HOST)/ VERSION: echo $(VERSION) > VERSION -.PHONY: upload upload: distclean dist files VERSION scp debian/changelog $(HTMLDIR)/changes.txt scp README $(HTMLDIR)/readme.txt @@ -69,18 +66,17 @@ upload: distclean dist files VERSION scp dist/* $(HTMLDIR)/ ssh -C -t shell1.sourceforge.net "cd $(PACKAGEDIR) && make" -.PHONY: test test: $(PYTHON) test/regrtest.py $(OFFLINETESTS) -.PHONY: onlinetest onlinetest: $(PYTHON) test/regrtest.py $(ONLINETESTS) -.PHONY: locale locale: $(MAKE) -C po -.PHONY: timeouttest timeouttest: - $(PYTHON) $(PACKAGE) -DDD --timeout=2 mailto:calvin@cs.uni-sb.de + $(PYTHON) $(PACKAGE) -v --timeout=0 mailto:root@aol.com + +.PHONY: all clean cleandeb distclean files upload test timeouttest locale +.PHONY: onlinetest config dist deb_local deb_signed deb_unsigned diff --git a/linkcheck/CSV.py b/linkcheck/CSV.py index 85b13c06..abee8318 100644 --- a/linkcheck/CSV.py +++ b/linkcheck/CSV.py @@ -21,7 +21,7 @@ # IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # -import re, string, types, UserList +import string, types, UserList ################################################################################################### @@ -50,10 +50,9 @@ class CSV(UserList.UserList): Arguments: separator : The field delimiter. Defaults to ',' """ - + UserList.UserList.__init__(self) self.separator = separator - self.data = [] self.fields__title__have = self.fields__title = None @@ -381,8 +380,8 @@ class Entry(UserList.UserList): fields__title : a list with the titles of each field (an empty list means there are no titles) """ + UserList.UserList.__init__(self, fields) - self.data = fields if fields__title != None: self.fields__title = fields__title else: diff --git a/linkcheck/UrlData.py b/linkcheck/UrlData.py index 9a4d1284..0342a63f 100644 --- a/linkcheck/UrlData.py +++ b/linkcheck/UrlData.py @@ -57,6 +57,7 @@ ExcList = [ ValueError, # from httplib.py linkcheck.error, DNS.Error, + linkcheck.timeoutsocket.Timeout, ] try: import socket @@ -348,10 +349,6 @@ class UrlData: not self.extern - def isHtml(self): - return 0 - - def checkAnchors(self, anchor): if not (anchor!="" and self.isHtml() and self.valid): return diff --git a/linkcheck/lc_cgi.py b/linkcheck/lc_cgi.py index 056be209..158d987b 100644 --- a/linkcheck/lc_cgi.py +++ b/linkcheck/lc_cgi.py @@ -17,6 +17,7 @@ import re,time,urlparse from linkcheck import _ +from types import StringType _logfile = None diff --git a/linkcheck/sz_fcgi.py b/linkcheck/sz_fcgi.py index a5cb9196..53c4e33f 100644 --- a/linkcheck/sz_fcgi.py +++ b/linkcheck/sz_fcgi.py @@ -3,7 +3,7 @@ __version__ = "v0.8 19/10/1998 ajung" __doc__ = "Multithreaded FastCGI Wrapper" -import sys,thread,fcgi +import thread,fcgi class SZ_FCGI: def __init__(self,func): diff --git a/linkcheck/util1.py b/linkcheck/util1.py index 1804aa1b..f9bb78b3 100644 --- a/linkcheck/util1.py +++ b/linkcheck/util1.py @@ -18,6 +18,7 @@ import sys,time,rotor,types _curses = None +_color = 0 try: from ncurses import curses _curses = curses @@ -74,7 +75,7 @@ def abbuzze(): my,mx = w.getmaxyx() b = w.subwin(my-2, mx, 0, 0) s = w.subwin(2, mx, my-2, 0) - if color: + if _color: s.color_set(1) bs = nassmache(_bs) ss = nassmache(_ss) @@ -92,12 +93,12 @@ def abbuzze(): _curses.endwin() def config_curses(): + global _color _curses.nonl() # tell curses not to do NL->CR/NL on output _curses.noecho() # don't echo input _curses.cbreak() # take input chars one at a time, no wait for \n - global color - if hasattr(_curses, "start_color"): - color = 1 + if hasattr(_curses, "start_color") and hasattr(_curses, "set_color"): + _color = 1 _curses.start_color() # start the colour system if _curses.has_colors(): if _curses.can_change_color(): @@ -107,8 +108,6 @@ def config_curses(): _curses.init_pair(2, curses.COLOR_MAGENTA, curses.COLOR_BLACK) _curses.init_pair(3, curses.COLOR_MAGENTA, curses.COLOR_BLACK) _curses.init_pair(4, curses.COLOR_MAGENTA, curses.COLOR_BLACK) - else: - color = 0 def waddemol(f): time.sleep(float(f))