From bdc323856368e2e218da7e5f3c853c01b7fccf3e Mon Sep 17 00:00:00 2001 From: calvin Date: Thu, 13 Oct 2005 17:07:47 +0000 Subject: [PATCH] extra proxy support paragraph, and print the help in the preferred encoding git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@2874 e7d03fd6-7b0d-0410-9947-9c21f3af8025 --- linkchecker | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/linkchecker b/linkchecker index cffa64ea..a021145e 100755 --- a/linkchecker +++ b/linkchecker @@ -20,6 +20,7 @@ Check HTML pages for broken links. """ import sys +import locale import codecs import re import os @@ -79,13 +80,16 @@ Notes = _("""NOTES o If your platform does not support threading, LinkChecker disables it automatically. o You can supply multiple user/password pairs in a configuration file. - o To use proxies set $http_proxy, $https_proxy, $ftp_proxy, $gopher_proxy - on Unix or Windows. - On a Mac use the Internet Config. o When checking 'news:' links the given NNTP host doesn't need to be the same as the host of the user browsing your pages. """) +ProxySupport = _("""PROXY SUPPORT +To use a proxy set $http_proxy, $https_proxy, $ftp_proxy, $gopher_proxy +on Unix or Windows. +On a Mac use the Internet Config. +""") + RegularExpressions = _("""REGULAR EXPRESSIONS Only Python regular expressions are accepted by LinkChecker. See http://www.amk.ca/python/howto/regex/ for an introduction in @@ -294,9 +298,11 @@ class LCOptionParser (optparse.OptionParser, object): """ Print translated help text. """ - s = u"%s\n%s\n%s\n%s\n%s\n%s\n%s" % (self.format_help(), - Examples, LoggerTypes, RegularExpressions, Notes, Retval, Warnings) - s = s.encode("iso-8859-1", "replace") + s = u"%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s" % (self.format_help(), + Examples, LoggerTypes, RegularExpressions, + ProxySupport, Notes, Retval, Warnings) + encoding = locale.getpreferredencoding() + s = s.encode(encoding, "replace") if os.name != 'posix': linkcheck.strformat.paginate(s) else: