support Windows file share locations in drag&drop
This commit is contained in:
@@ -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))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user