From 41000f0c5d4f1b5c9fd0f3c2aa2c2a23b9159fd1 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sun, 24 Nov 2024 05:10:19 +0800 Subject: [PATCH] update --- plugins/webstats/install.sh | 2 +- plugins/webstats/tool_migrate.py | 7 +------ web/core/mw.py | 2 +- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/plugins/webstats/install.sh b/plugins/webstats/install.sh index 771f8d290..cb14928e0 100755 --- a/plugins/webstats/install.sh +++ b/plugins/webstats/install.sh @@ -133,7 +133,7 @@ Install_App() cp -rf $serverPath/source/webstats/GeoLite2-City.mmdb $serverPath/webstats/GeoLite2-City.mmdb fi - cd $rootPath && python3 ${rootPath}/plugins/webstats/index.py start + cd $rootPath && python3 plugins/webstats/index.py start echo '网站统计安装完成' diff --git a/plugins/webstats/tool_migrate.py b/plugins/webstats/tool_migrate.py index 1c02f8438..ddc66e884 100644 --- a/plugins/webstats/tool_migrate.py +++ b/plugins/webstats/tool_migrate.py @@ -31,11 +31,6 @@ def getServerDir(): return mw.getServerDir() + '/' + getPluginName() -def getTaskConf(): - conf = getServerDir() + "/task_config.json" - return conf - - def getConf(): conf = getServerDir() + "/lua/config.json" return conf @@ -126,7 +121,7 @@ def migrateSiteHotLogs(site_name, query_date): if field is None: field = "\'\'" elif type(field) == str: - field = "\'" + field.replace("\'", "\”") + "\'" + field = "\'" + field.replace("\'", "\"") + "\'" params += str(field) insert_sql = "insert into web_logs(" + \ _columns + ") values(" + params + ")" diff --git a/web/core/mw.py b/web/core/mw.py index 19921891e..38427e4d0 100644 --- a/web/core/mw.py +++ b/web/core/mw.py @@ -205,7 +205,7 @@ def readFile(filename): print(e) return False -def writeFile(filename, content, mode='w+'): +def writeFile(filename, content, mode='aw+'): # 写文件内容 try: fp = open(filename, mode)