small fixes
This commit is contained in:
@@ -23,6 +23,24 @@ def enonce_total(base_dir):
|
||||
return "".join(output)
|
||||
|
||||
import os
|
||||
import shlex
|
||||
|
||||
def edit_file_and_enter(file):
|
||||
editor = os.environ.get("EDITOR")
|
||||
try:
|
||||
if editor:
|
||||
subprocess.run(shlex.split(editor) + [str(file)])
|
||||
else:
|
||||
if sys.platform.startswith("linux"):
|
||||
subprocess.run(["xdg-open", str(file)])
|
||||
elif sys.platform == "darwin":
|
||||
subprocess.run(["open", str(file)])
|
||||
else:
|
||||
os.startfile(str(file))
|
||||
input("Press ENTER here once you have saved and closed the text file...")
|
||||
except Exception as e:
|
||||
print(f"Error running editor: {e}")
|
||||
|
||||
|
||||
def pdf_image_of_enonce(root_dir, label):
|
||||
pdf_path = os.path.join(root_dir, "Text2", f"{label}.pdf")
|
||||
|
||||
Reference in New Issue
Block a user