mirror of
https://github.com/migatu/conjurer.git
synced 2026-07-14 13:34:40 +00:00
Music tunneling (#7)
* New requirement * SMall fixes for tunnel * First step towards cogization * Tmp chng * Testing of new functions in conjurer_musician.py and radio_conjurer.liq * Fixes! * Fix fix * Mostly working ? * Requests * Fixes * Fix * Radio requests * Radio hardkor * Fix * Fixes * Change log to print * Clearing fetch failed * Small fix * sx * Fix fix fix * test * el fixo stupido * test * Maybe fix ? * FIX! * Fix fix fix * FIx of volume
This commit is contained in:
@@ -13,6 +13,22 @@ IN_COMM_Q = Queue()
|
||||
awaiting_q = []
|
||||
incoming_q = Queue()
|
||||
app = Flask(__name__)
|
||||
class QueryControl:
|
||||
"""
|
||||
This class `QueryControl` is used to manage queries with information about the author, UUID,
|
||||
content, logger, context, and replies.
|
||||
"""
|
||||
def __init__(self, query_author, query_uuid, query_content, uplogger, ctx) -> None:
|
||||
self.author = query_author
|
||||
self.uuid = query_uuid
|
||||
self.content = query_content
|
||||
self.logger = uplogger
|
||||
self.stop = False
|
||||
self.ctx = ctx
|
||||
self.logger.info(
|
||||
f"Created Query control for {self.author}, {self.uuid}: {self.content}"
|
||||
)
|
||||
self.replies = []
|
||||
|
||||
@app.route("/conjurer", methods=["POST"])
|
||||
def answer_external_command():
|
||||
@@ -91,6 +107,13 @@ def scan_incoming(_logger):
|
||||
record.stop = True
|
||||
record.entries = answer[record.uuid]
|
||||
IN_COMM_Q.put(record)
|
||||
else:
|
||||
for key in answer.keys():
|
||||
record = QueryControl("Orphaned", key, "Orphan", _logger, None)
|
||||
record.stop = True
|
||||
record.entries = answer[record.uuid]
|
||||
record.uuid = "000000"
|
||||
IN_COMM_Q.put(record)
|
||||
except Empty:
|
||||
time.sleep(1)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user