Added settings page

Added logging to a .log file
Fixed Images loosing colour and rotation on thumbnail generation
Added more info to README
This commit is contained in:
Michał Gdula 2023-03-01 23:29:34 +00:00
parent a9b13f1e39
commit 828167f762
36 changed files with 819 additions and 131 deletions

View file

@ -1,6 +1,6 @@
import datetime
now = datetime.datetime.now()
import sys
import shutil
import os
@ -8,7 +8,6 @@ import sass
class compile():
def __init__(self, theme, dir):
print(f"Loading '{theme}' theme...")
@ -16,7 +15,7 @@ class compile():
font_path = os.path.join(dir, 'user', 'themes', theme, 'fonts')
dest = os.path.join(dir, 'static', 'theme')
print(f"Theme path: {theme_path}")
# print(f"Theme path: {theme_path}")
if os.path.exists(theme_path):
if os.path.exists(os.path.join(theme_path, 'style.scss')):
@ -52,7 +51,7 @@ class compile():
dest = os.path.join(dest, 'fonts')
if os.path.exists(dest):
print("Removing old fonts...")
print("Updating fonts...")
try:
shutil.rmtree(dest)
except Exception as e:
@ -61,7 +60,8 @@ class compile():
try:
shutil.copytree(source, dest)
print("Copied fonts to:", dest)
# print("Copied fonts to:", dest)
print("Copied new fonts!")
except Exception as e:
print("Failed to copy fonts!\n", e)
sys.exit(1)