qrunch.common.register_license

Contains functionality for registering the path to a license file.

Functions

register_license_file(file_path, *[, overwrite])

Register a path to a license file.

Classes

LicenseFileRegistry

Class for holder a registered path to a license file.

class LicenseFileRegistry

Bases: object

Class for holder a registered path to a license file.

static __new__(cls) LicenseFileRegistry

Create the class, if it does not already exist.

Return type:

LicenseFileRegistry

get_default_paths() list[Path]

Get the default license file path, which is a file called ‘license.txt’ in the current working directory.

Return type:

list[Path]

get_registered_path() Path | None

Get the path to the license file.

Return type:

Path | None

register_license_file(file_path: Path | str, *, overwrite: bool = False) None

Register a path to a license file.

Parameters:
  • file_path (Path | str) – The path to the license file.

  • overwrite (bool) – Whether to overwrite an existing license file in the user config directory. Defaults to False.

Return type:

None

register_license_file(file_path: Path | str, *, overwrite: bool = False) None

Register a path to a license file.

Parameters:
  • file_path (Path | str) – The path to the license file.

  • overwrite (bool) – Whether to overwrite an existing license file. Defaults to False.

Return type:

None