Satisfy mypy and (re-)move files
This commit is contained in:
parent
ef5320058c
commit
2e56b1b925
10 changed files with 209 additions and 351 deletions
33
cheuph/test.py
Normal file
33
cheuph/test.py
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
import curses
|
||||
import subprocess
|
||||
import tempfile
|
||||
from typing import Any
|
||||
|
||||
|
||||
def main(stdscr: Any) -> None:
|
||||
while True:
|
||||
key = stdscr.getkey()
|
||||
|
||||
if key in {"\x1b", "q"}:
|
||||
return
|
||||
|
||||
elif key == "e":
|
||||
with tempfile.TemporaryDirectory() as tmpdirname:
|
||||
tmpfilename = tmpdirname + "/" + "tempfile"
|
||||
#stdscr.addstr(f"{curses.COLOR_PAIRS!r}\n")
|
||||
stdscr.addstr(f"{tmpdirname!r} | {tmpfilename!r}\n")
|
||||
|
||||
stdscr.getkey()
|
||||
|
||||
curses.endwin()
|
||||
subprocess.run(["nvim", tmpfilename])
|
||||
stdscr.refresh()
|
||||
|
||||
stdscr.getkey()
|
||||
|
||||
with open(tmpfilename) as f:
|
||||
for line in f:
|
||||
stdscr.addstr(line)
|
||||
|
||||
|
||||
curses.wrapper(main)
|
||||
Loading…
Add table
Add a link
Reference in a new issue