Skip to content

Commit

Permalink
apply ruff suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
landam committed Oct 24, 2024
1 parent 00ade4d commit 2a7434e
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions utils/mkhtml.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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(
[
Expand Down Expand Up @@ -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


Expand Down

0 comments on commit 2a7434e

Please sign in to comment.