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

default function #6

Closed
rog555 opened this issue Nov 29, 2017 · 2 comments
Closed

default function #6

rog555 opened this issue Nov 29, 2017 · 2 comments

Comments

@rog555
Copy link

rog555 commented Nov 29, 2017

hi, awesome package!

is a function supplied to "default" supposed to work?

>>> from whaaaaat import prompt
>>> prompt({'name':'test','type':'input','message':'test','default':lambda a: 'DEFAULT'})
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Python/2.7/site-packages/whaaaaat/prompt.py", line 57, in prompt
    application = getattr(prompts, type).question(message, **_kwargs)
  File "/Library/Python/2.7/site-packages/whaaaaat/prompts/input.py", line 47, in question
    **kwargs
  File "/Library/Python/2.7/site-packages/prompt_toolkit/shortcuts.py", line 500, in create_prompt_application
    initial_document=Document(default),
  File "/Library/Python/2.7/site-packages/prompt_toolkit/document.py", line 83, in __init__
    assert isinstance(text, six.text_type), 'Got %r' % text
AssertionError: Got <function <lambda> at 0x1055855f0>
@rog555
Copy link
Author

rog555 commented Nov 29, 2017

submitted PR #7

@markfink
Copy link
Owner

glad you like it.
as I can see you have been busy. I am at the moment required by my day job so I can only try to take a look over the weekend. Please be aware that prompt-toolkit is undergoing major changes at the moment so this package might require some changes, too.

@markfink markfink closed this as completed Dec 4, 2017
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