2021-05-17 18:39:28 +02:00
|
|
|
from pathlib import Path
|
2021-05-17 00:33:41 +02:00
|
|
|
|
|
|
|
clear = '\033[0m'
|
|
|
|
colors = {
|
|
|
|
'red': '\033[31m',
|
|
|
|
'green': '\033[32m',
|
|
|
|
'yellow': '\033[33m',
|
|
|
|
'blue': '\033[34m',
|
|
|
|
'purple': '\033[35m',
|
|
|
|
'cyan': '\033[36m',
|
|
|
|
}
|
|
|
|
|
|
|
|
def printc(text, color='blue'):
|
|
|
|
print(f'{colors[color]}{text}{clear}')
|
|
|
|
|
|
|
|
def printerr(text):
|
2021-05-17 18:39:28 +02:00
|
|
|
print(f'\033[31;5m[ERROR] {text}{clear}')
|
|
|
|
|
|
|
|
def replaceContent(content, template, replaceF = lambda temp, cont: temp.replace("%CONTENT", cont)):
|
|
|
|
with open(str(Path(__file__).parent.absolute()) + f'/tex_templates/{template}.tex') as template:
|
|
|
|
return replaceF(template.read(), content)
|