restart.py 706 B

12345678910111213141516171819202122
  1. from .tool.func import *
  2. def restart_2(conn):
  3. curs = conn.cursor()
  4. if admin_check(None, 'restart') != 1:
  5. return re_error('/error/3')
  6. if flask.request.method == 'POST':
  7. os.execl(sys.executable, sys.executable, *sys.argv)
  8. else:
  9. print('Restart')
  10. return easy_minify(flask.render_template(skin_check(),
  11. imp = [load_lang('wiki_restart'), wiki_set(), custom(), other2([0, 0])],
  12. data = '''
  13. <form method="post">
  14. <button type="submit">''' + load_lang('restart') + '''</button>
  15. </form>
  16. ''',
  17. menu = [['manager', load_lang('return')]]
  18. ))