fhttpy/modules/http/file-handlers/pyp.py
2022-02-14 22:43:12 +01:00

17 lines
431 B
Python

global handlePYP
def handlePYP(env,cpath = False,getlock = True):
code = False
if not cpath: cpath = env["fPath"]
if getlock:
with fileLock:
with open(cpath,encoding="utf-8") as cfile:
code = cfile.read()
else:
with open(cpath,encoding="utf-8") as cfile:
code = cfile.read()
env = runCode(code,{"env":env},cpath)["env"]
fileHandlers["pyp"] = handlePYP
global indexFiles
indexFiles = ["index.pyp"] + indexFiles