Command code reorg

Move the command plugins to a subpackage of
smiley and update the import references.

Change the namespace for the commands, in case
there are other types of plugins to load in the
future.

Signed-off-by: Doug Hellmann <doug.hellmann@gmail.com>
Better JSON encoding

Encode the details of a traceback so they can be reviewed on the
other side.  Update monitor app to show the traceback details.

For non-builtin classes, encode the attributes as a dictionary with
the class information.

Signed-off-by: Doug Hellmann <doug.hellmann@gmail.com>
Improve local variable output format

Use a table and pprint to show the local variables from the monitor
command.

Signed-off-by: Doug Hellmann <doug.hellmann@gmail.com>
Ignore "future" variables

Ignore things imported from the __future__ module
when reporting local variables for module-level
statements such as imports.

Signed-off-by: Doug Hellmann <doug.hellmann@gmail.com>
test and style fixes

Signed-off-by: Doug Hellmann <doug.hellmann@gmail.com>
Refactor output logic for reuse

Move the logic for printing stuff based on the events
out of the monitor command so it can be reused in the
report command.

Change "locals" to "local_vars" to be consistent and
avoid clashing with the builtin locals().

Signed-off-by: Doug Hellmann <doug.hellmann@gmail.com>
Define EventProcessor base class

Define a base class that specifies the API for
classes that are involved in the event processing.

Signed-off-by: Doug Hellmann <doug.hellmann@gmail.com>
Pass line source to output formatter

Instead of assuming that we can use the linecache
module to get source lines for files, pass an arg
to the formatter.

Signed-off-by: Doug Hellmann <doug.hellmann@gmail.com>
Misc refactoring of output formatting code

Signed-off-by: Doug Hellmann <doug.hellmann@gmail.com>
make sure exception arguments are sent

Signed-off-by: Doug Hellmann <doug.hellmann@gmail.com>
exceptions reported as warnings

Signed-off-by: Doug Hellmann <doug.hellmann@gmail.com>
Add list command

Signed-off-by: Doug Hellmann <doug.hellmann@gmail.com>
Add replay command and update list command

Make list show the timestamps in ISO format.

Change database recording of run to jsonify the description,
which is usually a list of command line args.

Add DB methods for querying data written to the database.

Add replay method for retrieving a given run and printing
it in the same format as the monitor command.

Signed-off-by: Doug Hellmann <doug.hellmann@gmail.com>
fix argument name in tracer

Signed-off-by: Doug Hellmann <doug.hellmann@gmail.com>
add --errors option to list command

Signed-off-by: Doug Hellmann <doug.hellmann@gmail.com>
Clean up db code

Move a few functions around to keep the inserts near
the selects.

Signed-off-by: Doug Hellmann <doug.hellmann@gmail.com>
add file caching to db api

Signed-off-by: Doug Hellmann <doug.hellmann@gmail.com>
Cache source files in the database

As the events come in, cache the source files in
the database so when we go to review the file later
we have the version of the source from the time
of execution.

Signed-off-by: Doug Hellmann <doug.hellmann@gmail.com>
Have replay get source lines from database

Have the replay command load the source lines
from the database, in case they have changed
between runs.

Signed-off-by: Doug Hellmann <doug.hellmann@gmail.com>