Core Utils

HAL Core Utility functions.

hal_py.core_utils.get_base_directory() → hal_py.hal_path

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:hal_py.hal_path
hal_py.core_utils.get_binary_directory() → hal_py.hal_path

Get the path to the executable of HAL.

Returns:The path.
Return type:hal_py.hal_path
hal_py.core_utils.get_default_log_directory(source_file: hal_py.hal_path='') → hal_py.hal_path

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 (hal_py.hal_path) – The hdl source file.
Returns:The path.
Return type:hal_py.hal_path
hal_py.core_utils.get_gate_library_directories() → List[hal_py.hal_path]

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

Returns:A list of paths.
Return type:list(hal_py.hal_path)
hal_py.core_utils.get_library_directory() → hal_py.hal_path

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

Returns:The path.
Return type:hal_py.hal_path
hal_py.core_utils.get_plugin_directories() → List[hal_py.hal_path]

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

Returns:A vector of paths.
hal_py.core_utils.get_share_directory() → hal_py.hal_path

Get the path to the sh Relative to the binary

Returns:The path.
Return type:hal_py.hal_path
hal_py.core_utils.get_user_config_directory() → hal_py.hal_path

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

Returns:The path.
Return type:hal_py.hal_path
hal_py.core_utils.get_user_share_directory() → hal_py.hal_path

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

Returns:The path.
Return type:hal_py.hal_path