<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hej Sebastien,<div class=""><br class=""></div><div class="">Thanks, that did the trick, nice and simple :)</div><div class=""><br class=""></div><div class="">/ Martin</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 14 Apr 2017, at 15.15, Sebastien Jourdain <<a href="mailto:sebastien.jourdain@kitware.com" class="">sebastien.jourdain@kitware.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Thanks Martin,<div class=""><br class=""></div><div class="">The way we fixed that issue was by adding that line:</div><div class=""><br class=""></div><div class=""><a href="https://github.com/Kitware/ParaView/blob/master/Web/Python/paraview/web/protocols.py#L2287" class="">https://github.com/Kitware/ParaView/blob/master/Web/Python/paraview/web/protocols.py#L2287</a><br class=""></div><div class=""><br class=""></div><div class="">Can you check if that solve the problem on your end?</div><div class=""><br class=""></div><div class="">Seb</div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Fri, Apr 14, 2017 at 4:59 AM, Martin Rehr <span dir="ltr" class=""><<a href="mailto:rehr@nbi.ku.dk" target="_blank" class="">rehr@nbi.ku.dk</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Greetings,<br class="">
<br class="">
I have trouble getting a list of directory entries through the ParaviewWeb Visualizer.<br class="">
<br class="">
The ParaviewWeb Visualizer utilizes the ParaView source file: 'Web/Python2/paraview/web/<wbr class="">protocols.py’<br class="">
<br class="">
I have isolated the python code causing trouble and made a simple test:<br class="">
<br class="">
------------------------------<wbr class="">------------------------------<wbr class="">--<br class="">
from paraview import simple<br class="">
<br class="">
pxm = simple.servermanager.<wbr class="">ProxyManager()<br class="">
directory_proxy = pxm.NewProxy('misc', 'ListDirectory’)<br class="">
directory_proxy.List(path)<br class="">
file_list = directory_proxy.GetProperty('<wbr class="">FileList’)<br class="">
print "file_list.<wbr class="">GetNumberOfElements(): %s" % file_list.GetNumberOfElements(<wbr class="">)<br class="">
------------------------------<wbr class="">------------------------------<wbr class="">--<br class="">
<br class="">
‘file_list' remain empty no matter how many files located in ‘path’<br class="">
<br class="">
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.<br class="">
This can be fixed by modifying vtkSMDirectoryProxy::List[2] to:<br class="">
<br class="">
------------------------------<wbr class="">------------------------------<wbr class="">--<br class="">
bool vtkSMDirectoryProxy::List(<wbr class="">const char* dir)<br class="">
{<br class="">
bool result = this->CallDirectoryMethod("<wbr class="">OpenDirectory", dir);<br class="">
if (result)<br class="">
{<br class="">
this-><wbr class="">UpdatePropertyInformation(<wbr class="">this->GetProperty("<wbr class="">DirectoryList"));<br class="">
this-><wbr class="">UpdatePropertyInformation(<wbr class="">this->GetProperty("FileList"))<wbr class="">;<br class="">
}<br class="">
return result;<br class="">
}<br class="">
------------------------------<wbr class="">------------------------------<wbr class="">--<br class="">
<br class="">
And changing ‘vtkSIDirectoryProxy::<wbr class="">ReadXMLProperty’[1]:<br class="">
------------------------------<wbr class="">------------------------------<wbr class="">--------------------<br class="">
if (strcmp(name.c_str(), "FileList") == 0 || strcmp(name.c_str(), "DirectoryList”))<br class="">
-><br class="">
if (strcmp(name.c_str(), "FileList") == 0 || strcmp(name.c_str(), "DirectoryList") == 0)<br class="">
------------------------------<wbr class="">------------------------------<wbr class="">--------------------<br class="">
<br class="">
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.<br class="">
<br class="">
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.<br class="">
<br class="">
Best Regards,<br class="">
Martin Rehr<br class="">
<br class="">
[1] ParaViewCore/<wbr class="">ServerImplementation/Core/<wbr class="">vtkSIDirectoryProxy.cxx<br class="">
[2] ParaViewCore/ServerManager/<wbr class="">Default/vtkSMDirectoryProxy.<wbr class="">cxx<br class="">
<br class="">
<br class="">
<br class="">
<br class="">
<br class="">______________________________<wbr class="">_________________<br class="">
Powered by <a href="http://www.kitware.com/" rel="noreferrer" target="_blank" class="">www.kitware.com</a><br class="">
<br class="">
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank" class="">http://www.kitware.com/<wbr class="">opensource/opensource.html</a><br class="">
<br class="">
Search the list archives at: <a href="http://markmail.org/search/?q=Paraview-developers" rel="noreferrer" target="_blank" class="">http://markmail.org/search/?q=<wbr class="">Paraview-developers</a><br class="">
<br class="">
Follow this link to subscribe/unsubscribe:<br class="">
<a href="http://public.kitware.com/mailman/listinfo/paraview-developers" rel="noreferrer" target="_blank" class="">http://public.kitware.com/<wbr class="">mailman/listinfo/paraview-<wbr class="">developers</a><br class="">
<br class=""></blockquote></div><br class=""></div>
</div></blockquote></div><br class=""></div></body></html>