From 6d7aea08d341aa6bd674d3b267cb2efcbc42638c Mon Sep 17 00:00:00 2001 From: calvin Date: Thu, 14 Feb 2002 15:33:53 +0000 Subject: [PATCH] *** empty log message *** git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@368 e7d03fd6-7b0d-0410-9947-9c21f3af8025 --- debian/changelog | 9 ++++ linkcheck/Config.py | 48 ++++++++++---------- linkcheck/UrlData.py | 16 +++---- linkcheck/__init__.py | 2 +- linkchecker | 2 +- linkchecker.1 | 2 +- linkcheckerrc | 100 +++++++++++++++++++++--------------------- po/de.po | 2 +- po/fr.po | 2 +- setup.py | 2 +- 10 files changed, 97 insertions(+), 88 deletions(-) diff --git a/debian/changelog b/debian/changelog index 433d242f..90c047fe 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +linkchecker (1.3.21) unstable; urgency=low + + * really fix the keyboardinterrupt thing + * enable log=XXX configfile setting, which was always overwritten with + 'text' + * update example linkcheckerrc file and documentation + + -- Bastian Kleineidam Thu, 14 Feb 2002 16:34:30 +0100 + linkchecker (1.3.20) unstable; urgency=low * fix keyboard interrupt diff --git a/linkcheck/Config.py b/linkcheck/Config.py index 365e0957..d70b5562 100644 --- a/linkcheck/Config.py +++ b/linkcheck/Config.py @@ -399,36 +399,39 @@ class Configuration(UserDict.UserDict): try: cfgparser = ConfigParser.ConfigParser() cfgparser.read(files) - except ConfigParser.Error: + except ConfigParser.Error, msg: + debug(BRING_IT_ON, msg) return section="output" for key in Loggers.keys(): if cfgparser.has_section(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][opt] = cfgparser.get(key, opt) + except ConfigParser.Error, msg: debug(BRING_IT_ON, msg) try: self[key]['fields'] = map(string.strip, cfgparser.get(key, 'fields').split(',')) - except ConfigParser.Error, msg: - debug(BRING_IT_ON, msg) + except ConfigParser.Error, msg: debug(BRING_IT_ON, msg) try: log = cfgparser.get(section, "log") if Loggers.has_key(log): self['log'] = self.newLogger(log) else: self.warn(_("invalid log option '%s'") % log) - except ConfigParser.Error: pass + except ConfigParser.Error, msg: + debug(BRING_IT_ON, msg) try: if cfgparser.getboolean(section, "verbose"): self["verbose"] = 1 self["warnings"] = 1 - except ConfigParser.Error: pass + except ConfigParser.Error, msg: debug(BRING_IT_ON, msg) try: self["quiet"] = cfgparser.getboolean(section, "quiet") - except ConfigParser.Error: pass + except ConfigParser.Error, msg: + debug(BRING_IT_ON, msg) try: self["warnings"] = cfgparser.getboolean(section, "warnings") - except ConfigParser.Error: pass + except ConfigParser.Error, msg: debug(BRING_IT_ON, msg) try: filelist = cfgparser.get(section, "fileoutput").split(",") for arg in filelist: @@ -437,7 +440,7 @@ class Configuration(UserDict.UserDict): if Loggers.has_key(arg) and arg != "blacklist": self['fileoutput'].append( self.newLogger(arg, {'fileoutput':1})) - except ConfigParser.Error: pass + except ConfigParser.Error, msg: debug(BRING_IT_ON, msg) section="checking" try: @@ -446,31 +449,31 @@ class Configuration(UserDict.UserDict): self.disableThreading() else: self.enableThreading(num) - except ConfigParser.Error: pass + except ConfigParser.Error: debug(BRING_IT_ON, msg) try: self["anchors"] = cfgparser.getboolean(section, "anchors") - except ConfigParser.Error: pass + except ConfigParser.Error, msg: debug(BRING_IT_ON, msg) try: num = cfgparser.getint(section, "recursionlevel") if num<0: self.error(_("illegal recursionlevel number %d") % num) self["recursionlevel"] = num - except ConfigParser.Error: pass + except ConfigParser.Error, msg: debug(BRING_IT_ON, msg) try: self["robotstxt"] = cfgparser.getboolean(section, "robotstxt") - except ConfigParser.Error: pass + except ConfigParser.Error, msg: debug(BRING_IT_ON, msg) try: self["strict"] = cfgparser.getboolean(section, "strict") - except ConfigParser.Error: pass + except ConfigParser.Error, msg: debug(BRING_IT_ON, msg) try: warn = cfgparser.get(section, "warningregex") if warn: self["warningregex"] = re.compile(warn) - except ConfigParser.Error: pass + except ConfigParser.Error, msg: debug(BRING_IT_ON, msg) try: self["nntpserver"] = cfgparser.get(section, "nntpserver") - except ConfigParser.Error: pass + except ConfigParser.Error, msg: debug(BRING_IT_ON, msg) try: self["interactive"] = cfgparser.getboolean(section, "interactive") - except ConfigParser.Error: pass + except ConfigParser.Error, msg: debug(BRING_IT_ON, msg) section = "authentication" try: @@ -483,7 +486,7 @@ class Configuration(UserDict.UserDict): 'user': auth[1], 'password': auth[2]}) i += 1 - except ConfigParser.Error: pass + except ConfigParser.Error, msg: debug(BRING_IT_ON, msg) section = "filtering" try: @@ -494,9 +497,8 @@ class Configuration(UserDict.UserDict): self["externlinks"].append((re.compile(tuple[0]), int(tuple[1]))) i += 1 - except ConfigParser.Error: pass + except ConfigParser.Error, msg: debug(BRING_IT_ON, msg) try: self["internlinks"].append(re.compile(cfgparser.get(section, "internlinks"))) - except ConfigParser.Error: pass + except ConfigParser.Error, msg: debug(BRING_IT_ON, msg) try: self["denyallow"] = cfgparser.getboolean(section, "denyallow") - except ConfigParser.Error: pass - self['log'] = self.newLogger('text') + except ConfigParser.Error, msg: debug(BRING_IT_ON, msg) diff --git a/linkcheck/UrlData.py b/linkcheck/UrlData.py index 0f0f6390..a2f55e9c 100644 --- a/linkcheck/UrlData.py +++ b/linkcheck/UrlData.py @@ -15,8 +15,8 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -import sys, re, urlparse, urllib, time, DNS, traceback -import Config, StringUtil, linkcheck, linkname +import sys, re, urlparse, urllib, time, traceback, socket, select +import DNS, Config, StringUtil, linkcheck, linkname debug = Config.debug from linkcheck import _ from debuglevels import * @@ -32,6 +32,8 @@ If you disclose some information because its too private to you thats ok. I will try to help you nontheless (but you have to give me *something* I can work with ;). """) % Config.Email + type,value = sys.exc_info()[:2] + print >> sys.stderr, type, value import traceback traceback.print_exc() print_app_info() @@ -58,13 +60,9 @@ ExcList = [ linkcheck.error, DNS.Error, linkcheck.timeoutsocket.Timeout, + socket.error, + select.error, ] -try: - import socket - ExcList.append(socket.error) -except ImportError: - pass - # regular expression to match an HTML tag with one given attribute _linkMatcher = r""" @@ -241,7 +239,7 @@ class UrlData: self._check(config) except KeyboardInterrupt: pass - except socket.error: + except (socket.error, select.error): # on Unix, ctrl-c can raise # error: (4, 'Interrupted system call') type, value = sys.exc_info()[:2] diff --git a/linkcheck/__init__.py b/linkcheck/__init__.py index 412cdf82..c3f7d3f2 100644 --- a/linkcheck/__init__.py +++ b/linkcheck/__init__.py @@ -55,4 +55,4 @@ def checkUrls(config): except KeyboardInterrupt: config.finish() config.log_endOfOutput() - sys.stderr.write(_("linkcheck: warning: keyboard interrupt\n")) + config.warn(_("keyboard interrupt")) diff --git a/linkchecker b/linkchecker index 7685b5ce..e04a6983 100755 --- a/linkchecker +++ b/linkchecker @@ -78,7 +78,7 @@ For single-letter option arguments the space is not a necessity. So Check recursively all links up to given depth (depth >= 0). Default depth is 1. -R, --robots-txt - Obey the robots exclusion standard. + Obey the robots exclusion standard (this is the default). -s, --strict Check only syntax of extern links, do not try to connect to them. -t num, --threads=num diff --git a/linkchecker.1 b/linkchecker.1 index 7ef8f029..0b9b9f84 100644 --- a/linkchecker.1 +++ b/linkchecker.1 @@ -93,7 +93,7 @@ Check recursively all links up to given \fIdepth\fP (depth >= 0). Default depth is 1. .TP \fB-R\fP, \fB--robots-txt\fP -Obey the robots exclusion standard. +Obey the robots exclusion standard (this is the default). .TP \fB-s\fP, \fB--strict\fP Check only the syntax of extern links, do not try to connect to them. diff --git a/linkcheckerrc b/linkcheckerrc index 3f72a961..8b263087 100644 --- a/linkcheckerrc +++ b/linkcheckerrc @@ -1,20 +1,20 @@ -# sample resource file with default values +# sample resource file # see linkchecker -h for help on these options # commandline options override these settings! [output] # turn on/off debug messages -debug=0 -# use the text logger -log=text +# use higher numbers for more debugging +#debug=2 +# change the logging type +#log=colored # turn on/off --verbose -verbose=0 +#verbose=1 # turn on/off --warnings -warnings=0 +#warnings=1 # turn on/off --quiet -quiet=0 +#quiet=1 # additional file output -fileoutput= #fileoutput = text, colored, html, gml, sql # fields names: @@ -36,80 +36,80 @@ fileoutput= # each Logger can have separate configuration parameters # standard text logger [text] -filename=linkchecker-out.txt -fields=all +#filename=linkchecker-out.txt +#fields=all # GML logger [gml] -filename=linkchecker-out.gml -fields=all +#filename=linkchecker-out.gml +#fields=all # CSV logger [csv] -filename=linkchecker-out.csv -separator=; -fields=all +#filename=linkchecker-out.csv +#separator=; +#fields=all # SQL logger [sql] -filename=linkchecker-out.sql -dbname=linksdb -commandsep=; -fields=all +#filename=linkchecker-out.sql +#dbname=linksdb +#commandsep=; +#fields=all # HTML logger [html] -filename=linkchecker-out.html +#filename=linkchecker-out.html # colors for the various parts -colorbackground="#fff7e5" -colorurl="#dcd5cf" -colorborder="#000000" -colorlink="#191c83" -tablewarning= -tableerror= -tableok= -fields=all +#colorbackground="#fff7e5" +#colorurl="#dcd5cf" +#colorborder="#000000" +#colorlink="#191c83" +#tablewarning= +#tableerror= +#tableok= +#fields=all # ANSI color logger [colored] filename=linkchecker-out.colored # colors for the various parts -colorparent=37 -colorurl=0 -colorname=0 -colorreal=36 -colorbase=35 -colorvalid=1;32 -colorinvalid=1;31 -colorinfo=0 -colorwarning=1;33 -colordltime=0 -colorreset=0 -fields=all +#colorparent=37 +#colorurl=0 +#colorname=0 +#colorreal=36 +#colorbase=35 +#colorvalid=1;32 +#colorinvalid=1;31 +#colorinfo=0 +#colorwarning=1;33 +#colordltime=0 +#colorreset=0 +#fields=all # blacklist logger [blacklist] -filename=~/.blacklist +#filename=~/.blacklist # checking options [checking] # number of threads -threads=5 +#threads=5 # check anchors? -anchors=0 -recursionlevel=1 +#anchors=0 +#recursionlevel=1 # obey robots.txt exclusion? -robotstxt=1 +#robotstxt=1 # overall strict checking. You can specify for each extern URL # separately if its strict or not. See the [filtering] section -strict=0 +#strict=0 # supply a regular expression for which warnings are printed if found # in any HTML files. -warningregex= +#warningregex=Oracle DB Error # Basic NNTP server. Overrides NNTP_SERVER environment variable. -nntpserver= +#nntpserver= # interactive operation -interactive=0 +#interactive=0 # filtering options (see FAQ) # for each extern link we can specify if it is strict or not @@ -122,7 +122,7 @@ interactive=0 # internlinks=calvinsplayground\.de # check only syntax of all mail adresses # extern3=^mailto: 1 -denyallow=0 +#denyallow=0 # You can provide different user/password pairs for different link types. # Entries are a triple (link regular expression, username, password), diff --git a/po/de.po b/po/de.po index 20e11a1c..a54972ac 100644 --- a/po/de.po +++ b/po/de.po @@ -146,7 +146,7 @@ msgid "" " Check recursively all links up to given depth (depth >= 0).\n" " Default depth is 1.\n" "-R, --robots-txt\n" -" Obey the robots exclusion standard.\n" +" Obey the robots exclusion standard (this is the default).\n" "-s, --strict\n" " Check only syntax of extern links, do not try to connect to them.\n" "-t num, --threads=num\n" diff --git a/po/fr.po b/po/fr.po index bcaf9726..5ae6d399 100644 --- a/po/fr.po +++ b/po/fr.po @@ -146,7 +146,7 @@ msgid "" " Check recursively all links up to given depth (depth >= 0).\n" " Default depth is 1.\n" "-R, --robots-txt\n" -" Obey the robots exclusion standard.\n" +" Obey the robots exclusion standard (this is the default).\n" "-s, --strict\n" " Check only syntax of extern links, do not try to connect to them.\n" "-t num, --threads=num\n" diff --git a/setup.py b/setup.py index e4149275..2e3d93d5 100755 --- a/setup.py +++ b/setup.py @@ -129,7 +129,7 @@ myname = "Bastian Kleineidam" myemail = "calvin@users.sourceforge.net" setup (name = "linkchecker", - version = "1.3.20", + version = "1.3.21", description = "check HTML documents for broken links", author = myname, author_email = myemail,