mirror of
https://github.com/agent0ai/agent-zero.git
synced 2026-04-28 19:51:11 +00:00
BIG PYTHON REFACTOR
Python scripts moved out of python/ folder to root to be unified with plugins + frontend extension around api calls
This commit is contained in:
parent
f94b7d742c
commit
d02dda3667
326 changed files with 1096 additions and 862 deletions
|
|
@ -1,36 +0,0 @@
|
|||
import os
|
||||
import sys
|
||||
from python.helpers import runtime
|
||||
from python.helpers.print_style import PrintStyle
|
||||
|
||||
_server = None
|
||||
|
||||
def set_server(server):
|
||||
global _server
|
||||
_server = server
|
||||
|
||||
def get_server(server):
|
||||
global _server
|
||||
return _server
|
||||
|
||||
def stop_server():
|
||||
global _server
|
||||
if _server:
|
||||
_server.shutdown()
|
||||
_server = None
|
||||
|
||||
def reload():
|
||||
stop_server()
|
||||
if runtime.is_dockerized():
|
||||
exit_process()
|
||||
else:
|
||||
restart_process()
|
||||
|
||||
def restart_process():
|
||||
PrintStyle.standard("Restarting process...")
|
||||
python = sys.executable
|
||||
os.execv(python, [python] + sys.argv)
|
||||
|
||||
def exit_process():
|
||||
PrintStyle.standard("Exiting process...")
|
||||
sys.exit(0)
|
||||
Loading…
Add table
Add a link
Reference in a new issue