qgispluginci.utils module

qgispluginci.utils.configure_file(source_file: str, dest_file: str, replace: dict)
qgispluginci.utils.convert_octets(octets: int) str

Convert a mount of octets in readable size.

Parameters:

octets (int) – mount of octets to convert

Example:

>>> convert_octets(1024)
"1ko"
qgispluginci.utils.parse_tag(version_tag: str) VersionNote | None

Parse a tag and determine the semantic version.

qgispluginci.utils.replace_in_file(file_path: str, pattern: str, new: str, encoding: str = 'utf8')
qgispluginci.utils.resolve_plugin_resource_url(raw_base_url: str | None, release_tag: str | None, plugin_path: str | None, plugin_resource: str | None) str | None

Resolve absolute resource (typically the icon) URL using different parameters.

Args:

raw_base_url (str | None): raw repository base URL. release_tag (str | None): git tag to be released. plugin_path (str | None): directory of the source code in the repository. plugin_resource (str | None): relative path to the plugin’s resource starting

from plugin_path.

Returns:

str | None: absolute URL to plugin’s resource

qgispluginci.utils.set_datetime_zoneinfo(input_datetime: date | datetime, config_timezone: str = 'UTC') datetime

Apply timezone to a naive datetime or date.

Args:

input_datetime (date | datetime): offset-naive datetime config_timezone (str, optional): name of timezone as registered in IANA

database. Defaults to “UTC”. Example : Europe/Paris.

Returns:

datetime: offset-aware datetime

qgispluginci.utils.touch_file(path: str, update_time: bool = False, create_dir: bool = True)