From 6d777d7ddef894dd553668910e8127fbf6c68b38 Mon Sep 17 00:00:00 2001 From: Francesco Luzzana Date: Wed, 6 Apr 2022 16:53:40 +0200 Subject: [PATCH] debug text preview --- screenless/bureau/soup/soup.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/screenless/bureau/soup/soup.py b/screenless/bureau/soup/soup.py index d54110d..c0c915d 100644 --- a/screenless/bureau/soup/soup.py +++ b/screenless/bureau/soup/soup.py @@ -60,10 +60,12 @@ class Soup(Bureau): @add_command('tp', 'Print a short excerpt of a text') def print_preview(self, data): - self.print_small(data) + self.log.debug(f'print_preview data param: {data}') filename, _ = data.split(".") + self.log.debug(f'filename: {filename}') + with open(os.path.join(self.mdir, 'contents', filename + '.txt'), 'r') as f: text = f.read() self.print_small(filename + '\n' + text[:200] + '...')