mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-05-09 23:24:44 +00:00
i18n support
git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@79 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
parent
378b99625e
commit
9c1f09e451
28 changed files with 563 additions and 95 deletions
2
Makefile
2
Makefile
|
|
@ -22,7 +22,7 @@ install:
|
|||
# ha! the root option finally made it into distutils
|
||||
./setup.py install --root=$(DESTDIR)
|
||||
# german translation mit Rezepten von Zlatko :)
|
||||
msgfmt -o linkcheck.mo linkcheck/messages.po
|
||||
msgfmt -o linkcheck.mo linkcheck/linkcheck.po
|
||||
install -c -m 644 linkcheck.mo $(DESTDIR)/usr/share/locale/de/LC_MESSAGES/
|
||||
# remove following line if Distutils have script support
|
||||
#install -c -m 755 linkchecker $(DESTDIR)/usr/bin/
|
||||
|
|
|
|||
|
|
@ -1,3 +1,20 @@
|
|||
"""
|
||||
Copyright (C) 2000 Bastian Kleineidam
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
"""
|
||||
import string,re,sys
|
||||
|
||||
HtmlTable = [
|
||||
|
|
@ -12,7 +29,7 @@ HtmlTable = [
|
|||
("<","<"),
|
||||
(">",">"),
|
||||
("é","é"),
|
||||
("č","è")
|
||||
("è","è")
|
||||
]
|
||||
|
||||
SQLTable = [
|
||||
|
|
|
|||
17
Template.py
17
Template.py
|
|
@ -11,7 +11,7 @@ Code fragments start with a dollar sign followed either by
|
|||
evaluates to the str() value of the given expression
|
||||
example: $printit()
|
||||
|
||||
2) python statements
|
||||
2) {python statements}
|
||||
append arbitrary objects to the output list
|
||||
|
||||
Limitations:
|
||||
|
|
@ -19,7 +19,11 @@ Limitations:
|
|||
No further syntax verification is done.
|
||||
2) Parameters to function calls must not have parantheses inside.
|
||||
Parameters to subscriptions must not have brackets inside.
|
||||
In code fragments, this is allowed, so you can use
|
||||
So this is not allowed:
|
||||
$func((tuple1,tuple2)) $func(map[key])
|
||||
But this is allowed:
|
||||
$func(param)[1] $a[x][y][z](blubb)
|
||||
In code fragments, you can write every Python code:
|
||||
${OUT = OUT + trunk[idx[1](data())]}
|
||||
|
||||
Example:
|
||||
|
|
@ -27,6 +31,9 @@ import Template
|
|||
|
||||
t = Template.Template("blabla.tmpl")
|
||||
open("blabla","w").write(t.fill_in({"var1":1,"var2":'hui'}))
|
||||
|
||||
blabla.tmpl:
|
||||
Hello, this is a demo. var1 is $var1, and var2 is $var2.
|
||||
"""
|
||||
import sys, string, re
|
||||
from types import StringType
|
||||
|
|
@ -43,10 +50,10 @@ STRING = 3
|
|||
# slicings and function calls
|
||||
identifier = "[a-zA-Z_][a-zA-Z0-9_]*"
|
||||
attributeref = identifier + "(\." + identifier + ")*"
|
||||
subscription = "(\[.*?\])?" # optional
|
||||
callargs = "(\(.*?\))?" # optional
|
||||
subscription = "\[.*\]"
|
||||
callargs = "\(.*\)"
|
||||
# now the whole regex
|
||||
regexvar = re.compile("^" + attributeref + subscription + callargs)
|
||||
regexvar = re.compile("^"+attributeref+"("+subscription+"|"+callargs+")*")
|
||||
|
||||
|
||||
class TemplateError(StandardError):
|
||||
|
|
|
|||
7
debian/changelog
vendored
7
debian/changelog
vendored
|
|
@ -7,11 +7,14 @@ linkchecker (1.2.3) unstable; urgency=low
|
|||
* linkchecker.bat installation support for windows
|
||||
* included test suite in distribution
|
||||
* improved mailto: link parsing
|
||||
* Blacklist output support
|
||||
* blacklist output support
|
||||
* CSV output support
|
||||
* SSL autodetection in setup.py
|
||||
* added GPL copyright header to each of my .py files
|
||||
* i18n support and german translation of the logger outputs
|
||||
* use http_proxy environment variable if present
|
||||
|
||||
-- Bastian Kleineidam <calvin@users.sourceforge.net> Fri, 28 Apr 2000 13:48:14 +0200
|
||||
-- Bastian Kleineidam <calvin@users.sourceforge.net> Mon, 1 May 2000 13:03:32 +0200
|
||||
|
||||
linkchecker (1.2.2) unstable; urgency=low
|
||||
|
||||
|
|
|
|||
4
fintl.py
4
fintl.py
|
|
@ -26,7 +26,7 @@ the translation into other languages.
|
|||
You ARE NOT REQUIRED to release the sourcecode of your program, since
|
||||
linking of your program against GPL code is avoided by this module.
|
||||
Although it is possible to use the GNU gettext library by using the
|
||||
*intl.so* module written by Martin von L÷wis if this is available. But it is
|
||||
*intl.so* module written by Martin von Löwis if this is available. But it is
|
||||
not required to use it in the first place.
|
||||
"""
|
||||
# Copyright 1999 by <mailto: pf@artcom-gmbh.de> (Peter Funk)
|
||||
|
|
@ -48,7 +48,7 @@ not required to use it in the first place.
|
|||
_default_localedir = '/usr/share/locale'
|
||||
_default_domain = 'python'
|
||||
|
||||
# check out, if Martin v. L÷wis 'intl' module interface to the GNU gettext
|
||||
# check out, if Martin v. Löwis 'intl' module interface to the GNU gettext
|
||||
# library is available and use it only, if it is available:
|
||||
try:
|
||||
from intl import *
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@
|
|||
# for tracking:
|
||||
# $Id$
|
||||
#
|
||||
# Modified by Bastian Kleineidam to squish a bug.
|
||||
|
||||
import socket,string,mimetools,httplib
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,19 @@
|
|||
"""Config.py in linkcheck
|
||||
""" Config.py in linkcheck
|
||||
Copyright (C) 2000 Bastian Kleineidam
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
This module stores
|
||||
* Metadata (version, copyright, author, ...)
|
||||
|
|
|
|||
|
|
@ -1,3 +1,20 @@
|
|||
"""
|
||||
Copyright (C) 2000 Bastian Kleineidam
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
"""
|
||||
import re,string,os,urlparse
|
||||
from UrlData import UrlData
|
||||
from os.path import normpath
|
||||
|
|
|
|||
|
|
@ -1,3 +1,20 @@
|
|||
"""
|
||||
Copyright (C) 2000 Bastian Kleineidam
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
"""
|
||||
import ftplib
|
||||
from UrlData import UrlData
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,20 @@
|
|||
"""
|
||||
Copyright (C) 2000 Bastian Kleineidam
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
"""
|
||||
from UrlData import UrlData
|
||||
|
||||
class GopherUrlData(UrlData):
|
||||
|
|
|
|||
|
|
@ -1,3 +1,20 @@
|
|||
"""
|
||||
Copyright (C) 2000 Bastian Kleineidam
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
"""
|
||||
import socket,string
|
||||
from UrlData import UrlData
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,20 @@
|
|||
"""
|
||||
Copyright (C) 2000 Bastian Kleineidam
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
"""
|
||||
import http11lib,urlparse,sys,time,re
|
||||
from UrlData import UrlData
|
||||
from RobotsTxt import RobotsTxt
|
||||
|
|
@ -113,6 +130,7 @@ class HttpUrlData(UrlData):
|
|||
def _getHttpRequest(self, method="HEAD"):
|
||||
"Put request and return (status code, status text, mime object)"
|
||||
if self.proxy:
|
||||
Config.debug("Using proxy "+self.proxy)
|
||||
host = self.proxy+":"+`self.proxyport`
|
||||
else:
|
||||
host = self.urlTuple[1]
|
||||
|
|
|
|||
|
|
@ -1,3 +1,20 @@
|
|||
"""
|
||||
Copyright (C) 2000 Bastian Kleineidam
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
"""
|
||||
from UrlData import UrlData
|
||||
from HttpUrlData import HttpUrlData
|
||||
_supportHttps=1
|
||||
|
|
|
|||
|
|
@ -1,3 +1,20 @@
|
|||
"""
|
||||
Copyright (C) 2000 Bastian Kleineidam
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
"""
|
||||
from UrlData import UrlData
|
||||
|
||||
class JavascriptUrlData(UrlData):
|
||||
|
|
|
|||
|
|
@ -1,10 +1,26 @@
|
|||
"""Logger classes.
|
||||
""" Logger classes.
|
||||
Copyright (C) 2000 Bastian Kleineidam
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
Every Logger has to implement the following functions:
|
||||
init(self)
|
||||
Called once to initialize the Logger. Why do we not use __init__(self)?
|
||||
Because we initialize the start time in init and __init__ gets not
|
||||
called at the time the checking starts.
|
||||
called at the time the checking starts but when the logger object is
|
||||
created.
|
||||
|
||||
newUrl(self,urlData)
|
||||
Called every time an url finished checking. All data we checked is in
|
||||
|
|
@ -40,6 +56,8 @@ TableError="<td bgcolor=\"db4930\">"
|
|||
TableOK="<td bgcolor=\"3ba557\">"
|
||||
RowEnd="</td></tr>\n"
|
||||
MyFont="<font face=\"Lucida,Verdana,Arial,sans-serif,Helvetica\">"
|
||||
|
||||
# keywords
|
||||
KeyWords = ["Real URL",
|
||||
"Result",
|
||||
"Base",
|
||||
|
|
@ -48,12 +66,12 @@ KeyWords = ["Real URL",
|
|||
"Warning",
|
||||
"D/L Time",
|
||||
"Check Time",
|
||||
"URL",
|
||||
]
|
||||
MaxIndent = max(map(len, KeyWords))+1
|
||||
MaxIndent = max(map(lambda x: len(_(x)), KeyWords))+1
|
||||
Spaces = {}
|
||||
for key in KeyWords:
|
||||
Spaces[key] = " "*(MaxIndent - len(key))
|
||||
|
||||
Spaces[key] = " "*(MaxIndent - len(_(key)))
|
||||
|
||||
# return formatted time
|
||||
def _strtime(t):
|
||||
|
|
@ -158,7 +176,7 @@ class HtmlLogger(StandardLogger):
|
|||
"<center><h2>"+MyFont+Config.AppName+"</font>"+
|
||||
"</center></h2>"+
|
||||
"<br><blockquote>"+Config.Freeware+"<br><br>"+
|
||||
"Start checking at "+_strtime(self.starttime)+"<br><br>")
|
||||
_("Start checking at ")+_strtime(self.starttime)+"<br><br>")
|
||||
self.fd.flush()
|
||||
|
||||
|
||||
|
|
@ -175,38 +193,42 @@ class HtmlLogger(StandardLogger):
|
|||
self.fd.write("</font>"+RowEnd)
|
||||
|
||||
if urlData.parentName:
|
||||
self.fd.write("<tr><td>"+MyFont+"Parent URL</font></td><td>"+
|
||||
MyFont+"<a href=\""+urlData.parentName+"\">"+
|
||||
urlData.parentName+"</a> line "+str(urlData.line)+
|
||||
"</font>"+RowEnd)
|
||||
self.fd.write("<tr><td>"+MyFont+_("Parent URL")+
|
||||
"</font></td><td>"+
|
||||
MyFont+"<a href=\""+urlData.parentName+"\">"+
|
||||
urlData.parentName+"</a> line "+str(urlData.line)+
|
||||
"</font>"+RowEnd)
|
||||
if urlData.baseRef:
|
||||
self.fd.write("<tr><td>"+MyFont+"Base</font></td><td>"+MyFont+
|
||||
urlData.baseRef+"</font>"+RowEnd)
|
||||
self.fd.write("<tr><td>"+MyFont+_("Base")+"</font></td><td>"+
|
||||
MyFont+urlData.baseRef+"</font>"+RowEnd)
|
||||
if urlData.url:
|
||||
self.fd.write("<tr><td>"+MyFont+"Real URL</font></td><td>"+MyFont+
|
||||
"<a href=\""+StringUtil.htmlify(urlData.url)+"\">"+
|
||||
urlData.url+"</a></font>"+RowEnd)
|
||||
self.fd.write("<tr><td>"+MyFont+_("Real URL")+"</font></td><td>"+
|
||||
MyFont+"<a href=\""+StringUtil.htmlify(urlData.url)+
|
||||
"\">"+urlData.url+"</a></font>"+RowEnd)
|
||||
if urlData.downloadtime:
|
||||
self.fd.write("<tr><td>"+MyFont+"D/L Time</font></td><td>"+MyFont+
|
||||
("%.3f" % urlData.downloadtime)+" seconds</font>"+RowEnd)
|
||||
self.fd.write("<tr><td>"+MyFont+_("D/L Time")+"</font></td><td>"+
|
||||
MyFont+("%.3f" % urlData.downloadtime)+
|
||||
" seconds</font>"+RowEnd)
|
||||
if urlData.checktime:
|
||||
self.fd.write("<tr><td>"+MyFont+"Check Time</font></td><td>"+
|
||||
MyFont+("%.3f" % urlData.checktime)+" seconds</font>"+
|
||||
RowEnd)
|
||||
self.fd.write("<tr><td>"+MyFont+_("Check Time")+
|
||||
"</font></td><td>"+MyFont+
|
||||
("%.3f" % urlData.checktime)+" seconds</font>"+
|
||||
RowEnd)
|
||||
if urlData.infoString:
|
||||
self.fd.write("<tr><td>"+MyFont+"Info</font></td><td>"+MyFont+
|
||||
StringUtil.htmlify(urlData.infoString)+"</font>"+RowEnd)
|
||||
self.fd.write("<tr><td>"+MyFont+_("Info")+"</font></td><td>"+
|
||||
MyFont+StringUtil.htmlify(urlData.infoString)+
|
||||
"</font>"+RowEnd)
|
||||
if urlData.warningString:
|
||||
self.warnings = self.warnings+1
|
||||
self.fd.write("<tr>"+TableWarning+MyFont+"Warning</font></td>"+
|
||||
TableWarning+MyFont+urlData.warningString+
|
||||
"</font>"+RowEnd)
|
||||
self.fd.write("<tr>"+TableWarning+MyFont+_("Warning")+
|
||||
"</font></td>"+TableWarning+MyFont+
|
||||
urlData.warningString+"</font>"+RowEnd)
|
||||
if urlData.valid:
|
||||
self.fd.write("<tr>"+TableOK+MyFont+"Result</font></td>"+
|
||||
self.fd.write("<tr>"+TableOK+MyFont+_("Result")+"</font></td>"+
|
||||
TableOK+MyFont+urlData.validString+"</font>"+RowEnd)
|
||||
else:
|
||||
self.errors = self.errors+1
|
||||
self.fd.write("<tr>"+TableError+MyFont+"Result</font></td>"+
|
||||
self.fd.write("<tr>"+TableError+MyFont+_("Result")+"</font></td>"+
|
||||
TableError+MyFont+urlData.errorString+"</font>"+RowEnd)
|
||||
|
||||
self.fd.write("</table></td></tr></table><br clear=all><br>")
|
||||
|
|
@ -214,25 +236,25 @@ class HtmlLogger(StandardLogger):
|
|||
|
||||
|
||||
def endOfOutput(self):
|
||||
self.fd.write(MyFont+"Thats it. ")
|
||||
self.fd.write(MyFont+_("Thats it. "))
|
||||
if self.warnings==1:
|
||||
self.fd.write("1 warning, ")
|
||||
self.fd.write(_("1 warning, "))
|
||||
else:
|
||||
self.fd.write(str(self.warnings)+" warnings, ")
|
||||
self.fd.write(str(self.warnings)+_(" warnings, "))
|
||||
if self.errors==1:
|
||||
self.fd.write("1 error")
|
||||
self.fd.write(_("1 error"))
|
||||
else:
|
||||
self.fd.write(str(self.errors)+" errors")
|
||||
self.fd.write(" found.<br>")
|
||||
self.fd.write(str(self.errors)+_(" errors"))
|
||||
self.fd.write(_(" found.")+"<br>")
|
||||
self.stoptime = time.time()
|
||||
self.fd.write("Stopped checking at"+_strtime(self.stoptime)+
|
||||
(" (%.3f seconds)" % (self.stoptime - self.starttime))+
|
||||
"</font></blockquote><br><hr noshade size=1><small>"+
|
||||
MyFont+Config.HtmlAppInfo+"<br>Get the newest version at "
|
||||
"<a href=\""+Config.Url+"\">"+Config.Url+
|
||||
"</a>.<br>Write comments and bugs to <a href=\"mailto:"+
|
||||
Config.Email+"\">"+Config.Email+
|
||||
"</a>.</font></small></body></html>")
|
||||
self.fd.write(_("Stopped checking at ")+_strtime(self.stoptime)+
|
||||
(_(" (%.3f seconds)") % (self.stoptime - self.starttime))+
|
||||
"</font></blockquote><br><hr noshade size=1><small>"+
|
||||
MyFont+Config.HtmlAppInfo+"<br>"+_("Get the newest version at ")+
|
||||
"<a href=\""+Config.Url+"\">"+Config.Url+
|
||||
"</a>.<br>"+_("Write comments and bugs to ")+"<a href=\"mailto:"+
|
||||
Config.Email+"\">"+Config.Email+
|
||||
"</a>.</font></small></body></html>")
|
||||
self.fd.flush()
|
||||
self.fd = None
|
||||
|
||||
|
|
@ -250,8 +272,8 @@ class ColoredLogger(StandardLogger):
|
|||
if self.currentPage != urlData.parentName:
|
||||
if self.prefix:
|
||||
self.fd.write("o\n")
|
||||
self.fd.write("\nParent URL "+COL_PARENT+urlData.parentName+
|
||||
COL_RESET+"\n")
|
||||
self.fd.write("\n"+_("Parent URL")+Spaces["Parent URL"]+
|
||||
COL_PARENT+urlData.parentName+COL_RESET+"\n")
|
||||
self.currentPage = urlData.parentName
|
||||
self.prefix = 1
|
||||
else:
|
||||
|
|
@ -264,8 +286,9 @@ class ColoredLogger(StandardLogger):
|
|||
self.fd.write("|\n+- ")
|
||||
else:
|
||||
self.fd.write("\n")
|
||||
self.fd.write("URL "+COL_URL+urlData.urlName+COL_RESET)
|
||||
if urlData.line: self.fd.write(", line "+`urlData.line`+"")
|
||||
self.fd.write(_("URL")+Spaces["URL"]+COL_URL+urlData.urlName+
|
||||
COL_RESET)
|
||||
if urlData.line: self.fd.write(_(", line ")+`urlData.line`+"")
|
||||
if urlData.cached:
|
||||
self.fd.write(" (cached)\n")
|
||||
else:
|
||||
|
|
@ -274,44 +297,46 @@ class ColoredLogger(StandardLogger):
|
|||
if urlData.baseRef:
|
||||
if self.prefix:
|
||||
self.fd.write("| ")
|
||||
self.fd.write("Base "+COL_BASE+urlData.baseRef+COL_RESET+"\n")
|
||||
self.fd.write(_("Base")+Spaces["Base"]+COL_BASE+urlData.baseRef+
|
||||
COL_RESET+"\n")
|
||||
|
||||
if urlData.url:
|
||||
if self.prefix:
|
||||
self.fd.write("| ")
|
||||
self.fd.write("Real URL "+COL_REAL+urlData.url+COL_RESET+"\n")
|
||||
self.fd.write(_("Real URL")+Spaces["Real URL"]+COL_REAL+
|
||||
urlData.url+COL_RESET+"\n")
|
||||
if urlData.downloadtime:
|
||||
if self.prefix:
|
||||
self.fd.write("| ")
|
||||
self.fd.write("D/L Time "+COL_DLTIME+
|
||||
("%.3f" % urlData.downloadtime)+" seconds"+COL_RESET+"\n")
|
||||
self.fd.write(_("D/L Time")+Spaces["D/L Time"]+COL_DLTIME+
|
||||
(_("%.3f seconds") % urlData.downloadtime)+COL_RESET+"\n")
|
||||
if urlData.checktime:
|
||||
if self.prefix:
|
||||
self.fd.write("| ")
|
||||
self.fd.write("Check Time "+COL_DLTIME+
|
||||
("%.3f" % urlData.checktime)+" seconds"+COL_RESET+"\n")
|
||||
self.fd.write(_("Check Time")+Spaces["Check Time"]+COL_DLTIME+
|
||||
(_("%.3f seconds") % urlData.checktime)+COL_RESET+"\n")
|
||||
|
||||
if urlData.infoString:
|
||||
if self.prefix:
|
||||
self.fd.write("| Info "+
|
||||
self.fd.write("| "+_("Info")+Spaces["Info"]+
|
||||
StringUtil.indentWith(StringUtil.blocktext(
|
||||
urlData.infoString, 65), "| "))
|
||||
urlData.infoString, 65), "| "+Spaces["Info"]))
|
||||
else:
|
||||
self.fd.write("Info "+
|
||||
self.fd.write(_("Info")+Spaces["Info"]+
|
||||
StringUtil.indentWith(StringUtil.blocktext(
|
||||
urlData.infoString, 65), " "))
|
||||
urlData.infoString, 65), " "+Spaces["Info"]))
|
||||
self.fd.write(COL_RESET+"\n")
|
||||
|
||||
if urlData.warningString:
|
||||
self.warnings = self.warnings+1
|
||||
if self.prefix:
|
||||
self.fd.write("| ")
|
||||
self.fd.write("Warning "+COL_WARNING+urlData.warningString+
|
||||
COL_RESET+"\n")
|
||||
self.fd.write(_("Warning")+Spaces["Warning"]+COL_WARNING+
|
||||
urlData.warningString+COL_RESET+"\n")
|
||||
|
||||
if self.prefix:
|
||||
self.fd.write("| ")
|
||||
self.fd.write("Result ")
|
||||
self.fd.write(_("Result")+Spaces["Result"])
|
||||
if urlData.valid:
|
||||
self.fd.write(COL_VALID+urlData.validString+COL_RESET+"\n")
|
||||
else:
|
||||
|
|
@ -337,8 +362,8 @@ class GMLLogger(StandardLogger):
|
|||
def init(self):
|
||||
self.fd.write("# created by "+Config.AppName+" at "+
|
||||
_strtime(time.time())+
|
||||
"\n# you get "+Config.AppName+" at "+Config.Url+
|
||||
"\n# write comments and bugs to "+Config.Email+
|
||||
"\n# "+_("Get the newest version at ")+Config.Url+
|
||||
"\n# "+_("Write comments and bugs to ")+Config.Email+
|
||||
"\ngraph [\n directed 1\n")
|
||||
self.fd.flush()
|
||||
|
||||
|
|
@ -387,8 +412,8 @@ class SQLLogger(StandardLogger):
|
|||
def init(self):
|
||||
self.fd.write("-- created by "+Config.AppName+" at "+
|
||||
_strtime(time.time())+
|
||||
"\n-- you get "+Config.AppName+" at "+Config.Url+
|
||||
"\n-- write comments and bugs to "+Config.Email+"\n\n")
|
||||
"\n-- "+_("Get the newest version at ")+Config.Url+
|
||||
"\n-- "+_("Write comments and bugs to ")+Config.Email+"\n\n")
|
||||
self.fd.flush()
|
||||
|
||||
def newUrl(self, urlData):
|
||||
|
|
@ -422,7 +447,10 @@ class BlacklistLogger:
|
|||
self.blacklist = {}
|
||||
|
||||
def init(self):
|
||||
"""initialize the blacklist"""
|
||||
"""initialize the blacklist
|
||||
We do nothing here because we have read the blacklist in the
|
||||
linkchecker script already.
|
||||
"""
|
||||
pass
|
||||
|
||||
def newUrl(self, urlData):
|
||||
|
|
|
|||
|
|
@ -1,3 +1,20 @@
|
|||
"""
|
||||
Copyright (C) 2000 Bastian Kleineidam
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
"""
|
||||
import re,socket,string,DNS,sys,Config
|
||||
from HostCheckingUrlData import HostCheckingUrlData
|
||||
from smtplib import SMTP
|
||||
|
|
@ -27,6 +44,17 @@ class MailtoUrlData(HostCheckingUrlData):
|
|||
re.findall(adress_re, self.urlName))
|
||||
|
||||
def checkConnection(self, config):
|
||||
"""Verify a list of email adresses. If one adress fails,
|
||||
the whole list will fail.
|
||||
For each mail adress we check the following things:
|
||||
(1) Look up the MX DNS records. If we found no MX record,
|
||||
print an error.
|
||||
(2) Check if one of the mail hosts accept an SMTP connection.
|
||||
Check hosts with higher priority first.
|
||||
If no host accepts SMTP, we print a warning.
|
||||
(3) Try to verify the adress with the VRFY command. If we got
|
||||
an answer, print the verified adress as an info.
|
||||
"""
|
||||
DNS.ParseResolvConf()
|
||||
for user,host in self.adresses:
|
||||
mxrecords = DNS.mxlookup(host)
|
||||
|
|
|
|||
|
|
@ -1,3 +1,20 @@
|
|||
"""
|
||||
Copyright (C) 2000 Bastian Kleineidam
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
"""
|
||||
import re,string,time,nntplib
|
||||
from HostCheckingUrlData import HostCheckingUrlData
|
||||
from UrlData import LinkCheckerException
|
||||
|
|
|
|||
|
|
@ -1,3 +1,20 @@
|
|||
"""
|
||||
Copyright (C) 2000 Bastian Kleineidam
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
"""
|
||||
import string,re
|
||||
import UrlData
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,20 @@
|
|||
"""
|
||||
Copyright (C) 2000 Bastian Kleineidam
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
"""
|
||||
import re,urlparse,string,httplib,urllib,sys,StringUtil,Config
|
||||
|
||||
class RobotsTxt:
|
||||
|
|
|
|||
|
|
@ -1,3 +1,20 @@
|
|||
"""
|
||||
Copyright (C) 2000 Bastian Kleineidam
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
"""
|
||||
import telnetlib,re,string
|
||||
from HostCheckingUrlData import HostCheckingUrlData
|
||||
from UrlData import LinkCheckerException
|
||||
|
|
|
|||
|
|
@ -1,3 +1,20 @@
|
|||
"""
|
||||
Copyright (C) 2000 Bastian Kleineidam
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
"""
|
||||
from threading import *
|
||||
|
||||
class Threader:
|
||||
|
|
|
|||
|
|
@ -1,3 +1,20 @@
|
|||
"""
|
||||
Copyright (C) 2000 Bastian Kleineidam
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
"""
|
||||
import sys,re,string,urlparse,urllib,time
|
||||
import Config,StringUtil
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,21 @@
|
|||
"""__init__.py in linkcheck
|
||||
|
||||
Copyright (C) 2000 Bastian Kleineidam
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
Here we find the main function to call: checkUrls.
|
||||
This is the only entry point into the linkcheck module and is used
|
||||
of course by the linkchecker script.
|
||||
|
|
|
|||
|
|
@ -1,4 +1,20 @@
|
|||
"""common CGI functions used by the CGI scripts"""
|
||||
""" common CGI functions used by the CGI scripts
|
||||
Copyright (C) 2000 Bastian Kleineidam
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
"""
|
||||
import re,time,urlparse
|
||||
|
||||
def checkform(form):
|
||||
|
|
|
|||
109
linkcheck/linkcheck.po
Normal file
109
linkcheck/linkcheck.po
Normal file
|
|
@ -0,0 +1,109 @@
|
|||
# SOME DESCRIPTIVE TITLE.
|
||||
# Copyright (C) YEAR Free Software Foundation, Inc.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||
#
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"POT-Creation-Date: 2000-05-01 11:50+0200\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=CHARSET\n"
|
||||
"Content-Transfer-Encoding: ENCODING\n"
|
||||
|
||||
#: Logging.py:82
|
||||
msgid "Get the newest version at "
|
||||
msgstr "Die neueste Version gibt es unter "
|
||||
|
||||
#: Logging.py:83
|
||||
msgid "Write comments and bugs to "
|
||||
msgstr "Kommentare und Fehler mailen Sie bitte an "
|
||||
|
||||
#: Logging.py:84
|
||||
msgid "Start checking at "
|
||||
msgstr "Beginne Prüfen am "
|
||||
|
||||
#: Logging.py:89
|
||||
msgid "URL"
|
||||
msgstr "URL"
|
||||
|
||||
#: Logging.py:95
|
||||
msgid "Parent URL"
|
||||
msgstr "Vater URL"
|
||||
|
||||
#: Logging.py:96
|
||||
msgid ", line "
|
||||
msgstr ", Zeile "
|
||||
|
||||
#: Logging.py:99
|
||||
msgid "Base"
|
||||
msgstr "Basis"
|
||||
|
||||
#: Logging.py:101
|
||||
msgid "Real URL"
|
||||
msgstr "Tats. URL"
|
||||
|
||||
#: Logging.py:103
|
||||
msgid "D/L Time"
|
||||
msgstr "D/L Zeit"
|
||||
|
||||
#: Logging.py:104 Logging.py:107
|
||||
#, c-format
|
||||
msgid "%.3f seconds\n"
|
||||
msgstr "%.3f Sekunden\n"
|
||||
|
||||
#: Logging.py:106
|
||||
msgid "Check Time"
|
||||
msgstr "Prüfzeit"
|
||||
|
||||
#: Logging.py:109
|
||||
msgid "Info"
|
||||
msgstr "Info"
|
||||
|
||||
#: Logging.py:115
|
||||
msgid "Warning"
|
||||
msgstr "Warnung"
|
||||
|
||||
#: Logging.py:120
|
||||
msgid "Result"
|
||||
msgstr "Ergebnis"
|
||||
|
||||
#: Logging.py:130
|
||||
msgid ""
|
||||
"\n"
|
||||
"Thats it. "
|
||||
msgstr ""
|
||||
"\n"
|
||||
"Das wars. "
|
||||
|
||||
#: Logging.py:133
|
||||
msgid "1 warning, "
|
||||
msgstr "1 Warnung, "
|
||||
|
||||
#: Logging.py:135
|
||||
msgid " warnings, "
|
||||
msgstr " Warnungen, "
|
||||
|
||||
#: Logging.py:137
|
||||
msgid "1 error"
|
||||
msgstr "1 Fehler"
|
||||
|
||||
#: Logging.py:139
|
||||
msgid " errors"
|
||||
msgstr " Fehler"
|
||||
|
||||
#: Logging.py:140
|
||||
msgid " found.\n"
|
||||
msgstr " gefunden.\n"
|
||||
|
||||
#: Logging.py:142
|
||||
msgid "Stopped checking at "
|
||||
msgstr "Beende Prüfen am "
|
||||
|
||||
#: Logging.py:143
|
||||
#, c-format
|
||||
msgid " (%.3f seconds)"
|
||||
msgstr " (%.3f Sekunden)"
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
# German .po file for my LinkChecker.
|
||||
# Copyright (C) YEAR Free Software Foundation, Inc.
|
||||
# Bastian Kleineidam <calvin@users.sourceforge.net>, 2000.
|
||||
#
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: LinkChecker 1.2.3\n"
|
||||
"POT-Creation-Date: 2000-04-30 22:43+0200\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: Bastian Kleineidam <calvin@users.sourceforge.net>\n"
|
||||
"Language-Team: German <de@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=ISO-8859-1\n"
|
||||
"Content-Transfer-Encoding: 8-bit\n"
|
||||
|
||||
#: Logging.py:91
|
||||
msgid "Parent URL "
|
||||
msgstr "Vater URL "
|
||||
|
|
@ -170,6 +170,14 @@ except:
|
|||
type, value = sys.exc_info()[:2]
|
||||
printUsage(value)
|
||||
|
||||
# check for environment variables (currently only http_proxy)
|
||||
if os.environ.has_key("http_proxy"):
|
||||
proxy = re.compile("(.+):(.+)").match(os.environ["http_proxy"])
|
||||
if proxy:
|
||||
config["proxy"] = proxy.group(1)
|
||||
config["proxyport"] = int(proxy.group(2))
|
||||
else:
|
||||
config["proxy"] = os.environ["http_proxy"]
|
||||
|
||||
# apply options and arguments
|
||||
_user = "anonymous"
|
||||
|
|
|
|||
17
setup.py
17
setup.py
|
|
@ -1,4 +1,21 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
# Copyright (C) 2000 Bastian Kleineidam
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
from distutils.core import setup
|
||||
from distutils.dist import Distribution
|
||||
from Template import Template
|
||||
|
|
|
|||
Loading…
Reference in a new issue