Skip to content

Instantly share code, notes, and snippets.

@gs-niteesh
Created June 16, 2021 19:10
Show Gist options
  • Save gs-niteesh/04d9a32173089cc06580a224de8d4ae0 to your computer and use it in GitHub Desktop.
Save gs-niteesh/04d9a32173089cc06580a224de8d4ae0 to your computer and use it in GitHub Desktop.
Proposal for a minimum draft prototype:
- Uses Async QMP library
- Accepts a server destination on the command-line like the existing qmp-shell
- Probably use the argparse library for this.
- Connects to that server on startup.
- Uses a two-panel urwid TUI
- Text entry area:
- User can type a command
- Pressing <enter> sends that command
- raw QMP JSON in the message bar will work for the draft prototype.
- Text entry area should be visually delineated somehow -- Either a
background color or some kind of border.
- You can use AQMP's Message class to manually construct a "raw message",
and then submit it via .execute_msg() [1]
- History panel area:
- Shows both outgoing and incoming messages
- Most recent message is on the bottom
- First draft can simply show JSON with no spaces or newlines for each msg.
- History panel should show messages as they arrive.
- Is "scrollable":
- As new messages are displayed, old messages are pushed up
- If we have too many messages to display on one page, pressing page-up/
page-down should show us older/newer messages.
- If possible, some kind of visual indicator (like a scroll bar?) should
visually indicate if we are 'scrolled up' in the history
[1] (This is a little clunky, I want to rewrite AQMP's execute logic based
on feedback from Stefan to try and offer an 'execute_raw' interface. I
don't think you need to wait for this, though. I have a draft "v4" of
AQMP I need to finish, based on Stefan's feedback. It won't be ready
until next week, I think, so I wouldn't wait.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment