Source code for tagit.controller.sidebox.tags_cursor

"""

Part of the tagit module.
A copy of the license is provided with the project.
Author: Matthias Baumgartner, 2016

"""
# IMPORTS

# INNER-MODULE IMPORTS
from ..controller import DataController

# EXPORTS
__all__ = ('CSidebox_Tags_Cursor', )

## CODE ##
[docs]class CSidebox_Tags_Cursor(DataController): """List tags of the image under the cursor. """ def __init__(self, widget, model, settings, parent=None): super(CSidebox_Tags_Cursor, self).__init__(widget, model, settings, parent) self.parent.bind(on_cursor=self.update) def __del__(self): self.parent.unbind(on_cursor=self.update)
[docs] def update(self, browser, cursor): """Update the sidebox widget.""" tags = self.model.tags.get(cursor) tags = map(lambda s: s.title(), tags) # nice display self.widget.update(tags) ## EOF ##