Merge remote-tracking branch 'origin/pr/3291'
This commit is contained in:
commit
b3085f5d60
@ -64,6 +64,7 @@ def path_up(url, count):
|
|||||||
raise Error("Can't go up!")
|
raise Error("Can't go up!")
|
||||||
for _i in range(0, min(count, path.count('/'))):
|
for _i in range(0, min(count, path.count('/'))):
|
||||||
path = posixpath.join(path, posixpath.pardir)
|
path = posixpath.join(path, posixpath.pardir)
|
||||||
|
path = posixpath.normpath(path)
|
||||||
url.setPath(path)
|
url.setPath(path)
|
||||||
return url
|
return url
|
||||||
|
|
||||||
|
@ -135,6 +135,11 @@ def data_for_url(url):
|
|||||||
Return:
|
Return:
|
||||||
A (mimetype, data) tuple.
|
A (mimetype, data) tuple.
|
||||||
"""
|
"""
|
||||||
|
norm_url = url.adjusted(QUrl.NormalizePathSegments |
|
||||||
|
QUrl.StripTrailingSlash)
|
||||||
|
if norm_url != url:
|
||||||
|
raise Redirect(norm_url)
|
||||||
|
|
||||||
path = url.path()
|
path = url.path()
|
||||||
host = url.host()
|
host = url.host()
|
||||||
query = urlutils.query_string(url)
|
query = urlutils.query_string(url)
|
||||||
@ -331,9 +336,13 @@ def qute_help(url):
|
|||||||
|
|
||||||
path = 'html/doc/{}'.format(urlpath)
|
path = 'html/doc/{}'.format(urlpath)
|
||||||
if not urlpath.endswith('.html'):
|
if not urlpath.endswith('.html'):
|
||||||
|
try:
|
||||||
|
bdata = utils.read_file(path, binary=True)
|
||||||
|
except OSError as e:
|
||||||
|
raise QuteSchemeOSError(e)
|
||||||
mimetype, _encoding = mimetypes.guess_type(urlpath)
|
mimetype, _encoding = mimetypes.guess_type(urlpath)
|
||||||
assert mimetype is not None, url
|
assert mimetype is not None, url
|
||||||
return mimetype, utils.read_file(path, binary=True)
|
return mimetype, bdata
|
||||||
|
|
||||||
try:
|
try:
|
||||||
data = utils.read_file(path)
|
data = utils.read_file(path)
|
||||||
|
@ -18,6 +18,11 @@ Feature: Using :navigate
|
|||||||
And I run :navigate up with count 2
|
And I run :navigate up with count 2
|
||||||
Then data/navigate should be loaded
|
Then data/navigate should be loaded
|
||||||
|
|
||||||
|
Scenario: Navigating up in qute://help/
|
||||||
|
When I open qute://help/commands.html
|
||||||
|
And I run :navigate up
|
||||||
|
Then qute://help/ should be loaded
|
||||||
|
|
||||||
# prev/next
|
# prev/next
|
||||||
|
|
||||||
Scenario: Navigating to previous page
|
Scenario: Navigating to previous page
|
||||||
|
@ -63,6 +63,22 @@ Feature: Special qute:// pages
|
|||||||
And I hint with args "links normal" and follow a
|
And I hint with args "links normal" and follow a
|
||||||
Then qute://help/quickstart.html should be loaded
|
Then qute://help/quickstart.html should be loaded
|
||||||
|
|
||||||
|
Scenario: Opening a link with qute://help/index.html/..
|
||||||
|
When the documentation is up to date
|
||||||
|
And I open qute://help/index.html/.. without waiting
|
||||||
|
Then qute://help/ should be loaded
|
||||||
|
|
||||||
|
Scenario: Opening a link with qute://help/index.html/../
|
||||||
|
When the documentation is up to date
|
||||||
|
And I open qute://help/index.html/../ without waiting
|
||||||
|
Then qute://help/ should be loaded
|
||||||
|
|
||||||
|
Scenario: Opening a link with qute://help/img/
|
||||||
|
When the documentation is up to date
|
||||||
|
And I open qute://help/img/ without waiting
|
||||||
|
Then "OSError while handling qute://* URL" should be logged
|
||||||
|
And "* url='qute://help/img'* LoadStatus.error" should be logged
|
||||||
|
|
||||||
# :history
|
# :history
|
||||||
|
|
||||||
Scenario: :history without arguments
|
Scenario: :history without arguments
|
||||||
|
Loading…
Reference in New Issue
Block a user