From ced953bb82516855a17147843edbe30f6452490e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Ke=C3=9Fler?= Date: Sat, 18 Sep 2021 14:43:18 +0200 Subject: [PATCH] add method to open a terminal in the current course --- scripts/notes.py | 5 +++++ scripts/open.py | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/notes.py b/scripts/notes.py index 25da47c..c27e956 100644 --- a/scripts/notes.py +++ b/scripts/notes.py @@ -103,6 +103,11 @@ class Notes: ) return result.returncode + def open_terminal(self): + result = subprocess.Popen( + ['termite'], env=self.environment(), cwd=self.root + ) + def compile_master(self): result = subprocess.run( ['latexmk', '-f', '-interaction=nonstopmode', '-dvi-', '-pdf', str(self.master_file)], diff --git a/scripts/open.py b/scripts/open.py index a84b9c9..0c5a481 100644 --- a/scripts/open.py +++ b/scripts/open.py @@ -8,7 +8,8 @@ def open_spec(specification: str): switcher = { 'full': current.notes.open_full, - 'master': current.notes.open_master + 'master': current.notes.open_master, + 'terminal': current.notes.open_terminal } if specification in switcher.keys():