Skip to content

Commit 766ae41

Browse files
committed
Fix LOCAL_CONFIG_LOC
- Remove unwarranted type hints
1 parent d1555ad commit 766ae41

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/elapi/_names.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
import os
22
from pathlib import Path
3-
from typing import Union
4-
5-
from .path import ProperPath
63

74
# variables with leading underscores here indicate that they are to be overwritten by config.py
85
# In which case, import their counterparts from src/config.py
@@ -18,9 +15,9 @@
1815
# https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
1916

2017
# XDG and other convention variable definitions
21-
ENV_XDG_DATA_HOME: Union[ProperPath, Path, str] = "XDG_DATA_HOME"
22-
ENV_XDG_DOWNLOAD_DIR: Union[ProperPath, Path, str] = "XDG_DOWNLOAD_DIR"
23-
ENV_XDG_CONFIG_HOME: Union[ProperPath, Path, str] = "XDG_CONFIG_HOME"
18+
ENV_XDG_DATA_HOME: str = "XDG_DATA_HOME"
19+
ENV_XDG_DOWNLOAD_DIR: str = "XDG_DOWNLOAD_DIR"
20+
ENV_XDG_CONFIG_HOME: str = "XDG_CONFIG_HOME"
2421
TMP_DIR: Path = Path(f"/var/tmp/{APP_NAME}")
2522

2623
# Fallback definitions
@@ -31,8 +28,8 @@
3128
# Configuration path definitions
3229
SYSTEM_CONFIG_LOC: Path = Path("/etc") / CONFIG_FILE_NAME
3330
LOCAL_CONFIG_LOC: Path = (
34-
os.getenv(ENV_XDG_CONFIG_HOME) or FALLBACK_CONFIG_DIR
35-
) / CONFIG_FILE_NAME
31+
Path(os.getenv(ENV_XDG_CONFIG_HOME, FALLBACK_CONFIG_DIR)) / CONFIG_FILE_NAME
32+
)
3633
# In case, $XDG_CONFIG_HOME isn't defined in the machine, it falls back to $HOME/.config/elapi.yml
3734
PROJECT_CONFIG_LOC: Path = cur_dir / CONFIG_FILE_NAME
3835

0 commit comments

Comments
 (0)