<HTML>
<HEAD>
<TITLE>Re: [Paraview] pqPythonShell on local server & local client</TITLE>
</HEAD>
<BODY>
<FONT FACE="Helvetica, Verdana, Arial"><SPAN STYLE='font-size:12.0px'><BR>
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.<BR>
<BR>
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.<BR>
<BR>
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.<BR>
<BR>
Greg<BR>
<BR>
<BR>
On 2/26/08 7:11 AM, "Alexander Wille" <alexander.wille@mytum.de> wrote:<BR>
<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Helvetica, Verdana, Arial"><SPAN STYLE='font-size:12.0px'>Hi everyone,<BR>
<BR>
<BR>
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:<BR>
- The pipeline browser lists a second, nameless server in the pipeline browser and creates a second 3D view.<BR>
- 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)'.<BR>
- Using the new connection for creating and registering sources like SphereSource succeed but creating a representation fails.<BR>
I must be missing something important. What am I doing wrong?<BR>
<BR>
Best regards,<BR>
Alexander Wille<BR>
<BR>
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.<BR>
<BR>
</SPAN></FONT></BLOCKQUOTE><FONT FACE="Helvetica, Verdana, Arial"><SPAN STYLE='font-size:12.0px'><BR>
<BR>
-- <BR>
<B>V. Gregory Weirs<BR>
</B>Sandia National Laboratories vgweirs@sandia.gov<BR>
P.O.Box 5800, MS 0378 phone: 505 845 2032<BR>
Albuquerque, NM 87185-0378 fax: 505 284 0154<BR>
</SPAN></FONT>
</BODY>
</HTML>