vsketch icon indicating copy to clipboard operation
vsketch copied to clipboard

Unable to change the value of a text param at runtime

Open bcongdon opened this issue 4 years ago • 1 comments

I'm getting an error at runtime when I try to update a text based param:

Traceback (most recent call last):
  File ".../vsketch/venv/lib/python3.8/site-packages/vsketch_cli/param_widget.py", line 115, in update_param
    self._param.set_value_with_validation(self.text())
AttributeError: 'TextParamWidget' object has no attribute 'text'

It looks like that error is coming from here: https://github.com/abey79/vsketch/blob/3501ec14d0233d5b14d686c96c3c1582e89cd849/vsketch_cli/param_widget.py#L115 Is it possible that this should be using self.toPlainText() instead of self.text()?

To repro:

class Sketch(vsketch.SketchClass):
    my_param = vsketch.Param("abc")

Run vsk run sketch, and then try to change the value of "my_param" using the text input.

bcongdon avatar Apr 18 '21 15:04 bcongdon

Hello, thanks for the report. I'll have to check tomorrow, but I maybe that str-based vsketch.Param instances require the choices parameter. The generic text field might not yet be implemented. If so, this would definitely be a shortcoming that needs addressing.

abey79 avatar Apr 18 '21 21:04 abey79