Skip to content

Commit

Permalink
fix(core): add user_config_path and config_dirname options
Browse files Browse the repository at this point in the history
  • Loading branch information
entelecheia committed Jul 27, 2023
1 parent 516bdfc commit 94aba6c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/hyfi/core/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ def initialize(
package_path: str = __hyfi_name__,
version: str = __hyfi_version__(),
plugins: Optional[List[str]] = None,
user_config_path: Optional[str] = None,
config_dirname: Optional[str] = None,
) -> None:
"""
Initializes the global HyFI instance.
Expand All @@ -82,13 +84,19 @@ def initialize(
package_path: Path to the package root folder. e.g. `./src/hyfi`
version: Version of the package. e.g. `0.1.0`
plugins: A list of plugins to load. e.g. `["hyfi.conf"]`
user_config_path: Path to the user configuration directory. e.g. `./config`
config_dirname: Name of the configuration directory. e.g. `conf`
"""
self.__package_path__ = package_path
self.__version__ = version
if package_path not in self._packages_:
self._packages_.append((package_path, version))
if plugins:
self.__plugins__ = self.get_plugins(plugins)
if user_config_path:
self.__user_config_path__ = user_config_path
if config_dirname:
self.__config_dirname__ = config_dirname

@property
def plugins(self) -> Optional[List[str]]:
Expand Down

0 comments on commit 94aba6c

Please sign in to comment.