add method to open a terminal in the current course

This commit is contained in:
Maximilian Keßler 2021-09-18 14:43:18 +02:00
parent 6e9f6c0c06
commit ced953bb82
2 changed files with 7 additions and 1 deletions

View file

@ -103,6 +103,11 @@ class Notes:
) )
return result.returncode return result.returncode
def open_terminal(self):
result = subprocess.Popen(
['termite'], env=self.environment(), cwd=self.root
)
def compile_master(self): def compile_master(self):
result = subprocess.run( result = subprocess.run(
['latexmk', '-f', '-interaction=nonstopmode', '-dvi-', '-pdf', str(self.master_file)], ['latexmk', '-f', '-interaction=nonstopmode', '-dvi-', '-pdf', str(self.master_file)],

View file

@ -8,7 +8,8 @@ def open_spec(specification: str):
switcher = { switcher = {
'full': current.notes.open_full, '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(): if specification in switcher.keys():