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

28 lines
1005 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')
6 months ago
content = mw.readFile(sql_file)
csql_data = content.split(';')
for i in range(len(csql_data)):
# print(csql_data[i])
# print(sql.execute(csql_data[i], ()))
sql.execute(csql_data[i], ())
6 months ago
return True