Simple Linux Panel
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mdserver-web/web/thisdb/init.py

26 lines
930 B

6 months ago
# coding:utf-8
# ---------------------------------------------------------------------------------
# MW-Linux面板
# ---------------------------------------------------------------------------------
# copyright (c) 2018-∞(https://github.com/midoks/mdserver-web) All rights reserved.
# ---------------------------------------------------------------------------------
# Author: midoks <midoks@163.com>
# ---------------------------------------------------------------------------------
6 months ago
import os
import core.mw as mw
6 months ago
def initPanelData():
6 months ago
_dbfile = mw.getPanelDataDir() + '/panel.db'
if os.path.exists(_dbfile):
return True
6 months ago
sql_file = mw.getPanelDir() + '/web/admin/setup/sql/default.sql'
6 months ago
sql = mw.M().dbPos(mw.getPanelDataDir(),'panel')
csql = mw.readFile(sql_file)
csql_list = csql.split(';')
for index in range(len(csql_list)):
sql.execute(csql_list[index], ())
return True