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

Class Text doesn't execute functions #83

Closed
mareckii opened this issue Feb 24, 2020 · 5 comments
Closed

Class Text doesn't execute functions #83

mareckii opened this issue Feb 24, 2020 · 5 comments

Comments

@mareckii
Copy link

mareckii commented Feb 24, 2020

field default doesn't execute function like message,
instead of execute shows string representation of function:
'<function getDefaultLogin at 0x10c9bee60>'

@mareckii mareckii changed the title Class Text doesn;t execute functions Class Text doesn't execute functions Feb 24, 2020
@yardensachs
Copy link

Same issue, looks like it's by design?

class Text(Question):
kind = 'text'
def __init__(self, name, message='', default=None, **kwargs):
super(Text, self).__init__(name, message=message,
default=str(default) if default
else default, **kwargs)

@mareckii
Copy link
Author

mareckii commented Mar 1, 2020

Documentation says function is supported:

default
~~~~~~~
Stores the default value to be used as answer. This allow the user just to press `Enter` to use it. It is optional, using ``None`` if there is no input and no default value.
As in ``message` , you can use a new format string or a function with the sign:
.. code:: python
def get_default(answers): return str()
Where ``answers`` is a ``dict`` containing all previous answers.

@jmrubio
Copy link

jmrubio commented May 4, 2020

The issue was introduced by #62

@jmrubio
Copy link

jmrubio commented May 4, 2020

Created a pull request for this #88

@AuHau AuHau closed this as completed in a277311 May 6, 2020
AuHau added a commit that referenced this issue May 6, 2020
fleytman referenced this issue in fleytman/python-inquirer Jul 14, 2022
after merge #83 remove 68-69 strings

ctrl+a select all
ctrl+q deselect all
tab move down
tab+shift move uo
@fleytman
Copy link

Sorry. This is the wrong link.

fleytman referenced this issue in fleytman/python-inquirer Jul 18, 2022
after merge #83 remove 68-69 strings

ctrl+a select all
ctrl+q deselect all
tab move down
tab+shift move uo
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

4 participants