Add the debug leaks view to ParaView

The debug leaks view is be shown as a top level widget on application
startup if the environment variable PV_DEBUG_LEAKS_VIEW is set.

pqPythonDebugLeaksView extends the vtkQtDebugLeaksView to add Python
capabilities to the debugger.  You can add references to tracked VTK
objects to the Python console for inspection.

Change-Id: I26918d9a499817ff5c75cef5dba82e5ba1de9ae7
Disable trace observers when tracing python state in cpstate.py

This is the same as the bugfix that was applied to smstate.py in
commit b27145eb9aa

Change-Id: I2e5cd64c1f224cc8b788a02e5f6008c59c0591e5
Make sure the paraview module is always initialized by pqPythonManager

If Python was initialized before the pqPythonManager was constructed then
the paraview module would not be imported as it is supposed to.  This
could happen if a startup plugin initialized Python before the
pqPythonManager is created, which can be the case with Python based
plugins.

Change-Id: I3a79547ce84d19773d95725e7fc1b7c6b99cb64c
Add a call to prompt() during the python shell startup

This prints the ">>>" prompt before printing the status message so that
the user will see:

>>> from paraview.simple import *

Change-Id: I477bf59677400bf2073b9812afe8c7558d2796ef
Don't print a newline when executing a python command in the console.

Printing a newline forced a new prompt to be printed even if the executed
python code did not generate any stdout.  The python console now uses
a flag this->Prompted to determien whether or not displaying the prompt
is required.

Change-Id: I8d28012b8281934961f2d8c78e91102b5f78c9f3
Execute python code in the context of the interactive console.

The function pqPythonShell::executeScript() is used to programmatically
execute python code.  This is used when running python scripts the user
selects with the Run Script button.  These should run in the console
context.

Code executed with vtkPythonInterpreter::RunSimpleString() will run in the
__main__ context which is now different from the ParaView python console.

The "from paraview.simple import *" statement is only executed in the
ParaView python console.

Change-Id: I5f957e6d60a6f77d37a6ed7c6b7cf1eec10fb517
Change the behavior of pqPythonShell::pushScript() to split over newlines

Previously, you could not paste multiline statements into the ParaView
python console.  This commit changes the behavior of the pushScript()
function so that it splits the script code over the newline character
and pushes each line separately.

This does change the behavior of entering multiline statements: previously
pushScript() would attempt to detect the indent and start the next line
using the indent of the previous line.  This behavior has been removed.

The new behavior closely matches the behavior of the standard commandline
python interpreter.

Change-Id: I899ec69194a1cce3d82cefc2f13048aad8f81fec
Add a test for using the Python programmable filter with pvserver

Change-Id: I7bd887515a494c34c17e2f988b8885cedc32a7eb
Fix: in the programmable filter, delete the function before redefining it

This was a bug in the programmable filter.  If there was a syntax error
in the python script, then the python code that defined the RequestData
function (or other functions) would fail, and then the filter would
execute the previously defined version of the function.  The previously
defined version could have even been defined by a different programmable
filter.

In the future, the programmable filter could be refactored so that it
executes all code in a namespace (it could use the
vtkInteractivePythonConsole) which is cleaned up each time.  Currently,
it stores variables directly in the __main__ context.

Change-Id: Ieba0ca70396aa08fb7f8a8cc93aa4e2edc3f71c9
Fix the SetParameter API overloads of the vtkPythonProgrammableFilter

Commit fc8cabcd (April 2007) introduced a SetParameter function on the
programmable filter.  It added a string vector property to filter proxy
that could be used to set arbitrary parameter name/value pairs that would
be defined in the filter python script.

Commit 8311d712 (July 2011) introduced several SetParameter overloads so
that custom string, int, and double vector properties were supported.
This allowed proxy xml to declare custom properties on the python
programmable filter that would be presented in the GUI like regular
properties.  But, this commit also changed the behavior of the original
Parameter string vector property.

Commit 9176ba5c82 (March 2012) accidentally broke the SetParameter
overloads.

This commit (May 2013) fixes the SetParameter overloads and original
Parameter string vector property (but both cannot be used together).
This commit adds a test for the SetParameter API and adds an example
proxy xml file that demonstrates how to define a python programmable
filter with custom parameters.

Change-Id: I0e6ff3e438f12305cae8b07dc7e61cb6988aebe0
Merge topic 'python-refactoring' into next

d496b40 Fix the SetParameter API overloads of the vtkPythonProgrammableFilter
cf71f4f Fix: in the programmable filter, delete the function before redefining it
fcd6dcb Add a test for using the Python programmable filter with pvserver
4a092e2 Change the behavior of pqPythonShell::pushScript() to split over newlines
8b4a203 Execute python code in the context of the interactive console.
6ad8900 Don't print a newline when executing a python command in the console.
db432da Add a call to prompt() during the python shell startup
92422c7 Make sure the paraview module is always initialized by pqPythonManager
d679a29 Disable trace observers when tracing python state in cpstate.py
Merge topic '13024-python-debug-leaks-view' into next

327793f Add the debug leaks view to ParaView