From 08098f48a0f3db91e7a42ae40da9bc14163c0ec0 Mon Sep 17 00:00:00 2001 From: dami Date: Mon, 21 Jul 2025 19:17:11 +0800 Subject: [PATCH] Update sphinx_make.py --- plugins/manticoresearch/class/sphinx_make.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/plugins/manticoresearch/class/sphinx_make.py b/plugins/manticoresearch/class/sphinx_make.py index 0ccb1f409..239064fc5 100644 --- a/plugins/manticoresearch/class/sphinx_make.py +++ b/plugins/manticoresearch/class/sphinx_make.py @@ -9,8 +9,12 @@ import re import json -sys.path.append(os.getcwd() + "/class/core") -import mw +web_dir = os.getcwd() + "/web" +if os.path.exists(web_dir): + sys.path.append(web_dir) + os.chdir(web_dir) + +import core.mw as mw def getServerDir(): @@ -26,14 +30,14 @@ def getConf(): def getDbPort(): file = getConf() content = mw.readFile(file) - rep = 'port\s*=\s*(.*)' + rep = r'port\s*=\s*(.*)' tmp = re.search(rep, content) return tmp.groups()[0].strip() def getSocketFile(): file = getConf() content = mw.readFile(file) - rep = 'socket\s*=\s*(.*)' + rep = r'socket\s*=\s*(.*)' tmp = re.search(rep, content) return tmp.groups()[0].strip()