This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright (c) 2021 | |
# | |
# Authors: | |
# Niteesh Babu G S <[email protected]> | |
# | |
# This work is licensed under the terms of the GNU GPL, version 2 or | |
# later. See the COPYING file in the top-level directory. | |
import argparse | |
import asyncio |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Simple visitor | |
""" | |
import sys | |
import pprint | |
from .schema import QAPISchema, QAPISchemaVisitor | |
class Dict(dict): | |
def __add__(self, rhs): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Simple visitor | |
""" | |
import sys | |
from .schema import QAPISchema, QAPISchemaVisitor | |
class SimpleVisitor(QAPISchemaVisitor): | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urwid | |
import complete | |
from blinker import Signal | |
import logging | |
logging.basicConfig(filename='log.txt', level=logging.INFO) | |
start_suggestion = Signal() | |
select_suggestion = Signal() | |
reset_suggestion = Signal() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DEBUG:asyncio:Using selector: EpollSelector | |
DEBUG:aqmp.qmp_protocol:Connecting ... | |
DEBUG:asyncio:Get address info localhost:1234, type=<SocketKind.SOCK_STREAM: 1> | |
DEBUG:asyncio:Getting address info localhost:1234, type=<SocketKind.SOCK_STREAM: 1> took 1.471ms: [(<AddressFamily.AF_INET: 2>, <SocketKind.SOCK_STREAM: 1>, 6, '', ('127.0.0.1', 1234))] | |
DEBUG:asyncio:<asyncio.TransportSocket fd=9, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('127.0.0.1', 38718), raddr=('127.0.0.1', 1234)> connected to localhost:1234: (<_SelectorSocketTransport fd=9 read=polling write=<idle, bufsize=0>>, <asyncio.streams.StreamReaderProtocol object at 0x7f61e67ad910>) | |
DEBUG:aqmp.qmp_protocol:Connected | |
DEBUG:aqmp.qmp_protocol:Awaiting greeting ... | |
DEBUG:aqmp.qmp_protocol:<-- { | |
"QMP": { | |
"version": { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DEBUG:asyncio:Using selector: EpollSelector | |
DEBUG:aqmp.qmp_protocol:Connecting ... | |
DEBUG:asyncio:Get address info localhost:1234, type=<SocketKind.SOCK_STREAM: 1> | |
DEBUG:asyncio:Getting address info localhost:1234, type=<SocketKind.SOCK_STREAM: 1> took 1.495ms: [(<AddressFamily.AF_INET: 2>, <SocketKind.SOCK_STREAM: 1>, 6, '', ('127.0.0.1', 1234))] | |
DEBUG:asyncio:<asyncio.TransportSocket fd=9, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('127.0.0.1', 37744), raddr=('127.0.0.1', 1234)> connected to localhost:1234: (<_SelectorSocketTransport fd=9 read=polling write=<idle, bufsize=0>>, <asyncio.streams.StreamReaderProtocol object at 0x7fe7b3aaa910>) | |
DEBUG:aqmp.qmp_protocol:Connected | |
DEBUG:aqmp.qmp_protocol:Awaiting greeting ... | |
DEBUG:aqmp.qmp_protocol:<-- { | |
"QMP": { | |
"version": { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DEBUG:asyncio:Using selector: EpollSelector | |
DEBUG:aqmp.qmp_protocol:Connecting ... | |
DEBUG:asyncio:Get address info localhost:1234, type=<SocketKind.SOCK_STREAM: 1> | |
DEBUG:asyncio:Getting address info localhost:1234, type=<SocketKind.SOCK_STREAM: 1> took 1.413ms: [(<AddressFamily.AF_INET: 2>, <SocketKind.SOCK_STREAM: 1>, 6, '', ('127.0.0.1', 1234))] | |
DEBUG:asyncio:<asyncio.TransportSocket fd=9, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('127.0.0.1', 35554), raddr=('127.0.0.1', 1234)> connected to localhost:1234: (<_SelectorSocketTransport fd=9 read=polling write=<idle, bufsize=0>>, <asyncio.streams.StreamReaderProtocol object at 0x7f5eb0f648e0>) | |
DEBUG:aqmp.qmp_protocol:Connected | |
DEBUG:aqmp.qmp_protocol:Awaiting greeting ... | |
DEBUG:aqmp.qmp_protocol:<-- { | |
"QMP": { | |
"version": { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import sys | |
from threading import Thread | |
import queue | |
import logging | |
logging.basicConfig(level=logging.INFO) | |
logging = logging.getLogger(__name__) | |
class Worker(Thread): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
import logging | |
import sys | |
logging.basicConfig(level=logging.DEBUG) | |
log = logging.getLogger('server') | |
class Session: | |
def __init__(self, name, reader, writer): | |
self._name = name |
NewerOlder