bgdev.tools.renamer.utils

Utils function for the renamer.

author

Benoit GIELLY <benoit.gielly@gmail.com>

UNDO(func, *, undo=True)

Decorate a method to make it undoable.

check_image(icon, normalized=False, as_icon=False)[source]

Convert the given image path to full path name.

Parameters
  • icon (str) – Name of the icon to check

  • normalized (bool) – Normalize the path to slash forward (works on all OS)

  • as_icon (bool) – Return a QIcon of the found image file.

Returns

Updated icon path so it’s ready to be used.

Return type

str

method_decorator(func, undo=False)[source]

Decorate a method to make it undoable.