benchbuild.utils.path module

Path utilities for benchbuild.

benchbuild.utils.path.determine_path()[source]

Borrowed from wxglade.py

benchbuild.utils.path.list_to_path(pathlist)[source]

Convert a list of path elements to a path string.

benchbuild.utils.path.mkdir_interactive(dirpath)[source]

Create a directory if required.

This will query the user for a confirmation.

Parameters:dirname – The path to create.
benchbuild.utils.path.mkdir_uchroot(dirpath, root='.')[source]

Create a file inside a uchroot env.

You will want to use this when you need to create a file with apropriate rights inside a uchroot container with subuid/subgid handling enabled.

Parameters:
  • dirpath – The dirpath that should be created. Absolute inside the uchroot container.
  • root – The root PATH of the container filesystem as seen outside of the container.
benchbuild.utils.path.mkfile_uchroot(filepath, root='.')[source]

Create a file inside a uchroot env.

You will want to use this when you need to create a file with apropriate rights inside a uchroot container with subuid/subgid handling enabled.

Parameters:
  • filepath – The filepath that should be created. Absolute inside the uchroot container.
  • root – The root PATH of the container filesystem as seen outside of the container.
benchbuild.utils.path.path_to_list(pathstr)[source]

Conver a path string to a list of path elements.

benchbuild.utils.path.template_files(path, exts=None)[source]

Return a list of filenames found at @path.

The list of filenames can be filtered by extensions.

Parameters:
  • path – Existing filepath we want to list.
  • exts – List of extensions to filter by.
Returns:

A list of filenames found in the path.

benchbuild.utils.path.template_path(template)[source]

Return path to template file.

benchbuild.utils.path.template_str(template)[source]

Read a template file from the resources and return it as str.