genvid.toolbox.DefaultInstallationFolder¶
-
class
genvid.toolbox.
DefaultInstallationFolder
¶ Bases:
object
Abstract class to manage the installation folder.
New in version 1.41.0.
-
RE_VERSION_MATCH
= re.compile('(?P<version>(\\d+).(\\d+).(\\d+).(\\d+))')¶ A compiled regular expression that match a valid Genvid MILE SDK version number.
-
FOLDER_GUARD_FILENAME
= None¶ Name of the guard file that must be present in a valid installation folder.
-
get_default_installation
() → str¶ Returns the default installation registered.
-
set_default_installation
(installpath: pathlib.Path)¶ Set the default installation registered.
Parameters: installpath – The new folder path to set. No validation is done on the path.
-
get_version
(folder: pathlib.Path) → str¶ Return the version of the installation pointed to by
folder
.Parameters: folder – The folder to check for the installed version.
Raises: - FileNotFoundError – Raises if the
FOLDER_GUARD_FILENAME
is not found under the folder. - RuntimeError – Raises the guard file doesn’t contain a valid version number.
Returns: The installed version.
See also
- FileNotFoundError – Raises if the
-
list_registered_installations
() → typing.Iterable[typing.Tuple[str, str]]¶ Returns all registered Genvid MILE SDK installations.
Returns: An iterable of tuple of the name of the Genvid MILE SDK and its installation folder.
-
search_for_guardfile
(start_dir: pathlib.Path, *, guardfile: typing.Optional[str] = None) → typing.Optional[str]¶ Lookup for a guard file in
start_dir
or its parents.Parameters: - start_dir – The folder to lookup.
- guardfile – The guard file to find. If None, use
FOLDER_GUARD_FILENAME
-
create_guard_file
(rootdir: pathlib.Path, version: str, *, overwrite: bool = True)¶ Create a guard file in the folder, with the specific version.
Raises: FileExistsError – unless overwrite is true.
-
-
class
sdk_folder.
DefaultInstallationFolder
¶ Implementation of
genvid.toolbox.DefaultInstallationFolder
.