fhttpy/modules/http/file-handlers/pyp.py

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