drag and drop for windows

This commit is contained in:
2021-11-03 13:04:29 +01:00
parent bbbd656f7f
commit 9c15527dfc
2 changed files with 4 additions and 1 deletions

View File

@@ -1,9 +1,12 @@
import os
from urllib.parse import urlparse
import sys
def url_to_path(url: str) -> str:
p = urlparse(url)
if sys.platform == 'win32' or sys.platform == 'cygwin':
return os.path.abspath(p.path[1:])
return os.path.abspath(os.path.join(p.netloc, p.path))