Detect local files correctly
This commit is contained in:
parent
4a7ccbf131
commit
077d3be2e0
@ -18,6 +18,7 @@
|
|||||||
"""Utils regarding URL handling."""
|
"""Utils regarding URL handling."""
|
||||||
|
|
||||||
import re
|
import re
|
||||||
|
import os.path
|
||||||
import logging
|
import logging
|
||||||
import urllib.parse
|
import urllib.parse
|
||||||
|
|
||||||
@ -193,6 +194,9 @@ def is_url(url):
|
|||||||
# Special URLs are always URLs, even with autosearch=False
|
# Special URLs are always URLs, even with autosearch=False
|
||||||
logging.debug("Is an special URL.")
|
logging.debug("Is an special URL.")
|
||||||
return True
|
return True
|
||||||
|
elif os.path.exists(url):
|
||||||
|
# local file
|
||||||
|
return True
|
||||||
elif autosearch == 'dns':
|
elif autosearch == 'dns':
|
||||||
logging.debug("Checking via DNS")
|
logging.debug("Checking via DNS")
|
||||||
return _is_url_dns(QUrl.fromUserInput(urlstr))
|
return _is_url_dns(QUrl.fromUserInput(urlstr))
|
||||||
|
Loading…
Reference in New Issue
Block a user