linkcheck.checker.internpaturl

Intern URL pattern support.

Functions

get_intern_pattern(url)

Return intern pattern for given URL.

Classes

InternPatternUrl(base_url, recursion_level, ...)

Class supporting an intern URL pattern.

class linkcheck.checker.internpaturl.InternPatternUrl(base_url, recursion_level, aggregate, parent_url=None, base_ref=None, line=-1, column=-1, page=-1, name='', url_encoding=None, extern=None)[source]

Bases: UrlBase

Class supporting an intern URL pattern.

Initialize check data, and store given variables.

Parameters:
  • base_url – unquoted and possibly unnormed url

  • recursion_level – on what check level lies the base url

  • aggregate – aggregate instance

  • parent_url – quoted and normed url of parent or None

  • base_ref – quoted and normed url of <base href=””> or None

  • line – line number of url in parent content

  • column – column number of url in parent content

  • page – page number of url in parent content

  • name – name of url or empty

  • url_encoding – encoding of URL or None

  • extern – None or (is_extern, is_strict)

get_intern_pattern(url=None)[source]

Get pattern for intern URL matching.

:return non-empty regex pattern or None :rtype String or None

linkcheck.checker.internpaturl.get_intern_pattern(url)[source]

Return intern pattern for given URL. Redirections to the same domain with or without “www.” prepended are allowed.