Misc#

ignis.utils.Utils.download_image(url: str, path: str, **kwargs) int#

Download an image from the given URL.

Parameters:
  • url (str) -- The URL of the image.

  • path (str) -- The path where the image will be saved.

kwargs will be passed to the requests.get() method.

Return type:

int

Returns:

The response status code (200 if success).

ignis.utils.Utils.get_current_dir() str#

Returns the directory of the Python file where this function is called.

Return type:

str

ignis.utils.Utils.load_interface_xml(interface_name: str | None = None, path: str | None = None, xml: str | None = None) gi.repository.Gio.DBusInterfaceInfo#

Load interface info from XML. If you want to load interface info from the path or XML string, you need to provide path and xml as keyword arguments respectively.

Parameters:
  • interface_name (str | None, default: None) -- The name of the interface. The interface must be stored in the ignis/dbus/ directory in the Ignis sources.

  • path (str | None, default: None) -- The full path to the interface XML.

  • xml (str | None, default: None) -- The XML string.

Raises:

TypeError -- If neither of the arguments is provided.

Return type:

DBusInterfaceInfo

Returns:

The interface information.