From 77493ddf0b37cd7ef6250e73a44b5aace79b9d93 Mon Sep 17 00:00:00 2001 From: Francesco Luzzana Date: Wed, 6 Apr 2022 16:38:50 +0200 Subject: [PATCH] text preview and soft barcode --- screenless/bureau/soup/contents/rejection.txt | 40 +++++++++++++++++++ screenless/bureau/soup/soup.py | 14 ++++++- 2 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 screenless/bureau/soup/contents/rejection.txt diff --git a/screenless/bureau/soup/contents/rejection.txt b/screenless/bureau/soup/contents/rejection.txt new file mode 100644 index 0000000..419c71b --- /dev/null +++ b/screenless/bureau/soup/contents/rejection.txt @@ -0,0 +1,40 @@ +rejection as a discourse +rejection as a continuous renegotiation between filters +rejection as exclusion +rejection as fractal +rejection as spectrum +rejection as contingency +rejection as violence +rejection as oppression +rejection as empowerment +rejection as ritual +rejection as defensive spell +rejection as misunderstanding +rejection as border +rejection as layer +rejection as interface +rejection as a selection process +rejection as a filter +rejection as incomplete structure +rejection as foundation +rejection as truth / honesty +rejection and clarification, transcription, simplification +rejection as interpretation/translation +rejection as digestion/metabolization +rejection as instrument +rejection as curation +rejection as invitation +rejection as inclusion +rejection as care (and self-care) +rejection as direction +rejection as orientation +rejection as negative ontology for identity formation +rejection as tactic +rejection as a trigger for action +rejection as turning point +rejection as plot twist +rejection as suspense +rejection as narration and world-building +rejection as an act of love +rejection as a metaphor +rejection as heritage \ No newline at end of file diff --git a/screenless/bureau/soup/soup.py b/screenless/bureau/soup/soup.py index 20da9f0..de2dd83 100644 --- a/screenless/bureau/soup/soup.py +++ b/screenless/bureau/soup/soup.py @@ -50,8 +50,20 @@ class Soup(Bureau): def list_contents(self): files = glob.glob(os.path.join(self.mdir, 'contents', '*.txt')) + prn = self._get_small_printer() + for file in files: - self.print_small(file) + filename = os.path.basename(file) + self.print_small(filename) + prn.soft_barcode("code128", "SBtp." + filename) + + @add_command('tp', 'Print a short excerpt of a text') + def print_preview(self, data): + filename, _ = data.split(".") + + with open(os.path.join(self.mdir, 'contents', filename), 'r') as f: + text = f.read() + self.print_small(filename + '\n' + text[:200] + '...') # @add_command("weave", "Weave two text together") # def weave(self):