l.s.s.PageMatch : class documentation

Part of lp.services.sitesearch View In Hierarchy

See ISearchResult.

A search result that represents a web page.

Method url_rewrite_exceptions A list of launchpad.net URLs that must not be rewritten.
Method url_rewrite_scheme The URL scheme used in rewritten URLs.
Method url_rewrite_hostname The network location used in rewritten URLs.
Method __init__ initialize a PageMatch.
Method _sanitize_query_string Escapes invalid urls.
Method _strip_trailing_slash Return the url without a trailing slash.
Method _rewrite_url Rewrite the url to the local environment.
@property
def url_rewrite_exceptions(self):
A list of launchpad.net URLs that must not be rewritten.

Configured in config.sitesearch.url_rewrite_exceptions.

@property
def url_rewrite_scheme(self):
The URL scheme used in rewritten URLs.

Configured in config.vhosts.use_https.

@property
def url_rewrite_hostname(self):
The network location used in rewritten URLs.

Configured in config.vhost.mainsite.hostname.

def __init__(self, title, url, summary):
initialize a PageMatch.
ParameterstitleA string. The title of the item.
urlA string. The full URL of the item.
summaryA string. A summary of the item.
def _sanitize_query_string(self, url):
Escapes invalid urls.
def _strip_trailing_slash(self, url):
Return the url without a trailing slash.
def _rewrite_url(self, url):
Rewrite the url to the local environment.

Links with launchpad.net are rewritten to the local hostname, except if the domain matches a domain in the url_rewrite_exceptions. property.

ParametersurlA URL str that may be rewritten to the local launchpad environment.
ReturnsA URL str.
API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.