[Paraview-developers] vtkSMDirectoryProxy::List

Sebastien Jourdain sebastien.jourdain at kitware.com
Fri Apr 14 09:15:40 EDT 2017


Thanks Martin,

The way we fixed that issue was by adding that line:

https://github.com/Kitware/ParaView/blob/master/Web/Python/paraview/web/protocols.py#L2287

Can you check if that solve the problem on your end?

Seb

On Fri, Apr 14, 2017 at 4:59 AM, Martin Rehr <rehr at nbi.ku.dk> wrote:

> Greetings,
>
> I have trouble getting a list of directory entries through the ParaviewWeb
> Visualizer.
>
> The ParaviewWeb Visualizer utilizes the ParaView source file:
> 'Web/Python2/paraview/web/protocols.py’
>
> I have isolated the python code causing trouble and made a simple test:
>
> --------------------------------------------------------------
> from paraview import simple
>
> pxm = simple.servermanager.ProxyManager()
> directory_proxy = pxm.NewProxy('misc', 'ListDirectory’)
> directory_proxy.List(path)
> file_list = directory_proxy.GetProperty('FileList’)
> print "file_list.GetNumberOfElements(): %s" %
> file_list.GetNumberOfElements()
> --------------------------------------------------------------
>
> ‘file_list' remain empty no matter how many files located in ‘path’
>
> I have tracked the problem down to that ‘vtkSIDirectoryProxy::Pull'[1] is
> never called and therefore the 'FileList' and ‘DirectoryList’ properties of
> ‘vtkSMDirectoryProxy' is never updated.
> This can be fixed by modifying vtkSMDirectoryProxy::List[2] to:
>
> --------------------------------------------------------------
> bool vtkSMDirectoryProxy::List(const char* dir)
> {
>   bool result = this->CallDirectoryMethod("OpenDirectory", dir);
>   if (result)
>   {
>     this->UpdatePropertyInformation(this->GetProperty("DirectoryList"));
>     this->UpdatePropertyInformation(this->GetProperty("FileList"));
>   }
>   return result;
> }
> --------------------------------------------------------------
>
> And changing ‘vtkSIDirectoryProxy::ReadXMLProperty’[1]:
> ------------------------------------------------------------
> --------------------
> if (strcmp(name.c_str(), "FileList") == 0 || strcmp(name.c_str(),
> "DirectoryList”))
> ->
> if (strcmp(name.c_str(), "FileList") == 0 || strcmp(name.c_str(),
> "DirectoryList") == 0)
> ------------------------------------------------------------
> --------------------
>
> I’m new to the ParaView code-base so I don’t know if this is the correct
> way to fix the above problem, any comments is appreciated.
>
> The above tests are performed on an Ubuntu 14.04 with kernel
> 3.13.0-112-generic #159-Ubuntu SMP and the official 5.3 source release
> (ParaView-v5.3.0.tar.gz) as well as the latest git checkout.
>
> Best Regards,
>    Martin Rehr
>
> [1] ParaViewCore/ServerImplementation/Core/vtkSIDirectoryProxy.cxx
> [2] ParaViewCore/ServerManager/Default/vtkSMDirectoryProxy.cxx
>
>
>
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/
> opensource/opensource.html
>
> Search the list archives at: http://markmail.org/search/?q=
> Paraview-developers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/paraview-developers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview-developers/attachments/20170414/a51b777a/attachment-0001.html>


More information about the Paraview-developers mailing list