Provide API compatible with the other xdg
Hi,
We have this unfortunate situation when there are two packages providing similar functionality in different ways while sharing filesystem paths, the other being one by Scott Stevenson.
To make the life easier for both users and distributions, how about extending __init__.py
to provide their API as well?
E.g. something like:
from pathlib import Path
from typing import Optional
from . import BaseDirectory
XDG_CACHE_HOME = Path(BaseDirectory.xdg_cache_home)
XDG_CONFIG_DIRS = [Path(path) for path in BaseDirectory.xdg_config_dirs]
XDG_CONFIG_HOME = Path(BaseDirectory.xdg_config_home)
XDG_DATA_DIRS = [Path(path) for path in BaseDirectory.xdg_data_dirs]
XDG_DATA_HOME = Path(BaseDirectory.xdg_data_home)
try:
XDG_RUNTIME_DIR: Optional[Path] = Path(BaseDirectory.get_runtime_dir(strict=True))
except KeyError:
XDG_RUNTIME_DIR = None
(possibly with an appropriate update to __all__
?)