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

17 lines
431 B
Python
Raw Normal View History

2022-02-14 21:43:12 +00:00
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