Skip to content

Add Functionality to API #323

Open
Open
@jcjgraf

Description

@jcjgraf

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 private api.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 use api.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 to api.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/from api.mark._marked and then manually emit the signal.
  • imutils.exif.ExifHandler: We should add something like api.get_exifhander(path: str) -> ExifHandler which returns the exif handler for a certain path. Currently this is done using imutils.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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions