[Paraview] connecting buttons and python

Scott Wittenburg scott.wittenburg at kitware.com
Wed Feb 21 19:56:31 EST 2018


That actually looks ok to me.  Why isn't pvpython happy with it?  What
version of ParaView are you running?  If it's a recent ParaView and the
problem is you can't import wslink, then setting up a virtualenv with the
missing modules (wslink and its dependencies) might be what you need.  See
this blog post for more information on how to use pvpython but also bring
in the modules in your virtualenv:

https://blog.kitware.com/using-pvpython-and-virtualenv/

If the problem is something else, we might need more details.

Hope this helps.

Cheers,
Scott



On Wed, Feb 21, 2018 at 5:44 PM, Sgouros, Thomas <thomas_sgouros at brown.edu>
wrote:

> Thank you that's very helpful. Where will I find how to define the
> protocols on the python side? I've only found a wslink example that looks
> like this:
>
> from wslink import register as exportRPC
> from wslink.websocket import LinkProtocol
>
> class myProtocol(LinkProtocol):
>     def __init__(self):
>         super(myProtocol, self).__init__()
>
>     @exportRPC("myprotocol.testButton")
>     def testButton(self, nothing):
>         print("******* HELP ********")
>
> Pvpython isn't happy with this, but I'm not sure where to look for the
> right way to do it.
>
> Thank you,
>
>  -Tom
>
> On Wed, Feb 21, 2018 at 6:55 PM, Scott Wittenburg <
> scott.wittenburg at kitware.com> wrote:
>
>> Yes that link is old and broken, but if you navigate through the api docs
>> links, that is working.  Here's the direct link to the page you couldn't
>> find though:
>>
>> https://kitware.github.io/paraviewweb/api/IO_WebSocket_ParaV
>> iewWebClient.html
>>
>>
>>
>> On Wed, Feb 21, 2018 at 4:43 PM, Sgouros, Thomas <
>> thomas_sgouros at brown.edu> wrote:
>>
>>> Hello all:
>>>
>>> Got some nice looking buttons and widgets, but I can't seem to find
>>> examples of how to deliver the button press or other widget output to my
>>> pvpython server. I imagine the steps are:
>>>
>>> 1. Create a protocol on the python side. Can I use wslink.register, or
>>> is there paraviewweb functionality I should be using?
>>>
>>> 2. Create a matching protocol on the js side, with
>>> ParaviewWebClient.createClient(), but I'm not seeing how to link the
>>> protocol to a function that can be linked to a button press.
>>>
>>> Also, this page, found via a google search, seems potentially useful,
>>> but gives me a 404.
>>>
>>> https://kitware.github.io/paraviewweb/api/ParaViewWebClient.html
>>>
>>> Many thanks,
>>>
>>>  -Tom
>>>
>>> _______________________________________________
>>> Powered by www.kitware.com
>>>
>>> Visit other Kitware open-source projects at
>>> http://www.kitware.com/opensource/opensource.html
>>>
>>> Please keep messages on-topic and check the ParaView Wiki at:
>>> http://paraview.org/Wiki/ParaView
>>>
>>> Search the list archives at: http://markmail.org/search/?q=ParaView
>>>
>>> Follow this link to subscribe/unsubscribe:
>>> https://public.kitware.com/mailman/listinfo/paraview
>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://public.kitware.com/pipermail/paraview/attachments/20180221/ddb82cec/attachment.html>


More information about the ParaView mailing list