Skip to content

Commit

Permalink
Merge pull request #10 from cjmayo/save_project
Browse files Browse the repository at this point in the history
Fix saving project checking a local file
  • Loading branch information
cjmayo authored Apr 4, 2023
2 parents f9ca9a7 + c927371 commit 3f6dc2f
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions linkcheck_gui/projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,19 +99,18 @@ def url_split(url):
hostname is always lowercased.
Precondition: url is syntactically correct URI (eg has no whitespace)
"""
scheme, netloc = urllib.parse.splittype(url)
host, document = urllib.parse.splithost(netloc)
port = default_ports.get(scheme, 0)
if host:
o = urllib.parse.urlparse(url)
port = default_ports.get(o.scheme, 0)
if host := o.netloc:
host = host.lower()
host, port = splitport(host, port=port)
return scheme, host, port, document
return o.scheme, host, port, o.path


def url_to_filename(url, extension):
# filter host and document
parts = url_split(url)
value = parts[1] + parts[3]
value = f"{'' if parts[1] is None else parts[1]}{parts[3]}"
# normalize
import unicodedata

Expand Down

0 comments on commit 3f6dc2f

Please sign in to comment.