l.s.w.url : module documentation

Part of lp.services.webapp

Functions for working with URLs.
Function _enable_sftp_in_urlparse Teach the urlparse module about the sftp scheme.
Function _enable_bzr_ssh_in_urlparse Teach the urlparse module about the bzr+ssh scheme.
def _enable_sftp_in_urlparse():

Teach the urlparse module about the sftp scheme.

That allows the helpers in this module to operate usefully on sftp URLs. This fix was suggested by Jamesh Henstridge and is said to be used by bzr and other unrelated projects.

Without that, some operations on sftp URLs give obviously wrong results. For example: urlappend('sftp://foo/bar', 'gam') => 'gam'

>>> urlappend('sftp://foo/bar', 'gam')
'sftp://foo/bar/gam'
def _enable_bzr_ssh_in_urlparse():

Teach the urlparse module about the bzr+ssh scheme.

That allows the helpers in this module to operate usefully on bzr+ssh URLs

>>> tuple(urlparse('bzr+ssh://example.com/code/branch'))
('bzr+ssh', 'example.com', '/code/branch', '', '', '')
API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.