ChangeHistoryΒΆ

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.

Usage

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 a 'modified' 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

While 'time_modified' is automatically added by Ginga, 'reason_modified' is optional and has be to explicitly set by the calling plugin in the same method that issues the 'modified' callback, like this:

# This issues the 'modified' callback and sets the timestamp
image.set_data(new_data, ...)
# Manually add the description
chname = self.fv.get_channel_name(self.fitsimage)
channel = self.fv.get_channel_info(chname)
iminfo = channel.get_image_info(image.get('name'))
iminfo.reason_modified = 'Something was done to this image buffer'

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