opus-nt/scripts/api/main.py
2019-12-26 07:20:41 +01:00

21 lines
479 B
Python

opus.main = Munch()
def _mainOutput(msg,verbosity = 0):
if opus.verbosity > verbosity - 1:
print(msg)
with open('opus-nt.log','a') as file:
file.write(msg + "\n")
opus.main.output = _mainOutput
opus.script = Munch()
def _mainExecPy(_scriptPath):
opus.main.output("script -> execute -> " +_scriptPath,1)
_return = True
with open(_scriptPath) as _scriptFile:
exec(_scriptFile.read())
opus.main.output("done.",2)
return _return
opus.script.execute = _mainExecPy