|
@@ -256,13 +256,15 @@ class AssistantTUI(App):
|
|
|
|
|
|
|
|
def action_screenshot(self) -> None:
|
|
def action_screenshot(self) -> None:
|
|
|
name = "stt-tui-%s.svg" % datetime.now().strftime("%Y%m%d-%H%M%S")
|
|
name = "stt-tui-%s.svg" % datetime.now().strftime("%Y%m%d-%H%M%S")
|
|
|
|
|
+ out_dir = "screenshots"
|
|
|
try:
|
|
try:
|
|
|
|
|
+ os.makedirs(out_dir, exist_ok=True)
|
|
|
save = getattr(self, "save_screenshot", None)
|
|
save = getattr(self, "save_screenshot", None)
|
|
|
if callable(save):
|
|
if callable(save):
|
|
|
- path = save(name)
|
|
|
|
|
|
|
+ path = save(name, path=out_dir)
|
|
|
else:
|
|
else:
|
|
|
svg = self.export_screenshot()
|
|
svg = self.export_screenshot()
|
|
|
- path = os.path.join(os.getcwd(), name)
|
|
|
|
|
|
|
+ path = os.path.join(out_dir, name)
|
|
|
with open(path, "w", encoding="utf-8") as f:
|
|
with open(path, "w", encoding="utf-8") as f:
|
|
|
f.write(svg)
|
|
f.write(svg)
|
|
|
except Exception as e:
|
|
except Exception as e:
|