Description
While working with the api for some plugins I noticed some missing functionality:
-
api.mark
: Additionally, it should expose:api.mark.is_marked(name: str)
to check if a image is marked. Currently this required accessing the privateapi.mark._marked
list.api.mark.mark2(name: str)
which marks the image no matter is it is already marked or not. Currently this required checking if the image is already marked and useapi.mark.mark
only when it is not.api.mark.unmark(name: str)
which unmarks the image no matter if it is marked or not. This and the previous functionality could also be added toapi.mark.mark
using certain flags.- Since when marking multiple images, the
api.mark._markdone
signal has to be emitted manually it may be a good idea to provide the above mentioned functionality also for a list of paths. Currently one has to add/remove all images to/fromapi.mark._marked
and then manually emit the signal.
-
imutils.exif.ExifHandler
: We should add something likeapi.get_exifhander(path: str) -> ExifHandler
which returns the exif handler for a certain path. Currently this is done usingimutils.exif.ExifHandler(path)
.
Besides that, one has to use utils.log.module_logger
to get a logger, and to access the vimiv colors one has to use config.styles
. For the status bar module I have also come across using utils.wrap_style_span
.
I am not sure where we have to draw the line between what to expose to the API and what is acceptable to access directly. 😊 I think my first two points would be acceptable to add. But let me know what you think.