made DRY, improved error reporting

Common functionality was moved to a separate method on the PyExecDirective
that method is now inherited and used by FormDirective and ViewDirective

If an exception occurs, a message is now printed to stdout during the sphinx build process