[Paraview] load plugin in pvpython/pvbatch (CVS)

Jean M. Favre jfavre at cscs.ch
Wed Aug 19 05:59:38 EDT 2009


I've got plugins working fine with paraview, but I cannot load them with
pvpython (pv3.7 CVS). Loading them without globals() gives no errors,
but they ain't visible. Loading them with globals() gives this error:

>>> LoadPlugin("MySMPlugin.so", remote='False', ns=globals())
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File
"/local/apps/ParaView3Build/Utilities/VTKPythonWrapping/paraview/simple.py",
line 530, in LoadPlugin
    servermanager.LoadPlugin(filename, remote)
  File
"/local/apps/ParaView3Build/Utilities/VTKPythonWrapping/paraview/servermanager.py",
line 2083, in LoadPlugin
    plinfo = plm.LoadPlugin(filename, connection.ID, serverURI, remote)
TypeError: function takes exactly 1 argument (4 given)


looking at the source code of simple.py, it seems like globals() is
required, but should not be the second argument, but the third argument.
 is this a copy-and-paste error from LoadXML()?

def LoadPlugin(filename, remote=True, ns=None):
    """Loads a ParaView plugin and updates this module with new
constructors if any. If you loaded the simple module with from
paraview.simple import *, make sure to pass globals() as the second
arguments: LoadPlugin("myplugin", globals()) Otherwise, the new
functions will not appear in the global namespace."""

thanks for any tip

Jean


More information about the ParaView mailing list