Add backgrounds to finish layout tutorial, add inline and remote CSS support with a default of browser.css which currently supports fonts and backgrounds

This commit is contained in:
csd4ni3l
2025-07-21 12:29:32 +02:00
parent a604a5dbd1
commit 09c1ce7f5a
8 changed files with 460 additions and 127 deletions

5
run.py
View File

@@ -14,9 +14,12 @@ sys.excepthook = on_exception
pyglet.resource.path.append(os.getcwd())
pyglet.font.add_directory('./assets/fonts')
if not log_dir in os.listdir():
if not os.path.exists(log_dir):
os.makedirs(log_dir)
if not os.path.exists("http_cache"):
os.makedirs("http_cache")
while len(os.listdir(log_dir)) >= 5:
files = [(file, os.path.getctime(os.path.join(log_dir, file))) for file in os.listdir(log_dir)]
oldest_file = sorted(files, key=lambda x: x[1])[0][0]