修改引入公共方法方式

This commit is contained in:
Mr Chen
2024-11-24 06:02:41 +08:00
parent 941285d168
commit c9f03c0f69
58 changed files with 368 additions and 190 deletions
+6 -2
View File
@@ -6,8 +6,12 @@ import os
import time
import re
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
app_debug = False
if mw.isAppleSystem():
+6 -5
View File
@@ -11,11 +11,12 @@ import re
import json
import pymemcache
try:
sys.path.append(os.getcwd() + "/class/core")
import mw
except Exception as e:
import core.mw as 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 singleton(cls):
+6 -5
View File
@@ -12,11 +12,12 @@ import yaml
from bson.objectid import ObjectId
from bson.json_util import dumps
try:
sys.path.append(os.getcwd() + "/class/core")
import mw
except Exception as e:
import core.mw as 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 singleton(cls):
_instance = {}
+5 -5
View File
@@ -7,12 +7,12 @@ import time
import re
import redis
web_dir = os.getcwd() + "/web"
if os.path.exists(web_dir):
sys.path.append(web_dir)
os.chdir(web_dir)
try:
sys.path.append(os.getcwd() + "/class/core")
import mw
except Exception as e:
import core.mw as mw
import core.mw as mw
# def getPluginName():
+6 -5
View File
@@ -8,11 +8,12 @@ import re
import pymongo
import json
try:
sys.path.append(os.getcwd() + "/class/core")
import mw
except Exception as e:
import core.mw as 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 singleton(cls):
_instance = {}