import re, os, new, sys
from paravis import *
-
+# VTN: Avoid paraview.* instructions in this file.
+# It leads to problems during execution.
def _wrap_property(proxy, smproperty):
""" Internal function.
self.Observed = None
self.ObserverTag = -1
observed.RemoveObserver(tag)
- if self.SMProxy and (self.SMProxy, self.Port) in _pyproxies:
+ if _pyproxies and self.SMProxy and (self.SMProxy, self.Port) in _pyproxies:
del _pyproxies[(self.SMProxy, self.Port)]
def InitializeFromProxy(self, aProxy, update=True):
not isinstance(values, list):
values = (values,)
fullvalues = []
- for i in range(len(values)):
- val = self.ConvertValue(values[i])
- fullvalues.append(val)
- fullvalues.append('1')
+
+ # WARNING:
+ # The order of the two loops below are delibrately set in this way
+ # so that values passed in will take precedence.
+ # This is needed for backward compatibility of the
+ # property ElementBlocks for vtkExodusIIReader.
+ # If you attemp to change this, please verify that
+ # python state files for opening old .ex2 file (<=3.14) still works.
for array in self.Available:
if not values.__contains__(array):
fullvalues.append(array)
fullvalues.append('0')
+
+ for i in range(len(values)):
+ val = self.ConvertValue(values[i])
+ fullvalues.append(val)
+ fullvalues.append('1')
+
+
i = 0
for value in fullvalues:
self.SMProperty.SetElement(i, value)
creates a new connection to the data server on ds_host:ds_port and to the
render server on rs_host: rs_port.
"""
- global fromGUI
- if fromGUI:
- raise RuntimeError, "Cannot create a session through python. Use the GUI to setup the connection."
if ds_host == None:
session = vtkSMSession()
elif rs_host == None:
option).
The optional port specified the port to listen to.
"""
- global fromGUI
- if fromGUI:
- raise RuntimeError, "Cannot create a connection through python. Use the GUI to setup the connection."
session = vtkSMSessionClient()
session.Connect("csrc://hostname:" + port)
id = vtkProcessModule.GetProcessModule().RegisterSession(session)
global MultiServerConnections
global fromGUI
if fromGUI:
- raise RuntimeError, "Cannot disconnect through python. Use the GUI to disconnect."
+ # Let the UI know that we want to disconnect
+ ActiveConnection.Session.InvokeEvent('ExitEvent')
+ return
if ActiveConnection and (not session or session == ActiveConnection.Session):
session = ActiveConnection.Session
if MultiServerConnections:
def GetNumberOfConnections():
return len(MultiServerConnections)
+
+#VTN: Problem during execution
+#atexit.register(vtkPythonProgrammableFilter.DeleteGlobalPythonInterpretor)