support Windows file share locations in drag&drop

This commit is contained in:
2022-08-26 14:09:34 +02:00
parent 5e81d90c1f
commit 1ddd589cc2

View File

@@ -11,9 +11,12 @@ def urls_to_path(urls: str) -> [str]:
result.append(path)
return result
def url_to_path(url: str) -> str:
p = urlparse(url)
if sys.platform == 'win32' or sys.platform == 'cygwin':
if p.netloc:
return f"//{p.netloc}{p.path}"
return os.path.abspath(p.path[1:])
return os.path.abspath(os.path.join(p.netloc, p.path))