This is the code:
import lupa, os
class runDirectory(lupa.LuaRuntime):
def __init__(self, directory):
super().__init__()
if os.path.exists(directory):
if os.path.isfile(directory):
raise Exception("'" + directory + "' is file. Argument should be directory")
elif os.path.isdir(directory):
pass
else:
raise Exception("Unknown error occured when checking directory validity")
else:
raise FileNotFoundError("File/Directory does not exist")
allfiles = os.listdir(dir)
for file in allfiles:
with open(file, "r") as f:
self.eval(f.read())
Here is the error it returns:
luaInterpreter.runDirectory(directory="game/serverScriptStorage/langtypeLua")
File "lupa/lua54.pyx", line 268, in lupa.lua54.LuaRuntime.__cinit__
TypeError: __cinit__() got an unexpected keyword argument 'directory'