[Paraview] pqPythonShell on local server & local client

Weirs, V Gregory vgweirs at sandia.gov
Tue Feb 26 11:38:26 EST 2008


Sorry again, I misread your post. I didn't understand that the problem is getting to the already established server from your plugin python shell.

Greg


On 2/26/08 9:32 AM, "Weirs, V Gregory" <vgweirs at sandia.gov> wrote:


Sorry, it's not clear how much of this you are doing from a GUI Client where a connection is already established by default and how much is internal to your plugin.

It sounds like you are creating a second connection rather than using the one that is already established. That can happen if (in the python shell in the GUI Client) you get to servermanager by setting your python path to include paraview and then "import servermanager" rather than just "from paraview import servermanager" or "import paraview.servermanager". In the first case you get a second confused connection which shows up in the pipeline browser as a nameless server, and which hangs the Client. Your first and second bullets sound like you got the same thing.

Do you really want a second connection? It sounds like you got access to the first one before you called servermanager.Connect(). This is how the python shell in the GUI Client behaves; by default a connection is established when the Client starts.

Greg


On 2/26/08 7:11 AM, "Alexander Wille" <alexander.wille at mytum.de> wrote:

Hi everyone,


I got a little closer to using pqPythonShell: pqPythonShell.executeScript(...) actually takes a string argument containing the script and not the filename of the script (this should be more clearly documented). The next problem is that this pqPythonShell has its servermanager not connected to anything. I want it to work hand-in-hand with the GUI, so I need it to connect to the GUI's builtin server. But so far, all my trial-and-error-attempts failed, and just calling servermanager.Connect() without any arguments yields strange results:
- The pipeline browser lists a second, nameless server in the pipeline browser and creates a second 3D view.
- Preceding calls (prior to servermanager.Connect() through pqPythonShell) of servermanager.ActiveConnection in the standard Python Shell of the GUI return 'Connection (builtin::0)' while successive calls return 'Connection (::0)'.
- Using the new connection for creating and registering sources like SphereSource succeed but creating a representation fails.
I must be missing something important. What am I doing wrong?

Best regards,
Alexander Wille

P.S.: Just to make sure you get me right: I'm running a Paraview GUI, launch a pqPythonShell through a GUI plugin and would like it to execute scripts from .py-files just like they would when using Tools->Python Shell.




--
V. Gregory Weirs
Sandia National Laboratories                vgweirs at sandia.gov
P.O.Box 5800, MS 0378                        phone: 505 845 2032
Albuquerque, NM 87185-0378              fax: 505 284 0154
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/paraview/attachments/20080226/b54d3c6c/attachment.html


More information about the ParaView mailing list