AutoYADM commit: 2025-06-10 15:28:37
This commit is contained in:
parent
b654a2f572
commit
f096e44679
2 changed files with 21 additions and 11 deletions
|
@ -9,6 +9,7 @@ import os
|
|||
import tempfile
|
||||
import signal
|
||||
import types
|
||||
import selectors
|
||||
|
||||
Position = tuple[int, int]
|
||||
SpecList = list[tuple[Position, Position]]
|
||||
|
@ -104,12 +105,21 @@ def main():
|
|||
sys.stdout.flush()
|
||||
daemonize(in_path, out_path, fifo_dir)
|
||||
|
||||
with open(in_path, "r") as infile, open(out_path, "w") as outfile:
|
||||
diagnostics: SpecList = []
|
||||
while True:
|
||||
line = infile.readline()
|
||||
sel = selectors.DefaultSelector()
|
||||
infile = open(in_path, "r", buffering=1)
|
||||
outfile = open(out_path, "w", buffering=1)
|
||||
sel.register(infile.fileno(), selectors.EVENT_READ, data=infile)
|
||||
|
||||
# with open(in_path, "r") as infile, open(out_path, "w") as outfile:
|
||||
diagnostics: SpecList = []
|
||||
while True:
|
||||
for key, _ in sel.select(timeout=None):
|
||||
infile_obj = key.data
|
||||
line = infile_obj.readline()
|
||||
# line = infile.readline()
|
||||
if not line:
|
||||
continue
|
||||
line = line.strip()
|
||||
assert isinstance(line, str)
|
||||
# # subprocess.run(["notify-send", f"Received command: {line}"])
|
||||
if line.startswith("set "):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue