spyglass/app/utils.py

21 lines
517 B
Python
Raw Permalink Normal View History

2024-02-10 18:49:38 +01:00
from pathlib import Path
2024-02-04 02:44:48 +01:00
def die(msg: str, code: str):
print(msg)
exit(code)
2024-02-10 18:49:38 +01:00
class Project:
def __init__(self, dir: Path, name: str = 'proj', editor: str = 'nvim', runner: str = None, multi: bool = False):
self.name: str = name
self.dir: Path = dir
self.editor: str = editor
self.runner: str = runner
self.multi: bool = multi
def __str__(self):
return f"{self.name} ->\n\tpath -> {self.dir}\n\teditor -> {self.editor}\n\trunner -> {self.runner}"