[Paraview] hidden python methods??

Berk Geveci berk.geveci at kitware.com
Fri Oct 17 12:37:47 EDT 2008


It is magic :-)

Actually, it is a common python design pattern. Most of the classes in
the servermanager module are wrappers around low-level classes
provided by the paraview server manager C++ library. In python, you
can define a method (__getattr__) that gets called whenever a symbol
cannot be resolved. This allows python classes to delegate
functionality to other classes. In your case, the reader object has a
member called SMProxy that it is delegating to. If you do
dir(reader.SMProxy)
you can the list of all available functions.

Property objects do the same thing. They delegate to a SMProperty member.

-berk


On Fri, Oct 17, 2008 at 12:16 PM, David Fuentes <fuentesdt at gmail.com> wrote:
> working through one of the examples on the wiki
>
> http://paraview.org/Wiki/ParaView/Python_Scripting#Animating
>
>
>  reader = sources.ExodusIIReader(".../can.ex2")
>    .
>    .
>    .
>  reader.UpdatePipelineInformation()
>
> However
>
>  dir(reader)
>
>
> does Not return a method by the name of "UpdatePipelineInformation"
> However, the call still works??
>
> How are you able to call a method that is not returned by dir()?
> Are there any python debuggers available that will let you step
> into the function reader.UpdatePipelineInformation()
> to see what is actually being called?
>
>
>
>
>
>
> thank you,
> df
> _______________________________________________
> ParaView mailing list
> ParaView at paraview.org
> http://www.paraview.org/mailman/listinfo/paraview
>
>


More information about the ParaView mailing list