diff options
author | Jimmy <jimmy@spalge.com> | 2021-10-03 17:15:27 +1300 |
---|---|---|
committer | Jimmy <jimmy@spalge.com> | 2021-10-03 17:26:51 +1300 |
commit | f4295c6d310b11b1628299fef1cc03134508e9d4 (patch) | |
tree | a8f3956833bbe2372ba27126437c8a9fdf05e201 /qutebrowser | |
parent | d1eecf8b97f14a36850f8a03a2279e1f8f2f6c75 (diff) | |
download | qutebrowser-f4295c6d310b11b1628299fef1cc03134508e9d4.tar.gz qutebrowser-f4295c6d310b11b1628299fef1cc03134508e9d4.zip |
Make `go` work.
Various QUrl methods that take a UrlFormattingOption enum member can also
take ComponentFormattingOption ones but something doesn't know that and throws
a TypeError.
`url.toString(QUrl.UrlFormattingOption.RemovePassword | QUrl.ComponentFormattingOption.FullyEncoded)` works, `url.toString(QUrl.ComponentFormattingOption.FullyEncoded | QUrl.UrlFormattingOption.RemovePassword )` doesn't.
Diffstat (limited to 'qutebrowser')
-rw-r--r-- | qutebrowser/commands/runners.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/qutebrowser/commands/runners.py b/qutebrowser/commands/runners.py index 01a9c7edd..c8da8decc 100644 --- a/qutebrowser/commands/runners.py +++ b/qutebrowser/commands/runners.py @@ -55,9 +55,12 @@ def _init_variable_replacements() -> Mapping[str, _ReplacementFunction]: """Return a dict from variable replacements to fns processing them.""" replacements: Dict[str, _ReplacementFunction] = { 'url': lambda tb: _url(tb).toString( - QUrl.ComponentFormattingOption.FullyEncoded | QUrl.UrlFormattingOption.RemovePassword), + + QUrl.UrlFormattingOption.RemovePassword |QUrl.ComponentFormattingOption.FullyEncoded), 'url:pretty': lambda tb: _url(tb).toString( - QUrl.ComponentFormattingOption.DecodeReserved | QUrl.UrlFormattingOption.RemovePassword), + QUrl.UrlFormattingOption.RemovePassword | + QUrl.ComponentFormattingOption.DecodeReserved + ), 'url:domain': lambda tb: "{}://{}{}".format( _url(tb).scheme(), _url(tb).host(), ":" + str(_url(tb).port()) if _url(tb).port() != -1 else ""), |