mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-04-27 09:34:42 +00:00
cmdline param defaults to False
git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@2595 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
parent
a85ac68e16
commit
ed738d2436
4 changed files with 12 additions and 11 deletions
|
|
@ -184,7 +184,7 @@ def absolute_url (base_url, base_ref, parent_url):
|
|||
|
||||
def get_url_from (base_url, recursion_level, consumer,
|
||||
parent_url=None, base_ref=None, line=0, column=0,
|
||||
name=u"", cmdline=True):
|
||||
name=u"", cmdline=False):
|
||||
"""
|
||||
Get url data from given base data.
|
||||
|
||||
|
|
|
|||
|
|
@ -317,7 +317,8 @@ class HttpUrl (internpaturl.InternPatternUrl, proxysupport.ProxySupport):
|
|||
newobj = linkcheck.checker.get_url_from(
|
||||
redirected, self.recursion_level, self.consumer,
|
||||
parent_url=self.parent_url, base_ref=self.base_ref,
|
||||
line=self.line, column=self.column, name=self.name)
|
||||
line=self.line, column=self.column, name=self.name,
|
||||
cmdline=False)
|
||||
newobj.warning = self.warning
|
||||
newobj.info = self.info
|
||||
# append new object to queue
|
||||
|
|
|
|||
|
|
@ -529,16 +529,12 @@ class UrlBase (object):
|
|||
@rtype: tuple (bool, bool)
|
||||
"""
|
||||
for entry in self.consumer.config["externlinks"]:
|
||||
linkcheck.log.debug(linkcheck.LOG_CHECK, "Extern entry %r",
|
||||
entry)
|
||||
match = entry['pattern'].search(url)
|
||||
if (entry['negate'] and not match) or \
|
||||
(match and not entry['negate']):
|
||||
linkcheck.log.debug(linkcheck.LOG_CHECK, "Extern URL %r", url)
|
||||
return (1, entry['strict'])
|
||||
for entry in self.consumer.config["internlinks"]:
|
||||
linkcheck.log.debug(linkcheck.LOG_CHECK, "Intern entry %r",
|
||||
entry)
|
||||
match = entry['pattern'].search(url)
|
||||
if (entry['negate'] and not match) or \
|
||||
(match and not entry['negate']):
|
||||
|
|
@ -628,7 +624,8 @@ class UrlBase (object):
|
|||
base_ref = h.base_ref
|
||||
url_data = linkcheck.checker.get_url_from(url,
|
||||
self.recursion_level+1, self.consumer, parent_url=self.url,
|
||||
base_ref=base_ref, line=line, column=column, name=name)
|
||||
base_ref=base_ref, line=line, column=column, name=name,
|
||||
cmdline=False)
|
||||
self.consumer.append_url(url_data)
|
||||
|
||||
def parse_opera (self):
|
||||
|
|
@ -648,7 +645,8 @@ class UrlBase (object):
|
|||
if url:
|
||||
url_data = linkcheck.checker.get_url_from(url,
|
||||
self.recursion_level+1, self.consumer,
|
||||
parent_url=self.url, line=lineno, name=name)
|
||||
parent_url=self.url, line=lineno, name=name,
|
||||
cmdline=False)
|
||||
self.consumer.append_url(url_data)
|
||||
name = ""
|
||||
|
||||
|
|
@ -665,7 +663,8 @@ class UrlBase (object):
|
|||
continue
|
||||
url_data = linkcheck.checker.get_url_from(line,
|
||||
self.recursion_level+1, self.consumer,
|
||||
parent_url=self.url, line=lineno)
|
||||
parent_url=self.url, line=lineno,
|
||||
cmdline=False)
|
||||
self.consumer.append_url(url_data)
|
||||
|
||||
def parse_css (self):
|
||||
|
|
@ -680,7 +679,8 @@ class UrlBase (object):
|
|||
url = linkcheck.strformat.unquote(mo.group("url").strip())
|
||||
url_data = linkcheck.checker.get_url_from(url,
|
||||
self.recursion_level+1, self.consumer,
|
||||
parent_url=self.url, line=lineno, column=column)
|
||||
parent_url=self.url, line=lineno, column=column,
|
||||
cmdline=False)
|
||||
self.consumer.append_url(url_data)
|
||||
|
||||
def serialized (self):
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ def checklink (out=sys.stdout, form=None, env=os.environ):
|
|||
consumer = linkcheck.checker.consumer.Consumer(config, cache)
|
||||
# start checking
|
||||
url = form["url"].value
|
||||
url_data = linkcheck.checker.get_url_from(url, 0, consumer)
|
||||
url_data = linkcheck.checker.get_url_from(url, 0, consumer, cmdline=False)
|
||||
consumer.append_url(url_data)
|
||||
linkcheck.checker.check_urls(consumer)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue