saving before having gemini take a crack at fixing things.
This commit is contained in:
parent
a9ac39357f
commit
aa782f3080
3 changed files with 224 additions and 12 deletions
|
|
@ -1,4 +1,5 @@
|
|||
from pathlib import Path
|
||||
from textmenu import TextMenu
|
||||
import threading
|
||||
import time
|
||||
import os
|
||||
|
|
@ -92,19 +93,23 @@ ANSI_ESCAPE_RE = re.compile(
|
|||
# ==========================================================
|
||||
|
||||
# ===================== UTILITY FUNCTIONS =================
|
||||
# def apply_backspaces(s):
|
||||
# # Ensure we are working with str
|
||||
# if isinstance(s, bytes):
|
||||
# s = s.decode(errors="ignore")
|
||||
def find_pk3_subfolders(base_path):
|
||||
"""
|
||||
Returns a list of subfolder names under base_path that contain
|
||||
at least one .pk3 file.
|
||||
"""
|
||||
base = Path(base_path)
|
||||
matches = []
|
||||
|
||||
# buf = []
|
||||
# for c in s:
|
||||
# if c == "\x08":
|
||||
# if buf:
|
||||
# buf.pop()
|
||||
# else:
|
||||
# buf.append(c)
|
||||
# return "".join(buf)
|
||||
if not base.is_dir():
|
||||
return matches
|
||||
|
||||
for entry in base.iterdir():
|
||||
if entry.is_dir():
|
||||
if any(f.is_file() and f.suffix.lower() == ".pk3" for f in entry.iterdir()):
|
||||
matches.append(entry.name)
|
||||
|
||||
return matches
|
||||
|
||||
def acquire_single_instance(lockfile_base: str):
|
||||
"""
|
||||
|
|
@ -583,6 +588,24 @@ def main():
|
|||
# bufsize=0, # unbuffered
|
||||
# universal_newlines=False)
|
||||
|
||||
items = ["Pee pee","Poo poo","Stinky caca peepee poopoo pants.","a","b","c","d"]
|
||||
menu = TextMenu(
|
||||
items,
|
||||
width=30,
|
||||
height=5,
|
||||
title="Choose your stink",
|
||||
border_fg="dark gray",
|
||||
border_bg="dark red",
|
||||
inside_fg="dark red",
|
||||
inside_bg="black",
|
||||
selected_fg="black",
|
||||
selected_bg="dark red",
|
||||
timeout=10
|
||||
)
|
||||
choice=menu.show()
|
||||
|
||||
print(f"You selected: {choice}")
|
||||
|
||||
if os.name == "nt":
|
||||
pty_proc = subprocess.Popen(
|
||||
[game_exe, "+set", "ttycon", "1"] + sys.argv[1:],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue