google/anvil-build — pull request #11 by Husafan (2014-12-29 06:34:33+00:00)
Title: Add WorkUnit and LogSource Classes

Add a WorkUnit class to track the progress of a given task. A WorkUnit keeps track of complete vs. total units of work. A simple parent-child structure is defined to allow aggregation of WorkUnit information. WorkUnits can also be used to store exceptions that occur during the execution of work. Changes to WorkUnits can be observed by listeners that must implement #should_listen and #update methods to receive updates about a given WorkUnit.

Add a LogSource class. LogSources allow ad-hoc logging of information as message tuples that contain the DebugLevel of the log message, the time at which it occurred, a possible name of the component that generated the message and the message itself.

Add a WorkUnitLogSource that provides an implementation of LogSource capable of listening for and logging changes that occur to a WorkUnit.

Add a very basic LogSink class that prints LogSource messages to the console.

Add a setup.py dependency on the Blessings package. This package provides terminal manipulation functionality and will be used to develop a more in-depth TerminalLogSink that uses cursor positioning and color.