Comments (7)
Btw, is there a keyboard shortcut to get my cursor inside the prompt's textbox?
Not in 1.14.0. But I have just pushed a commit (in the devel
branch) that implements Ctrl+t and Ctrl+y, which jump to the previous/next unanswered question.
from moulti.
Technical notes: under the hood, supporting the pause module implies to support Display.prompt_until
, a method that takes 5 arguments:
- msg (str)
- private (bool)
- seconds: (int|None)
- interrupt_input: (bytes|None)
- complete_input: (bytes|None)
The first three arguments are already ok in my working directory.
interrupt_input
and complete_input
were designed with a tty in mind and translating them to a TUI requires some care:
interrupt_input
could become an "Interrupt" push-button, a suitable replacement forctrl+c
, which is no longer available to Ansible;- each entry other than
\r
and\n
incomplete_input
could become a new push-button.
Applied to the pause
module, that would leave us with one input field and three buttons: "Interrupt", "A" and "C" (respectively "Abort" and "Continue").
These buttons should ideally appear right under the input field. The input field is not always necessary, but there is no proper way to tell. There are various approaches to that:
- using an inputquestion widget and a buttonquestion widget:
- pro: easy
- con: clumsy-looking
- con: we lack a straightforward way to obtain the first answer from two widgets
- extending inputquestion so it offers optional push-buttons.
- pro: useful
- pro: better-looking
- con: does that deserve a new widget? what should
get-answer
output? - con: more work
from moulti.
extending inputquestion so it offers optional push-buttons.
I chose this way. Specifically, I introduced a question
widget that combines the abilities of inputquestion
and buttonquestion
:
widget \ feature | input field | buttons |
---|---|---|
inputquestion | yes | no |
buttonquestion | no | at least 1 |
question | Yes | at least 1 |
That should help me implement this feature request.
from moulti.
I have implemented and pushed prompt_until()
:
This feature should land in the next release.
from moulti.
Wow, that's awesome! Bien joué!
from moulti.
This feature is now available as part of Moulti 1.14.0.
from moulti.
@xavierog Tested and it works great.
Btw, is there a keyboard shortcut to get my cursor inside the prompt's textbox?
from moulti.
Related Issues (9)
- Debian 12 - Pip issue HOT 1
- [FR] indicator when scroll is locked HOT 12
- [FR] maintain expanded/collapsed preference for incoming messages HOT 11
- [FR] `?` help dialog HOT 10
- [FR] quit dialog: double CTRL-C to terminate the process HOT 6
- Non-optimized Python interpreters make Moulti slow HOT 13
- Which step would one take to integrate an existing Makefile with moulti? HOT 11
- Ansible-side change breaks Moulti's Ansible integration HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from moulti.