ChangeHistory plugin

Keep track of buffer change history.

Plugin Type: Global

ChangeHistory is a global plugin. Only one instance can be opened.

This plugin is used to log any changes to data buffer. For example, a change log would appear here if a new image is added to a mosaic via the Mosaic plugin. Like Contents, the log is sorted by channel, and then by image name.


History should stay no matter what channel or image is active. New history can be added, but old history cannot be deleted, unless the image/channel itself is deleted.

The redo() method picks up an 'add-image-info' event and displays related metadata here. The metadata is obtained as follows:

channel = self.fv.get_channel_info(chname)
iminfo = channel.get_image_info(imname)
timestamp = iminfo.time_modified
description = iminfo.reason_modified  # Optional

Both 'time_modified' and 'reason_modified' have to be explicitly set by the calling plugin in the same method that issues the 'add-image-info' callback, like this:

# This changes the data buffer
image.set_data(new_data, ...)
# Add description for ChangeHistory
info = dict(time_modified=datetime.utcnow(),
            reason_modified='Data has changed')
self.fv.update_image_info(image, info)

It is customizable using ~/.ginga/plugin_ChangeHistory.cfg, where ~ is your HOME directory:

# ChangeHistory plugin preferences file
# Place this in file under ~/.ginga with the name "plugin_ChangeHistory.cfg"

# If set to True, will always expand the tree in ChangeHistory when
# new entries are added
always_expand = True

# If set to True, rows will have alternate colors
color_alternate_rows = True

# Timestamp column width
ts_colwidth = 250