from http.server import BaseHTTPRequestHandler, HTTPServer
from pathlib import Path
import pprint
import time
import glob
import os
hostName = "localhost"
serverPort = 8080
paths = {}
def dump(obj):
s = ''
for attr in dir(obj):
s = s + "obj.%s = %r" % (attr, getattr(obj, attr)) + "\n"
return s
def get_png(path):
if path in paths:
return Path(pahts[path]).read_bytes()
for file in glob.glob("../**/" + path, recursive = True):
paths[path] = file
return Path(file).read_bytes()
return
def scan():
for file in glob.glob("../**/*.png", recursive = True):
basename = os.path.basename(file)
if basename in paths:
print("Duplicate texture name, please fix:\n * %s:\n - %s\n - %s\n" % (basename, paths[basename], file))
else:
paths[basename] = file
def color_picker():
return """
"""
def get_html(path):
content = "
Request: %s
" % path content += "" content += color_picker() content += "