MantisBT - ParaView
View Issue Details
0013456ParaView(No Category)public2012-09-14 10:512012-10-29 17:04
Ian Curington 
Utkarsh Ayachit 
normalminorhave not tried
closedfixed 
3.14.1 
3.98.0 
TBD
incorrect functionality
0013456: Extend pqPythonManager to execute pvpython from memory buffer rather than file (patch supplied)
Summary:
  Request to extend python manager API to execute scripts from string buffer, rather than exclusively from external python file. Why? Within other plugins, filters, C++ programs, can be helpful to execute some small script. Currently, such small script must first be written to file, then executed, then removed.

Patch Submission:

Added executeRawScript() routine to pqPythonManager class to allow easy execution of pvpython scripts from memory-buffer, without needing to output them to external file first.

   patched files: pqPythonManager.[h,cxx]
   action: copy pqPythonManager.[h,cxx] to ParaView-3.14.1/Qt/Python

   DESCRIPTION:
   
   CHANGES: To make this patch, following changes were made (ParaView source patch):

       - Added declaration of added routine executeRawScript(...) to pqPythonManager.h Ln 136,
       - Added additional header files to pqPythonManager.cxx Ln 34-38 and
       - Added implementation of new routine executeRawScript(...) to pqPythonManager.cxx Ln 223-283.

Patch available for both 3.12 and 3.14.1. Tested and currently in production in application.
No tags attached.
patch pqPythonManager.patch (4,087) 2012-09-14 10:51
https://www.vtk.org/Bug/file/9279/pqPythonManager.patch
? pqPythonManager.h (5,720) 2012-09-14 10:53
https://www.vtk.org/Bug/file/9280/pqPythonManager.h
cxx pqPythonManager.cxx (17,898) 2012-09-14 10:54
https://www.vtk.org/Bug/file/9281/pqPythonManager.cxx
Issue History
2012-09-14 10:51Ian CuringtonNew Issue
2012-09-14 10:51Ian CuringtonFile Added: pqPythonManager.patch
2012-09-14 10:53Ian CuringtonFile Added: pqPythonManager.h
2012-09-14 10:54Ian CuringtonFile Added: pqPythonManager.cxx
2012-09-14 14:34Pat MarionNote Added: 0029212
2012-09-18 10:25Utkarsh AyachitAssigned To => Utkarsh Ayachit
2012-09-18 10:28Utkarsh AyachitNote Added: 0029216
2012-09-18 10:28Utkarsh AyachitStatusbacklog => gatekeeper review
2012-09-18 10:28Utkarsh AyachitFixed in Version => git-master
2012-09-18 10:28Utkarsh AyachitResolutionopen => fixed
2012-09-18 10:28Utkarsh AyachitStatusgatekeeper review => customer review
2012-09-20 20:46Alan ScottNote Added: 0029248
2012-09-20 20:46Alan ScottStatuscustomer review => closed
2012-10-29 17:04Utkarsh AyachitFixed in Versiongit-master => 3.98.0

Notes
(0029212)
Pat Marion   
2012-09-14 14:34   
This is possible to do without a patch. You would do this:

#include "pqPythonShell.h"
#include "pqPythonDialog.h"

pythonManager()->pythonShellDialog()->shell()->executeScript("print 'hello world!'");
(0029216)
Utkarsh Ayachit   
2012-09-18 10:28   
Functionality already supported.

Use:
pythonManager()->pythonShellDialog()->shell()->executeScript(....);
(0029248)
Alan Scott   
2012-09-20 20:46   
Functionality exist.