diff --git a/ahserver/globalEnv.py b/ahserver/globalEnv.py index cefd270..e4c763a 100644 --- a/ahserver/globalEnv.py +++ b/ahserver/globalEnv.py @@ -90,6 +90,10 @@ async def save_file(str_or_bytes, filename): r = await fs.save(filename, str_or_bytes) return r +def webpath(path): + fs = FileStorage() + return fs.webpath(path) + def realpath(path): fs = FileStorage() return fs.realPath(path) @@ -243,6 +247,7 @@ def initEnv(): g.HttpClient = HttpClient g.rfexe = RegisterFunction().exe g.stream_response = stream_response + g.webpath = webpath def set_builtins(): all_builtins = [ i for i in dir(builtins) if not i.startswith('_')]