mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-04-21 22:54:45 +00:00
fix extern argument creation
git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@546 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
parent
409b7a89eb
commit
c593d9795d
5 changed files with 16 additions and 11 deletions
2
TODO
2
TODO
|
|
@ -1,3 +1,5 @@
|
|||
--extern is not working. self.extern is not a tuple :/
|
||||
missing __str__ methods for debug output objects (regex patterns and loggers)
|
||||
Check why threaded app wont exit resp. is stalled
|
||||
Another Profiling roundup
|
||||
Named constants for ANSI Color codes
|
||||
|
|
|
|||
|
|
@ -472,8 +472,7 @@ class Configuration (UserDict.UserDict):
|
|||
self["warnings"] = 1
|
||||
except ConfigParser.Error, msg: debug(HURT_ME_PLENTY, msg)
|
||||
try: self["quiet"] = cfgparser.getboolean(section, "quiet")
|
||||
except ConfigParser.Error, msg:
|
||||
debug(HURT_ME_PLENTY, msg)
|
||||
except ConfigParser.Error, msg: debug(HURT_ME_PLENTY, msg)
|
||||
try: self["warnings"] = cfgparser.getboolean(section, "warnings")
|
||||
except ConfigParser.Error, msg: debug(HURT_ME_PLENTY, msg)
|
||||
try:
|
||||
|
|
|
|||
|
|
@ -24,7 +24,11 @@ from debuglevels import *
|
|||
# regular expression for RFC2368 compliant mailto: scanning
|
||||
headers_re = re.compile(r"\?(.+)$")
|
||||
|
||||
import DNS
|
||||
try:
|
||||
import DNS
|
||||
except ImportError:
|
||||
print >>sys.stderr, "You have to install PyDNS from http://pydns.sf.net/"
|
||||
raise SystemExit
|
||||
DNS.DiscoverNameServers()
|
||||
|
||||
class MailtoUrlData (HostCheckingUrlData):
|
||||
|
|
|
|||
|
|
@ -177,7 +177,7 @@ class UrlData:
|
|||
self.checktime = 0
|
||||
self.cached = 0
|
||||
self.urlConnection = None
|
||||
self.extern = 1
|
||||
self.extern = (1, 0)
|
||||
self.data = None
|
||||
self.html_comments = []
|
||||
self.has_content = 0
|
||||
|
|
@ -298,7 +298,7 @@ class UrlData:
|
|||
|
||||
# apply filter
|
||||
debug(BRING_IT_ON, "extern =", self.extern)
|
||||
if self.extern and (self.config["strict"] or self.extern[1]):
|
||||
if self.extern[0] and (self.config["strict"] or self.extern[1]):
|
||||
self.setWarning(
|
||||
linkcheck._("outside of domain filter, checked only syntax"))
|
||||
self.logMe()
|
||||
|
|
@ -371,7 +371,7 @@ class UrlData:
|
|||
self.isHtml() and \
|
||||
not self.cached and \
|
||||
self.recursionLevel < self.config["recursionlevel"] and \
|
||||
not self.extern
|
||||
not self.extern[0]
|
||||
|
||||
|
||||
def checkAnchors (self, anchor):
|
||||
|
|
@ -386,7 +386,7 @@ class UrlData:
|
|||
|
||||
def _getExtern (self):
|
||||
if not (self.config["externlinks"] or self.config["internlinks"]):
|
||||
return 0
|
||||
return (0, 0)
|
||||
# deny and allow external checking
|
||||
Config.debug(HURT_ME_PLENTY, "Url", self.url)
|
||||
if self.config["denyallow"]:
|
||||
|
|
@ -401,15 +401,15 @@ class UrlData:
|
|||
match = entry['pattern'].search(self.url)
|
||||
if (entry['negate'] and not match) or \
|
||||
(match and not entry['negate']):
|
||||
return 1
|
||||
return 0
|
||||
return (1, 0)
|
||||
return (0, 0)
|
||||
else:
|
||||
for entry in self.config["internlinks"]:
|
||||
Config.debug(HURT_ME_PLENTY, "Intern entry", entry)
|
||||
match = entry['pattern'].search(self.url)
|
||||
if (entry['negate'] and not match) or \
|
||||
(match and not entry['negate']):
|
||||
return 0
|
||||
return (0, 0)
|
||||
for entry in self.config["externlinks"]:
|
||||
Config.debug(HURT_ME_PLENTY, "Extern entry", entry)
|
||||
match = entry['pattern'].search(self.url)
|
||||
|
|
|
|||
|
|
@ -336,7 +336,7 @@ if config["log"].__class__ == BlacklistLogger and \
|
|||
os.path.exists(config['log'].filename):
|
||||
args = open(config['log'].filename).readlines()
|
||||
|
||||
debug(HURT_ME_PLENTY, pprint.pformat(config.data))
|
||||
debug(HURT_ME_PLENTY, "configuration:", pprint.pformat(config.data))
|
||||
|
||||
# interactive input
|
||||
if len(args)==0:
|
||||
|
|
|
|||
Loading…
Reference in a new issue