diff --git a/utils/mkhtml.py b/utils/mkhtml.py index 0e17278334..49af9ceb74 100644 --- a/utils/mkhtml.py +++ b/utils/mkhtml.py @@ -23,15 +23,12 @@ import re from datetime import datetime import locale -import json -import pathlib import subprocess from pathlib import Path from html.parser import HTMLParser from urllib import request as urlrequest -from urllib.error import HTTPError, URLError import urllib.parse as urlparse try: @@ -365,7 +362,7 @@ def get_addon_path(): """ addons_base_dir = os.getenv("GRASS_ADDON_BASE") if addons_base_dir and major: - grass_addons_dir = pathlib.Path(addons_base_dir) / "grass-addons" + grass_addons_dir = Path(addons_base_dir) / "grass-addons" if gs: call = gs.call popen = gs.Popen @@ -378,8 +375,8 @@ def get_addon_path(): major_version=major, addons_git_repo_url=urlparse.urljoin(base_url, "grass-addons/"), ) - if not pathlib.Path(addons_base_dir).exists(): - pathlib.Path(addons_base_dir).mkdir(parents=True, exist_ok=True) + if not Path(addons_base_dir).exists(): + Path(addons_base_dir).mkdir(parents=True, exist_ok=True) if not grass_addons_dir.exists(): call( [ @@ -427,7 +424,7 @@ def get_addon_path(): gs.decode(addons_file_list) if gs else addons_file_list.decode(), ) for addon_path in addon_paths: - if pgm == pathlib.Path(addon_path).name: + if pgm == Path(addon_path).name: return addon_path