"""
__author__ = "Oleg Broytman <phd@phdru.name>"
-__copyright__ = "Copyright (C) 2000-2023 PhiloSoft Design"
+__copyright__ = "Copyright (C) 2000-2024 PhiloSoft Design"
__license__ = "GNU GPL"
__all__ = ['Folder', 'Bookmark', 'Ruler', 'Walker', 'Writer', 'Robot',
]
-from urllib.parse import urlsplit, quote
+from urllib.parse import unquote
import os
BKMK_FORMAT = os.environ.get("BKMK_FORMAT", "MOZILLA")
def __init__(self, href, add_date, last_visit=None, last_modified=None,
keyword=None, comment='', icon_href=None, icon=None,
charset=None, parser_charset=None):
- split_results = urlsplit(href)
- protocol, netloc, path, query, tag = split_results
- user = split_results.username
- password = split_results.password
- host = split_results.hostname
- port = split_results.port
-
- if protocol == 'place':
- href = protocol + ":"
- else:
- href = protocol + "://"
- if user:
- href += quote(user)
- if password:
- href += ':' + quote(password)
- href += '@'
- if host:
- href += host.encode('idna').decode('ascii')
- if port:
- href += ':%d' % port
- if path:
- href += path
-
self.href = href
self.add_date = add_date
self.last_visit = last_visit
param_list = {}
for param in params:
key, value = param.split('=', 1)
- param_list[key] = value
+ param_list[key] = unquote(value)
return main_param, param_list