-
Notifications
You must be signed in to change notification settings - Fork 235
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
Editor example does not work #70
Comments
Can you please share your environment details. @igor-egorov |
Same here, Python 3.7.1 64 bits on win10, clean virtualenv |
I will check this, been off coding for two months. |
I was getting the same error. You fixed the source of the error on May 28, 2019 (9e9efaa), but the latest release on PyPi is from 2018. The error goes away if I change the offending line. I ended up just git cloning the latest commit and installing it from the local folder. |
Same here. I get the error with the PyPI version of PyInquirer under Python 3.7. |
Instead of @nesadi approach, you can also just pass a Validator into the 'validate' key... from PyInquirer import prompt, Validator, ValidationError
...
class ValidateEditor(Validator):
def validate(self, document):
if document.text and len(document.text.split('\n')) <= 1:
raise ValidationError(
message='Must be at least 1 line', cursor_position=len(document.text))
...
def askPaste():
questions = [
{
'name': 'content',
'type': 'editor',
'message': 'Opening editor',
# lambda text: len(text.split('\n')) >= 1 or 'Must be at least 1 line',
'validate': ValidateEditor,
'eargs': {
'editor': 'default',
'ext': '.tmp'
},
},
]
return prompt(questions) |
PyInquirer/examples/editor.py
does not work :(
Python 3.7.1
PyInquirer==1.0.3
The text was updated successfully, but these errors were encountered: