Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

strings in object fields #19

Open
k-eks opened this issue Oct 12, 2016 · 2 comments
Open

strings in object fields #19

k-eks opened this issue Oct 12, 2016 · 2 comments

Comments

@k-eks
Copy link

k-eks commented Oct 12, 2016

When trying to write a string into an object field or bool field, makes the node crash and stuck in place and no values can be changed.
Sometimes, I'll get the following error on keyboard input for each pressed key:

Traceback (most recent call last):
  File "/Users/mydata/projects/Floppy_contribution/floppy/painter.py", line 195, in keyPressEvent
    self.relayTo.keyPressEvent(event)
  File "/Users/mydata/projects/Floppy_contribution/floppy/painter.py", line 1414, in keyPressEvent
    self.text += self.sanitizeInputString(event.text())
  File "/Users/mydata/projects/Floppy_contribution/floppy/painter.py", line 1422, in sanitizeInputString
    self.data.info.varType(string)
TypeError: object() takes no parameters

If you suspect this is an IPython bug, please report it at:
    https://github.com/ipython/ipython/issues
or send an email to the mailing list at [email protected]

You can print a more detailed traceback right now with "%tb", or use "%debug"
to interactively debug it.

Extra-detailed tracebacks for bug-reporting purposes can be enabled via:
    %config Application.verbose_crash=True

screen shot 2016-10-12 at 13 59 22

@JLuebben
Copy link
Owner

I can reproduce this.
The problem can be solved for boolean inputs by explicitly defining the options in the node definition:
Input('Value', bool, select=(True, False))

object type inputs currently do not support direct input. The reason for that is that Floppy cannot really know what type it should convert the string to. It could simply keep the string but that might cause more confusion than it does good.
Currently, the intended way to put strings into an object input is to use the CreateString method.

I will fix the crash and think about better ways to do this.

@JLuebben
Copy link
Owner

Apparently, the cause of the crash is already fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants