exegol.utils package

Submodules

exegol.utils.ConstantConfig module

class exegol.utils.ConstantConfig.ConstantConfig

Bases: object

Constant parameters information

DOCKER_REGISTRY: str = 'hub.docker.com'
EXEGOL_RESOURCES_REPO: str = 'https://github.com/ShutdownRepo/Exegol-resources.git'
IMAGE_NAME: str = 'nwodtuhs/exegol'
build_context_path: str = '/home/docs/checkouts/readthedocs.org/user_builds/exegol-devtest/checkouts/latest/exegol-docker-build'
build_context_path_obj: pathlib.Path = PosixPath('/home/docs/checkouts/readthedocs.org/user_builds/exegol-devtest/checkouts/latest/exegol-docker-build')
classmethod findBuildContextPath() pathlib.Path

Find the right path to the build context from Exegol docker images. Support source clone installation and pip package (venv / user / global context)

src_root_path_obj: pathlib.Path = PosixPath('/home/docs/checkouts/readthedocs.org/user_builds/exegol-devtest/checkouts/latest')
version: str = '4.0.0b3'

exegol.utils.DockerUtils module

exegol.utils.EnvInfo module

class exegol.utils.EnvInfo.EnvInfo

Bases: object

Contain information about the environment (host, OS, platform, etc)

current_platform: str = 'Linux'
classmethod getDockerEngine() str

Return Docker engine type. Can be ‘Kernel’, ‘wsl2’ or ‘hyper-v’

classmethod getHostOs() str

Return Host OS Can be ‘Windows’ or ‘Unix’

classmethod initData(docker_info)

Initialize information from Docker daemon data

classmethod isWindowsHost() bool
is_linux_shell: bool = True
is_windows_shell: bool = False
windows_release: str = ''

exegol.utils.ExeLog module

class exegol.utils.ExeLog.ExeLog(name, level=0)

Bases: logging.Logger

Project’s Logger custom class

ADVANCED: int = 13
SUCCESS: int = 25
VERBOSE: int = 15
advanced(msg: Any, *args: Any, **kwargs: Any) None

Add advanced logging method with text format / rich color support

critical(msg: Any, *args: Any, **kwargs: Any) None

Change default critical text format with rich color support Add auto exit.

debug(msg: Any, *args: Any, **kwargs: Any) None

Change default debug text format with rich color support

empty_line() None

Print an empty line.

error(msg: Any, *args: Any, **kwargs: Any) None

Change default error text format with rich color support

exception(msg: Any, *args: Any, **kwargs: Any) None

Change default exception text format with rich color support

info(msg: Any, *args: Any, **kwargs: Any) None

Change default info text format with rich color support

raw(msg: Any, level=15, markup=False, highlight=False, emoji=False, rich_parsing=False) None

Add raw text logging, used for stream printing.

static setVerbosity(verbose: int, quiet: bool = False)

Set logging level accordingly to the verbose count or with quiet enable.

success(msg: Any, *args: Any, **kwargs: Any) None

Add success logging method with text format / rich color support

verbose(msg: Any, *args: Any, **kwargs: Any) None

Add verbose logging method with text format / rich color support

warning(msg: Any, *args: Any, **kwargs: Any) None

Change default warning text format with rich color support

exegol.utils.FsUtils module

exegol.utils.FsUtils.parseDockerVolumePath(source: str) pathlib.PurePath

Parse docker volume path to find the corresponding host path.

exegol.utils.FsUtils.resolvPath(path: pathlib.Path) str

Resolv a filesystem path depending on the environment. On WSL, Windows PATH can be resolved using ‘wslpath’.

exegol.utils.FsUtils.resolvStrPath(path: Optional[str]) str

Try to resolv a filesystem path from a string.

exegol.utils.GitUtils module

class exegol.utils.GitUtils.GitUtils(path: Optional[pathlib.Path] = None, name: str = 'wrapper', subject: str = 'source code', skip_submodule_update: bool = False)

Bases: object

Utility class between exegol and the Git SDK

checkout(branch: str) bool

Change local git branch

clone(repo_url: str, optimize_disk_space: bool = True) bool
classmethod formatStderr(stderr)
getCurrentBranch() Optional[str]

Get current git branch name

getName() str

Git name getter

getSubject() str

Git subject getter

getTextStatus() str

Get text status from git object for rich print.

isSubModule() bool

Git submodule status getter

isUpToDate(branch: Optional[str] = None) bool

Check if the local git repository is up-to-date. This method compare the last commit local and the ancestor.

listBranch() List[str]

Return a list of str of all remote git branch available

safeCheck() bool

Check the status of the local git repository, if there is pending change it is not safe to apply some operations

submoduleSourceUpdate(name: str) bool

Update source code from the ‘name’ git submodule

update() bool

Update local git repository within current branch

exegol.utils.GuiUtils module

class exegol.utils.GuiUtils.GuiUtils

Bases: object

This utility class allows determining if the current system supports the GUI from the information of the system.

classmethod getDisplayEnv() str

Get the current DISPLAY env to access X11 socket :return:

classmethod getX11SocketPath() str

Get the host path of the X11 socket :return:

classmethod isGuiAvailable() bool

Check if the host OS can support GUI application with X11 sharing :return: bool

exegol.utils.MetaSingleton module

class exegol.utils.MetaSingleton.MetaSingleton

Bases: type

Metaclass to create a singleton class

exegol.utils.UserConfig module

class exegol.utils.UserConfig.UserConfig(*args, **kwargs)

Bases: object

This class allows loading user defined configurations

get_configs() List[str]

User configs getter each options

exegol.utils.argParse module

class exegol.utils.argParse.ExegolArgParse(prog=None, usage=None, description=None, epilog=None, parents=[], formatter_class=<class 'argparse.HelpFormatter'>, prefix_chars='-', fromfile_prefix_chars=None, argument_default=None, conflict_handler='error', add_help=True, allow_abbrev=True)

Bases: argparse.ArgumentParser

Overloading of the main parsing (argparse.ArgumentParser) class

class exegol.utils.argParse.Parser(actions: List[exegol.console.cli.actions.Command.Command])

Bases: object

Custom Exegol CLI Parser. Main controller of argument building and parsing.

print_help()

Force argparse to display the help message

run_parser() argparse.Namespace

Execute argparse to retrieve user options from argv

Module contents