Core Utils

HAL Core Utility functions.

hal_py.CoreUtils.get_base_directory() os.PathLike

Get the base path to the HAL installation. 1. Use Environment Variable HAL_BASE_PATH 2. If current executable is hal (not e.g. python3 interpreter) use it’s path to determine base path. 3. Try to find hal executable in path and use its base path.

Returns

The path.

Return type

pathlib.Path

hal_py.CoreUtils.get_binary_directory() os.PathLike

Get the path to the executable of HAL.

Returns

The path.

Return type

pathlib.Path

hal_py.CoreUtils.get_default_log_directory(source_file: os.PathLike = '') os.PathLike

Get the path to the default directory for log files. If an hdl source file is provided, the function returns the parent directory, otherwise get_user_share_directory() / “log”.

Parameters

source_file (pathlib.Path) – The hdl source file.

Returns

The path.

Return type

pathlib.Path

hal_py.CoreUtils.get_gate_library_directories() List[os.PathLike]

Get the paths where gate libraries are searched. Contains the share and user share directories.

Returns

A list of paths.

Return type

list[pathlib.Path]

hal_py.CoreUtils.get_library_directory() os.PathLike

Get the path to the shared and static libraries of HAL. Relative to the binary directory.

Returns

The path.

Return type

pathlib.Path

hal_py.CoreUtils.get_plugin_directories() List[os.PathLike]

Get the paths where plugins are searched. Contains the library and user share directories.

Returns

A vector of paths.

hal_py.CoreUtils.get_share_directory() os.PathLike

Get the path to the sh Relative to the binary

Returns

The path.

Return type

pathlib.Path

hal_py.CoreUtils.get_user_config_directory() os.PathLike

Get the path to the configuration directory of the user. home/.config/hal for Unix

Returns

The path.

Return type

pathlib.Path

hal_py.CoreUtils.get_user_share_directory() os.PathLike

Get the path to shared objects and files provided by the user. home/.local/share for Unix

Returns

The path.

Return type

pathlib.Path