Skip to content

Commit

Permalink
feat(about): add path checker
Browse files Browse the repository at this point in the history
  • Loading branch information
entelecheia committed Jul 20, 2023
1 parent e0e93b1 commit 552d1f0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/hyfi/about/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
It also defines the model_config attribute, which is a ConfigDict that allows
extra configuration options to be added to the AboutConfig instance.
"""
import os

from pydantic import BaseModel, ConfigDict

from hyfi.utils.logging import LOGGING
Expand Down Expand Up @@ -74,5 +76,10 @@ def config_path(self) -> str:

@property
def user_config_path(self) -> str:
"""Returns the path to the user configuration module."""
"""Returns the path to the user configuration directory."""
# if user_config_path is not an absolute path, make it absolute
if not os.path.isabs(self.__user_config_path__):
self.__user_config_path__ = os.path.join(
os.getcwd(), self.__user_config_path__
)
return self.__user_config_path__

0 comments on commit 552d1f0

Please sign in to comment.