System updates will be applied on Mar 14th between 7am and 9am, EST (UTC-05:00). This site will have intermittent downtime during that time.
This MR build upon !6917 (merged) and extends it to cover more autocomplete cases in the Python Shell of the ParaView GUI. In particular, the following cases will be autocompleted (some already present in current master)
Sphere(R<TAB>)
(autocompletes properties of Sphere starting with R)s.<TAB>
(s is a proxy)s = Sph<TAB>
s = Sphere(Radius=1,End<TAB>
Connect(ds_<TAB>
(or for any free function in general)S<TAB>
(proxy or free functions)In the case of proxies we use the new function paraview.simple.ListProperties(s)
to get the available properties.
For free functions we utilize Python's inspect
module.
Also, we add preliminary support for autocompletion in pvpython
for Linux and MacOS.
Unfortunately, not all parts that go into the autocompletion features of the Python Shell in the GUI are exposed in python and they are also tied to Qt.
So we need to re-implement some functionality.
In particular, for pvpython we build a custom completer based on readline via the native Python library .
Tokenizing the promt and identifying the context for completion is done only at a coarse level and it is not complete yet but it offers basic new functionality
for pvpython. Currently it supports everything in the above list besides case 3.
readline
is a UNIX utility. What about Windows ? There are thirdparty implementations which we need to evaluate and vendor.